subject

Suppose you are acting as a consultant for the port authority of a small pacific rim nation. they are currently doing a multi-billion-dollar business per year, and their revenue is constrained almost entirely by the rate at which they can unload ships that arrive in the port. here is a basic sort of problem they face. a ship arrives with n containers of weight w1, w2, . . , wn. standing on the dock is a set of trucks, each of which can hold k units of weight. (you may assume that k and wi are integers.) you can stack multiple containers in each truck, subject to the weight restrictions of k. the goal is to minimize the number of trucks that are needed to carry all the containers. this problem is np-complete. a greedy algorithm you might use for this is the following. start with an empty truck and begin piling containers 1, 2, 3, . . into it until you get to a container that would overflow the weight limit. (these containers might not be sorted by weight.) now declare this truck “loaded” and send it off. then continue the process with a fresh truck. by considering trucks one at a time, this algorithm may not achieve the most efficient way to pack the full set of containers into an available collection of trucks.
(a) give an example of a set of weights and a value for k where this algorithm does not use the minimum number of trucks.
(b) show that the number of trucks used by this algorithm is within a factor of two of the minimum possible number for any set of weights and any value of k.

ansver
Answers: 2

Another question on Computers and Technology

question
Computers and Technology, 23.06.2019 18:30
Write a program that prints the day number of the year, given the date in the form month-day-year. for example, if the input is 1-1-2006, the day number is 1; if the input is 12-25-2006, the day number is 359. the program should check for a leap year. a year is a leap year if it is divisible by 4, but not divisible by 100. for example, 1992 and 2008 are divisible by 4, but not by 100. a year that is divisible by 100 is a leap year if it is also divisible by 400. for example, 1600 and 2000 are divisible by 400. however, 1800 is not a leap year because 1800 is not divisible by 400.
Answers: 3
question
Computers and Technology, 23.06.2019 19:30
Of the following pieces of information in a document, for which would you most likely insert a mail merge field?
Answers: 3
question
Computers and Technology, 23.06.2019 23:40
Which of the following calculates the total from the adjacent cell through the first nonnumeric cell by default, using the sum function in its formula? -average -autosum -counta -max
Answers: 1
question
Computers and Technology, 24.06.2019 13:50
Write a program that performs a simple n-body simulation, called "jumping leprechauns." this simulation involves n leprechauns, numberd 1 to n. it maintains a gold value g_i for each leprechaun i, which begins with each leprechaun starting out with a million dollars worth of gold, that is, g_i = 1000000 for each i = 1,. in addition, the simulation also maintains, for each leprachaun,i, a place on the horizon, which is represented as a double-precision floating point number, x_i. in each iteration of the simulation, the simulation processes the leprachauns in order. processing a leprachaun i during its iteration begins by computing a new place on the horizon for i, which is determined by the assignment:
Answers: 3
You know the right answer?
Suppose you are acting as a consultant for the port authority of a small pacific rim nation. they ar...
Questions
question
Physics, 13.04.2021 21:30
question
Mathematics, 13.04.2021 21:30
question
Mathematics, 13.04.2021 21:30
Questions on the website: 13722361