Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Counter example for Job Scheduling Algorithm "Earliest End time First"

Well, we have the greedy algorithm for the job scheduling (scheduling the maximum number of jobs). we can use different techniques

  1. Shortest job first
  2. Earliest start time first
  3. Job with minimal conflicts first
  4. Earliest end time first

I have the counter example of first three strategies but I couldn't find the counter example for the fourth one.

here are the counter examples for first three methods

Shortest Job First :

Here we can schedule 2 jobs instead of one shorter. enter image description here

Earliest start time first :

Here we can schedule 6 smaller job that starts later instead on one that start earlier enter image description here

Job with minimal conflicts first :

Here we can schedule 4 jobs with conflicts 3,4,4,3 instead of 3 with minimal conflicts, that's 2,3,3

enter image description here

So, what would be the counter example of the last one Earliest end time first I couldn't find the counter example for this. So, it always gives an optimum solution for each set of data?

UPDATE 1 :

I have one executor to execute the job and I want to execute the maximum number of jobs.

like image 308
Muaaz Khalid Avatar asked Nov 24 '25 18:11

Muaaz Khalid


1 Answers

Earliest End time First is the greedy algorithm which gives optimal algorithm for above mentioned problem. (Actually the problem you have mentioned is called Interval Scheduling problem)

The proof can be done using charging argument. You compare the output of greedy algorithm to optimal solution and argue that you solution is not worse than optimal.

like image 83
Rishit Sanmukhani Avatar answered Nov 28 '25 17:11

Rishit Sanmukhani



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!