🏗️ ΘρϵηΠατπ🚧 (under construction)

Job
A Job J is a half closed half open interval [sJ,fJ)R, we say that sJ is it's start time and fJ is it's finishing time.
Job Compatibility for Two Jobs
We say that two jobs I,J are comptible iff IJ

Note that two jobs where the finish time of one equals the start time of the other are still compatible

Job Compatibility
Suppose that J is a collection of jobs then we say that J's jobs are compatible iff for any I,JJ such that IJ they are compatible.
Interval Scheduling Problem
Suppose that J is a collection of jobs, find the largest subset SJ such that S's jobs are compatible.

When trying to solve a problem using a greedy approach one can usually consider a collection of finite natural orderings that a normal human may guess. For example, for the interval scheduling problem we could consider the following approaches. Where we start with some element, and then iteratively try to add new elements so long as the new element is compatible and using some heuristic.

For earliest start time we can see that it does not work via this counter example

Shortest Interval Counter Example

TODO: Earliest finish time implementation

It turns out that adding valid jobs based on earliest finish time yields an optimal solution

Earliest Finish Time Adding Criterion
Suppose that EFT run on a set of jobs J and is paused during iteration. If it's solution thus far is S=(s1,s2,,sk), and there is at least one job in aJS, such that S{a} is compatible, then after this iteration EFT will increase it's solution by exactly one job.
Earliest Finish Time is Optimal

Note that in the above proof it's important to realize that if S was optimal then k=m and r=k, and then in the latter part of the proof we wouldn't be able to talk about sr+1 because it would be an invalid index.