Question

You are consulting for a trucking company that does a large amount of business shipping packages...

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.

Try to implement the above algorithm using the C++ language.

Homework Answers

Answer #1

Consider the solution given by the greedy algorithm as a sequence of packages, here represented by indexes: 1, 2, 3, ... n. Each package i has a weight, w_i, and an assigned truck t_i. { t_i } is a non-decreasing sequence (as the k'th truck is sent out before anything is placed on the k+1'th truck). If t_n = m, that means our solution takes m trucks to send out the n packages.

If the greedy solution is non-optimal, then there exists another solution { t'_i }, with the same constraints, s.t. t'_n = m' < t_n = m.

Consider the optimal solution that matches the greedy solution as long as possible, so \for all i < k, t_i = t'_i, and t_k != t'_k.
t_k != t'_k => Either

1) t_k = 1 + t'_k
i.e. the greedy solution switched trucks before the optimal solution.

But the greedy solution only switches trucks when the current truck is full. Since t_i = t'_i i < k, the contents of the current truck after adding the k - 1'th package are identical for the greedy and the optimal solutions.
So, if the greedy solution switched trucks, that means that the truck couldn't fit the k'th package, so the optimal solution must switch trucks as well.

So this situation cannot arise.

2) t'_k = 1 + t_k
i.e. the optimal solution switches trucks before the greedy solution.

Construct the sequence { t"_i } s.t.
t"_i = t_i, i <= k
t"_k = t'_i, i > k

This is the same as the optimal solution, except package k has been moved from truck t'_k to truck (t'_k - 1). Truck t'_k cannot be overpacked, since it has one less packages than it did in the optimal solution, and truck (t'_k - 1)
cannot be overpacked, since it has no more packages than it did in the greedy solution.

So { t"_i } must be a valid solution. If k = n, then we may have decreased the number of trucks required, which is a contradiction of the optimality of { t'_i }. Otherwise, we did not increase the number of trucks, so we created an optimal solution that matches { t_i } longer than { t'_i } does, which is a contradiction of the definition of { t'_i }.

So the greedy solution must be optimal.

Know the answer?
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for?
Ask your own homework help question
Similar Questions
Financial information for the project: 1. You decide to open a small business in Charleston, WV...
Financial information for the project: 1. You decide to open a small business in Charleston, WV that will cater primarily to busy office workers downtown. You are going to offer a gourmet box lunch to be delivered to any office with a minimum number of 5 orders. This lunch will include a gourmet sandwich, a bag of chips, a cookie, and a bottle of water. Because you are using only the finest ingredients, you will charge $9.15per lunch. 2. The...
The Boeing Company, headquartered in Chicago, Illinois, is one of the two major producers of aircraft...
The Boeing Company, headquartered in Chicago, Illinois, is one of the two major producers of aircraft in the global market. The other major producer is European Airbus. Boeing produces three models in Everett, Washington: 747s, 767s, and 777s. The planes are all produced in the same building. At any one time, there may be as many as six planes in various stages of production. Obviously the building has to be fairly large to accommodate such a huge undertaking. In fact,...
What are 4 key things you learned about the topic from reading their paper? How does...
What are 4 key things you learned about the topic from reading their paper? How does the topic relate to you and your current or past job? Critique the paper in terms of the organization and quality. Team 3 answer questions above. Part I In today’s world we see fear among people when dealing with sexual harassment. This leads to people not reporting sexual harassment. A misconception about sexual harassment is that it’s only about touching and forcing other people...
Please read the article and answear about questions. Determining the Value of the Business After you...
Please read the article and answear about questions. Determining the Value of the Business After you have completed a thorough and exacting investigation, you need to analyze all the infor- mation you have gathered. This is the time to consult with your business, financial, and legal advis- ers to arrive at an estimate of the value of the business. Outside advisers are impartial and are more likely to see the bad things about the business than are you. You should...
Sign In INNOVATION Deep Change: How Operational Innovation Can Transform Your Company by Michael Hammer From...
Sign In INNOVATION Deep Change: How Operational Innovation Can Transform Your Company by Michael Hammer From the April 2004 Issue Save Share 8.95 In 1991, Progressive Insurance, an automobile insurer based in Mayfield Village, Ohio, had approximately $1.3 billion in sales. By 2002, that figure had grown to $9.5 billion. What fashionable strategies did Progressive employ to achieve sevenfold growth in just over a decade? Was it positioned in a high-growth industry? Hardly. Auto insurance is a mature, 100-year-old industry...
Please answer the following Case analysis questions 1-How is New Balance performing compared to its primary...
Please answer the following Case analysis questions 1-How is New Balance performing compared to its primary rivals? How will the acquisition of Reebok by Adidas impact the structure of the athletic shoe industry? Is this likely to be favorable or unfavorable for New Balance? 2- What issues does New Balance management need to address? 3-What recommendations would you make to New Balance Management? What does New Balance need to do to continue to be successful? Should management continue to invest...
Delta airlines case study Global strategy. Describe the current global strategy and provide evidence about how...
Delta airlines case study Global strategy. Describe the current global strategy and provide evidence about how the firms resources incompetencies support the given pressures regarding costs and local responsiveness. Describe entry modes have they usually used, and whether they are appropriate for the given strategy. Any key issues in their global strategy? casestudy: Atlanta, June 17, 2014. Sea of Delta employees and their families swarmed between food trucks, amusement park booths, and entertainment venues that were scattered throughout what would...
ADVERTISEMENT
Need Online Homework Help?

Get Answers For Free
Most questions answered within 1 hours.

Ask a Question
ADVERTISEMENT