Question: . Design a greedy algorithm for arranging the queuing order in a supermarket. Suppose there are n customers come to the counter at the same
Design a greedy algorithm for arranging the queuing order in a supermarket. Suppose there are n customers come to the counter at the same time, noted as cccn the time to service ith customer is si i n and the absolute time to finish ith customer is Ti i n Your goal is to decide a queuing order of n customers to minimize the accumulated completion time waiting time service time of all n customers, that is to minimize n i Tia Provide an algorithm to solve this issue; b Prove the correctness of your algorithm by showing the greedy choice property and optimal sub structure; c Justify the running time of your algorithm.
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
