answer.
Ask question
Login Signup
Ask question
All categories
  • English
  • Mathematics
  • Social Studies
  • Business
  • History
  • Health
  • Geography
  • Biology
  • Physics
  • Chemistry
  • Computers and Technology
  • Arts
  • World Languages
  • Spanish
  • French
  • German
  • Advanced Placement (AP)
  • SAT
  • Medicine
  • Law
  • Engineering
Elena L [17]
2 years ago
5

You are consulting for a trucking company that does a large amount ofbusiness shipping packages between New York and Boston. The

volume ishigh enough that they have to send a number of trucks each day betweenthe two locations. Trucks have a fixed limit w on the maximum amountof weight they are allowed to carry. Boxes arrive at the New York stationone by one, and each package i has a weight wi. The trucking stationis 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 arrivedafter his make it to Boston faster. At the moment, the company is usinga simple greedy algorithm for packing: they pack boxes in the order theyarrive, and whenever the next box does not fit, they, send the truck on itsway.But they wonder if they might be using too many trucks, and theywant your opinion on whether the situation can be improved. Here ishow they are thinking. Maybe one could decrease the number of trucksneeded by sometimes sending off a truck that was less full, and in thisway allow the next few trucks to be better packed.Prove that, for a given set of boxes with specified weights, the greedyalgorithm currently in use actually minimizes the number of trucks thatare needed. Your proof should follow the type of analysis we used forthe Interval Scheduling Problem: it should establish the optimality of thisgreedy packing algorithm by identifying a measure under which it "staysahead" of all other solutions.
Computers and Technology
1 answer:
likoan [24]2 years ago
6 0

Answer:

Answer explained with detail below

Explanation:

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.

You might be interested in
What advantage do ExpressCard modules and USB adapters offer over expansion cards?
ss7ja [257]
<span>ExpressCard modules and USB adapters are faster and smaller. They are easier to plug into a computer and allow a person to add memory, wired and wireless communications, multimedia, and security features by inserting the small card or adapter into a small slot in the computer.</span>
3 0
2 years ago
HELP ASAP U GET BRAINLIEST
Korolek [52]
B) <span>tool bar

i hope helped ^-^</span>
7 0
1 year ago
Read 2 more answers
George is working with an image in Photoshop. He added a lot of effects to the image. He saved the first draft of the file. The
Alja [10]

Answer:

JPEG, PDF

Explanation:

3 0
2 years ago
Read 2 more answers
Create a single list that contains the following collection of data in the order provided:
ivann1987 [24]

Answer:

A code was created to single list that contains the following collection of data in the order provided

Explanation:

Solution

#list that stores employee numbers

employeee_numbers=[1121,1122,1127,1132,1137,1138,1152,1157]

#list that stores employee names

employee_name=["Jackie Grainger","Jignesh Thrakkar","Dion Green","Jacob Gerber","Sarah Sanderson","Brandon Heck","David Toma","Charles King"]

#list that stores wages per hour employee

hourly_rate=[22.22,25.25,28.75,24.32,23.45,25.84,22.65,23.75]

#list that stores salary employee

company_raises=[]

max_value=0

#list used to store total_hourly_rate

total_hourly_rate=[]

underpaid_salaries=[]

#loop used to musltiply values in hourly_wages with 1.3

#and store in new list called total_hourly_rate

#len() is used to get length of list

for i in range(0,len(hourly_rate)):

#append value to the list total_hourly_rate

total_hourly_rate.append(hourly_rate[i]*1.3)

for i in range(0,len(total_hourly_rate)):

#finds the maximum value

if(total_hourly_rate[i]>max_value):

max_value=total_hourly_rate[i] #stores the maximum value

if(max_value>37.30):

print("\nSomeone's salary may be a budget concern.\n")

for i in range(0,len(total_hourly_rate)):

#check anyone's total_hourly_rate is between 28.15 and 30.65

if(total_hourly_rate[i]>=28.15 and total_hourly_rate[i]<=28.15):

underpaid_salaries.append(total_hourly_rate[i])

for i in range(0,len(hourly_rate)):

#check anyone's hourly_rate is between 22 and 24

if(hourly_rate[i]>22 and hourly_rate[i]<24):

#adding 5%

hourly_rate[i]+=((hourly_rate[i]/100)*5)

elif(hourly_rate[i]>24 and hourly_rate[i]<26):

#adding 4%

hourly_rate[i]+=((hourly_rate[i]/100)*4)

elif(hourly_rate[i]>26 and hourly_rate[i]<28):

#adding 3%

hourly_rate[i]+=((hourly_rate[i]/100)*3)

else:

#adding 2% for all other salaries

hourly_rate[i]+=((hourly_rate[i]/100)*2)

#adding all raised value to company_raises

company_raises.extend(hourly_rate)

#The comparison in single line

for i in range(0,len(hourly_rate)):

 For this exercise i used ternary

operator hourly_rate[i]= (hourly_rate[i]+((hourly_rate[i]/100)*5)) if (hourly_rate[i]>22 and hourly_rate[i]<24) else (hourly_rate[i]+((hourly_rate[i]/100)*4)) if (hourly_rate[i]>24 and hourly_rate[i]<26) else hourly_rate[i]+((hourly_rate[i]/100)*2)

8 0
2 years ago
Name and summarize the four levels of administration necessary to keep human services organization operating smoothly
aliina [53]
The four levels of organization incorporate official chiefs, program executives, improvement chiefs, and give essayists. The meaning of business organization is a program of study offered at colleges and schools that attention on business hypothesis, practices, and administration. A case of business organization is a class on the standards of bookkeeping.
3 0
2 years ago
Read 2 more answers
Other questions:
  • If you have long column labels with columns so wide that they affect the readability of a worksheet, you should first
    7·1 answer
  • __________ is the electronic transmission of signals for communications, which enables organizations to carry out their processe
    8·1 answer
  • Which telecommunications device is widely used in industries that require closed communication?
    7·2 answers
  • ______ is a statistic that measures how quickly the staff corrected a network problem after they arrived at the problem site. MT
    9·1 answer
  • Static packet filtering firewalls are limited to ________. inspecting packets for which there are good application proxy filteri
    8·1 answer
  • Recall the problem of finding the number of inversions. As in the text, we are given a sequence of n numbers a1, . . . , an, whi
    8·1 answer
  • To play game, go inside the Grand Theft Auto V folder and right click and runGTAVLauncher as administrator.If you get any missin
    5·1 answer
  • Nathan would like to save his PowerPoint presentation as a video that can be replayed easily on any device at full quality. Whic
    14·1 answer
  • A ______________ deals with the potential for weaknesses within the existing infrastructure to be exploited.
    10·2 answers
  • Using virtualization comes with many advantages, one of them being performance. Which of these is NOT another realistic advantag
    7·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!