Claim: There exists an optimum solution (minimizes lateness) without any idle time
How do we prove that the greedy solution is as good as the optimum solution?
<aside> <img src="/icons/document_gray.svg" alt="/icons/document_gray.svg" width="40px" /> If the optimum solution has the earliest deadline first, it is the same anyway. However, either 1) some jobs that have the same deadline were swapped, or 2) a job with an earlier deadline was scheduled later. For option 1, if any two jobs that have the same deadline were swapped, let the lateness of job 1 be A and the lateness of job 2 be B. Swapping these two jobs would simply swap the latenesses of both jobs, hence the solution is still optimal. For option 2, if any two jobs that don’t have the same deadline were swapped, we can create a permutation of these jobs based on adjacent inversions. Any adjacent inversion won’t change the lateness of either job. Perform a bubble sort on this permutation. This will arrive at the greedy solution. Hence, the greedy solution is optimal.
</aside>
Belady’s optimal eviction strategy: evict page which is requested furthest into the future.
Least recently used page eviction strategy.