Lukas' Notes

computation scheduling

Definition

Earliest Due Date First Algorithm

The earliest due date first algorithm is a greedy algorithm that repeatedly schedules the available job with smallest due date.

In the interval scheduling problem, each job has fixed interval and its due date is its finish time . The algorithm therefore chooses compatible jobs in increasing order of .

Principle

For fixed intervals, accepting a job consumes the machine until its finish time. If two candidate jobs are both currently compatible and

then choosing leaves at least as much time for every later compatible job as choosing . This is the local reason why the earliest finishing job is safe.

Algorithm

Fixed intervals

Given jobs with intervals :

sort jobs by increasing f[j];
S = {};
t = -infinity;
 
for (j in jobs) {
    if (s[j] >= t) {
        S.add(j);
        t = f[j];
    }
}

The invariant is that is the finish time of the last selected job, and is a compatible set.

Correctness

Optimality for interval scheduling

For the interval scheduling objective , earliest due date first returns an optimal solution.

Exchange argument be the greedy solution. Let be an optimal compatible solution, ordered by increasing finish time.

Let

Consider the first position where and differ, after replacing earlier positions so that for .
At this point, both and are compatible with the common prefix. Since the algorithm chooses the compatible job with earliest due date,

Replace by . Every later job in starts after , and therefore also starts after . The replacement preserves feasibility and does not change the number of jobs.

Repeating this exchange transforms some optimal solution into one whose prefix is the greedy solution. When the greedy algorithm stops, no job remains that is compatible with its prefix. Hence no optimal continuation can contain more jobs, so .

Complexity

Sorting by due date takes . The greedy scan takes , so the total running time is

Limitation

Scope

Earliest due date first is optimal for unweighted interval scheduling with fixed intervals and objective . Different scheduling objectives, such as minimising maximum lateness or maximising total weight, require different proofs or different algorithms.