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 night 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.
You are consulting for a trucking company that does a large amount of business shippingpackages between New York and Boston. The volume is high enough that theyhave to send a number of trucks each day between the two locations. Trucks have afixed limit W on the maximum amount of weight they are allowed to carry. Boxesarrive at the New York station one by one, and each package i has a weight wi. Thetrucking 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, acustomer might get upset upon seeing a box that arrived after his make it to Bostonfaster. 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, theysend the truck on its way.But they wonder if they night be using too many trucks, and they want your opinionon whether the situation can be improved. Here is how they are thinking. Maybe onecould decrease the number of trucks needed by sometimes sending off a truck that wasless 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 currentlyin use actually minimizes the number of trucks that are needed. Your proofshould follow the type of analysis we used for the Interval Scheduling Problem: itshould establish the optimality of this greedy packing algorithm by identifying a measureunder which it “stays ahead” of all other solutions.
การแปล กรุณารอสักครู่..