Question

In: Computer Science

Assume that you have a set of jobs where each has only a processing time that...

Assume that you have a set of jobs where each has only a processing time that you need to schedule on a single machine.

Explain how you should schedule the jobs to minimize the sum of completion (finish) times. Write a proof that your schedule is optimal.

Solutions

Expert Solution

Given that we have all the process ready means there arrival time is same let's say 0 for simplicity now the algorithm that i will use to make sure that the sum of finish time is minimum is SHORTEST JOB FIRST . In Normal Cases this algorithm is impossible to use because we can't find the processing time of a process that is going to be scheduled in the future right,we cannot predict future ,thus we can't use this algorithm for scheduling in normal case but this is an ideal case we already have all the process with their processing time.

In SHORTEST JOB FIRST algorithm we schedule that process which has that minimum processing time of all the processes at that given time ,but in our case we have already have all the process ready so basically we find the minimum of all the process and schedule it and then remove the process from list and repeat till we have all our processes scheduled.

Now why this algorithm gives minimum sum of finish time,The key principle is how you schedule the process if you schedule a process then all the remaining process have to wait that long which in turn increase their finish time by that amount but if we schedule smaller process first then all the remaining process will have to wait for less time hence decrease in total finish time . The more our scheduling will be close to sorted (ascending) less will be our waiting time hence less finish time .If we schedule our processes in descending order then it give us maximum possible sum of finish time that's why this algorithm works.

If you have any doubt comment.

For test case , we take processes with processing time 2,4,5,1,1 now here we see that two process have same processing time
To break the tie we use first come first serve
But both arrive at Same time hence we can schedule any of the two.
Now sort the process in ascending order
1,1,2,4,5 now calculating the finish time of all the process one by one
1,2,4,8,13 respectively for each process
Now total finish time is 28 units. This is the minimum finish time obtainable for the above scheduling.

If we schedule in descending order then we get 49 unit which is the maximum possible sum of finish time.

If this answer helps you please like my answer,thank you.


Related Solutions

Five jobs are waiting for processing through two work centers. Their processing time? (in minutes) at...
Five jobs are waiting for processing through two work centers. Their processing time? (in minutes) at each work center is contained in the table below. Each job requires work center Alpha before work center Beta. According to? Johnson's rule, which job should be scheduled first in the? sequence? job Alpha beta r 20 10 s 25 35 t 50 20 u 15 35 v 55 75
Assume you have the following jobs to execute with one processor: i t(pi) Arrival Time 0...
Assume you have the following jobs to execute with one processor: i t(pi) Arrival Time 0 75 0 1 40 10 2 25 10 3 20 80 4 45 85 Using the table, assume the context switch time is five time units with RR scheduling. Create a Gantt chart illustrating the execution of these processes. What is the turnaround time for process p3? What is the average wait time for the processes?
Evan Schwartz has six jobs waiting to be processed through his machine. Processing time (in days)...
Evan Schwartz has six jobs waiting to be processed through his machine. Processing time (in days) and due date information for each job are as follows: Job Processing Time Due Date A B C D E F 2 1 5 3 4 7 3 2 12 4 8 11 Sequence the jobs by FCFS, SPT, SLACK, and DDATE. Calculate the mean flow time and mean tardiness of the six jobs under each sequencing rule. Which rule would you recommend?
Assume you have the following jobs to execute with one processor, with the jobs arriving in the order listed above.
i t(pi) 0 80 1 20 2 10 3 20 4 50 Assume you have the following jobs to execute with one processor, with the jobs arriving in the order listed above. Suppose a system uses FCFS scheduling. Create a Gantt chart illustrating the execution of these processes . b   What is the turnaround time for process p3? c.   What is the average wait time for the processes? Using the process load above, suppose a system uses SJN scheduling. d...
For the following parts, assume you have a hollowed solid where the hollow region has a...
For the following parts, assume you have a hollowed solid where the hollow region has a radius of 1/3 of the whole solid and the charge density can be expressed as ?=??2 with units of ?/?3 where r is measured in meters and β is a constant. Determine the value and units of β for the following cases: a) a sphere with outer radius of 12.0 cm and total charge of +8.73 μC and b) a cylinder with an outer...
Many service-sector jobs in the United States have moved to other countries where these jobs are...
Many service-sector jobs in the United States have moved to other countries where these jobs are done at a fraction of the cost. The outsourcing of jobs overseas is heavily debated by politicians, policymakers, and economists in the United States. Based on your understanding of trade and the benefits and losses from trade, how do you think outsourcing affects social surplus in the domestic economy?
You and your spouse are in good health and have reasonably secure jobs. Each of you...
You and your spouse are in good health and have reasonably secure jobs. Each of you makes about $33,000 annually. You own a home with a mortgage of $90,000, and you owe $18,100 on car loans, $7,800 in personal debt, and $3,800 in credit card loans. You have no other debt. You have no plans to increase the size of your family in the near future. You estimate that funeral expenses will be $8,500. Estimate your total insurance needs using...
A contractor has ten jobs awaiting processing at a bottleneck workstation. The day the job was...
A contractor has ten jobs awaiting processing at a bottleneck workstation. The day the job was received, its processing time and due date are given in the following table. It is now the beginning of day 13. job day job was received job processing time (days) job due day A 1 6 41 B 2 10 25 C 7 2 19 D 8 9 31 E 9 1 18 Calculate the average throughput time and, for each job, the number...
When answering the following questions, assume that your company has a set as a time value...
When answering the following questions, assume that your company has a set as a time value of money for evaluation of options at 6% 3. As part of a larger manufacturing plant upgrade, you are tasked with deciding between 3 different options for a new machining operation. Option A has a shorter life span but the initial purchase price is the lowest. Option C has the longest expected life span but also the highest initial purchase price, while Option B...
In python this structure can be represented by a set of tuples, where each tuple has...
In python this structure can be represented by a set of tuples, where each tuple has two elements. The following two lines would build the set given above and the print it. >>> L = [(’dog’,’white’), (’cat’,’black’),(’mouse’,’black’)] >>> f = set(L) >>> print(f) {(’cat’, ’black’), (’dog’, ’white’), (’mouse’, ’black’)} In the example, first we store the tuples into a list, and then we create a set with those tuples. There are obviously countless other ways to initialize f and get...
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT