Computers and Technology

Suppose you are in charge of unloading containers from ships arriving at a port onto trucks. A ship arrives with n containers of weight w1, w2, . . . , wn tons. Standing on the dock is a set of trucks, each of which can hold 1 ton of weight. (You can assume that none of the containers weighs more than 1 ton, since in this case you would not be able to transport it.) You can stack multiple containers in each truck subject to the weight restriction of 1 ton. Hoping to minimize your truck rental expenses, you aim to minimize the number of trucks needed in order to carry all the containers. You start with the following greedy strategy. Start with an empty truck and begin loading containers 1, 2, 3, ... onto it until you get to a container that would overflow the weight limit. Now, declare this truck "loaded" and send it off; then continue the process with a fresh truck. After trying (and failing) to prove that this greedy algorithm is optimal, you decide to attempt to come up with a counter-example to see if you can discover that your strategy is not optimal.

Required:
Provide an example of a set of weights for which your algorithm does not use the minimum possible number of trucks.

answer
Answers: 3

Other questions on the subject: Computers and Technology

image
Computers and Technology, 22.06.2019 19:00, dadonelson2109
If your accelerator suddenly gets stuck what should you do
Answers: 2
image
Computers and Technology, 23.06.2019 06:30, QueeeenUknown7437
How do you write an argumentative essay about the importance of free enterprise ?
Answers: 1
image
Computers and Technology, 23.06.2019 16:30, 19thomasar
How to do this programming flowchart?
Answers: 3
image
Computers and Technology, 23.06.2019 21:20, nicki76
In microsoft word, when you highlight existing text you want to replace, you're in              a.  advanced mode.    b.  automatic mode.    c.  basic mode.    d.  typeover mode
Answers: 1
Do you know the correct answer?
Suppose you are in charge of unloading containers from ships arriving at a port onto trucks. A ship...

Questions in other subjects:

Konu
Mathematics, 09.12.2020 02:10