You are consulting for a trucking company that does a large

You are consulting for a trucking company that does a large amount of business shipping packages between New York and Boston. The volume is high enough that they have to send a number of trucks each day between the two locations. Trucks have a fixed limit W on the maximum amount of weight they are allowed to carry. Boxes arrive at the New York station one by one, and each package i has a weight wi. The trucking station is quite small, so at most one truck can be at the station at any time. Company policy requires that boxes are shipped in the order they arrive; otherwise, a customer might get upset upon seeing a box that arrived after his make it to Boston faster. At the moment, the company is using a simple greedy algorithm for packing: they pack boxes in the order they arrive, and whenever the next box does not fit, they send the truck on its way. But they wonder if they might be using too many trucks, and they want your opinion on whether the situation can be improved. Here is how they are thinking. Maybe one could decrease the number of trucks needed by sometimes sending off a truck that was less full, and in this way allow the next few trucks to be better packed. Prove that, for a given set of boxes with specified weights, the greedy algorithm currently in use actually minimizes the number of trucks that are needed. Your proof should follow the type of analysis we used for the Interval Scheduling Problem: it should establish the optimality of this greedy packing algorithm by identifying a measure under which it \"stays ahead\" of all other solutions

Solution

I think the explanation known by the greedy algorithm as a sequence of letters, now represent by index: 1, 2, 3… n. every package i has a weight, w_i, plus an assign truck t_i. {t_i} is an increasing sequence. If t_n = m, that way our explanation takes m trucks to throw out the n letters
If the greedy explanation is non optimal, there exist another explanation {t’_i}, with the similar constraint, s.t. t\'_n = m\' < t_n = m.
I think the optimal answer that match the greedy solution as extended as possible, so for all i < k,

t_i = t\'_i, and t_k! = t\'_k.
t_k ! = t’_k => also

the best solution.

t_k = 1 + t\'_k

that is the greedy explanation switched trucks ahead of the optimal solution.
Although the greedy explanations simply switch trucks after the present truck is filled. as t_i = t\'_i i < k, the inside of the present truck after addition the k - 1\'th package are the same for the greedy and the optimal explanation.
Therefore, if the greedy explanations switch trucks, means that the truck could not well the k\'th enclose, so the optimal explanation must change trucks as well.

So this condition cannot occur.
t\'_k = 1 + t_k

That is the best explanation switches trucks by the greedy answer.
Build the series {t\"_i} s.t.
t\"_i = t_i, i <= k
t\"_k = t\'_i, i > k
This is the similar as the best key, excepting package k has be stimulated as of truck t\'_k to truck. Truck t\'_k can’t be more crowded, as it has single less letters than the best explanation, and truck (t\'_k - 1). Can’t be above packed, as it has no extra packages than in the greedy key.
{t\"_i} have to be a suitable respond. If k = n, then might have reduce the digit of trucks necessary, which is a disagreement of the optimal of { t\'_i }. Or else, we didn’t raise the figure of trucks, thus we formed an best solution that match {t_i } longer than { t\'_i } do, which is a disagreement of the meaning of { t\'_i }. So the greedy answer must be best.

You are consulting for a trucking company that does a large amount of business shipping packages between New York and Boston. The volume is high enough that the

Get Help Now

Submit a Take Down Notice

Tutor
Tutor: Dr Jack
Most rated tutor on our site