Scheduling to minimize average completion time: prove greedy is optimal.
Analyze the scheduling to minimize average completion time: prove greedy is optimal..
Examples
Input:"test_input_1"
Output:"output_1"
Input:"test_input_2"
Output:"output_2"
Hints
Consider the concept of "shortest job first" (SJF) scheduling and how it relates to minimizing average completion time.
Prove that any non-SJF schedule can be transformed into an SJF schedule without increasing the average completion time by swapping adjacent jobs.
Use an exchange argument to show that if a schedule is not SJF, there exists a pair of jobs where swapping them reduces the average completion time, contradicting optimality.
Scheduling to minimize average completion time: prove greedy is optimal.
Analyze the scheduling to minimize average completion time: prove greedy is optimal..