subject

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.

ansver
Answers: 3

Another question on Computers and Technology

question
Computers and Technology, 22.06.2019 06:30
This technology is used to produce high-quality documents that look good on the computer screen and in print.
Answers: 1
question
Computers and Technology, 22.06.2019 08:30
Active listen eliminates barries to communication true or false
Answers: 1
question
Computers and Technology, 22.06.2019 14:30
Create a pseudocode design to prompt a student for their student id and the titles of the three classes they want to add. the solution should display the student’s id and a total bill. • bill a student using the following rules: o students can only add up to 3 classes at a time.
Answers: 3
question
Computers and Technology, 23.06.2019 00:20
Ihave been given the number of guns per 100, and the total firearm-related deaths per 100,000. i have to find the actual number of guns per country and actual number of gun-related deaths. if somebody could show me how to do 1 question, i can finish the rest, i am just confused. tia
Answers: 3
You know the right answer?
Suppose you are in charge of unloading containers from ships arriving at a port onto trucks. A ship...
Questions
question
History, 02.12.2020 19:00
question
English, 02.12.2020 19:00
question
Mathematics, 02.12.2020 19:00
question
Mathematics, 02.12.2020 19:00
Questions on the website: 13722361