Consider the problem of scheduling n jobs of known durations t 1 , t 2 , ... , t
ID: 3622690 • Letter: C
Question
Consider the problem of scheduling n jobs of known durations t1 , t2 , ... , tn for execution by a single processor. The jobs can be executed in any order, one job at a time. The time spent by one job in the system is the sum of the time spent by this job in waiting plus the time spent on its execution. You are asked to find a schedule that minimizes the total time spent by all the jobs in the system. Design an efficent algorithm which can always yield an optimal solution for this problem. Prove the optimality of your algorithm.
This is from a quiz for greedy algorithm and graph , thanks a lot!
Explanation / Answer
Algorithm greedy_process_scheduling { step 1: Arrange all process in ascending order and keep all in waiting queue.. step 2. While ( There is process remaing) step 3. { step 4. Extract first and execute. step 5. After execution remove the process from queue. step 6. } step 7. Exit }
Related Questions
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.