Farthest Possible Distance for a Truck Fleet When Transferring Gas

1.2k Views Asked by At

Given a fleet of 50 trucks, each with a full fuel tank and a range of 100 miles, how far can you deliver a payload? You can transfer the payload from truck to truck, and you can transfer fuel from truck to truck. Assume all the payload will fit in one truck.

The solution is 100/50 + 100/49 + ... + 100/1. Basically, drive all the trucks 100/trucks miles, stop (empty one truck's gas supply to all the other equally to keep them filled, so trucks becomes trucks - 1), and continue.

What is a mathematical explanation to "prove" that this is the farthest the payload can go?

1

There are 1 best solutions below

2
On

Suppose you have an optimal scheme for solving the problem. It'll involve transferring fuel at various times; let's call those $t_0, t_1, \ldots$, with $t_0 = 0$ being the moment when all the trucks are fueled up and start driving. I'll call the times $t_i$ the "transfer points." I'm going to assume trucks get 1 mile per gallon, and hence have 100 gallon tanks.

First observation: If any fuel is left behind at some point, there's an alternative solution in which some truck, instead of stopping at that point, drives on until the fuel runs out. So we may assume that there is no fuel left behind.

Corollary: All the fuel gets used up in some optimal solution. Let's from now on assume that we're working with an optimal solution in which that's true.

Second observation: The total distance driven by all trucks is a constant, since all the fuel gets used up.

Third observation: When the trucks leave a transfer point, we can transfer fuel from some trucks into others so that all but one truck is full, and still arrive at an equivalent solution (albeit possibly adding more transfer points).

The first part of this observation is easy to see: we can certainly move the fuel from truck to truck without changing anything at all, except that some truck may run out sooner than it would have previously, and need to be refueled by the others to get to the place it's "supposed" to get to.

What about the "at most one truck is not full?" What if you have 3 trucks driving with, say, 120 gallons of fuel? One gets 100 gals, and the other two get 10 each. Well...in that situation, you can do better (get more fuel a greater distance) by leaving one truck behind, filling the 2nd with 20 gals, and the third with 100. Now you're not using up the fuel that the 3rd truck used to use, so you go farther...so your previous solution could not have been optimal!

Fourth observation: by the same reasoning as above, if you have a fleet of k trucks (one of them perhaps not completely full), your next transfer should occur as soon as there's room to distribute the last truck's fuel into the other trucks' tanks.

This says that in at least one optimal approach, you should send out the 50 trucks, which should drive 2 miles. They'll then all have 98 gallons in them, and the 98 gallons from the 100th truck can be distributed, 2 gallons apiece, to the other 49 trucks. Then you repeat.

So while I haven't proved that this is what the trucks MUST do, I have shown that doing this is one optimal way to get as far as possible.

Here's another "optimal" way: everyone drives 1 mile, truck 100 distributes 49 gallons to all other trucks; they drive another 1 miles, and truck one distributes her remaining 49 gallons to the other trucks. And then you repeat. It's the same general effect, but it's a different solution. So I cannot show that the way you described is what HAS to happen -- it's not. But it IS a way of achieving the greatest distance.