Reputation: 2249
Well, we have the greedy algorithm for the job scheduling (scheduling the maximum number of jobs). we can use different techniques
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.
Earliest start time first :
Here we can schedule 6 smaller job that starts later instead on one that start earlier
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
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.
Upvotes: 3
Views: 3009
Reputation: 2269
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.
Upvotes: 6