Note that two jobs where the finish time of one equals the start time of the other are still 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
Suppose that we are given jobs
Let
The above defines
It's possible that
We are sure that
Our assumption was that ETF doesn't produce an optimal solution, and we obtained a contradiction.
Note that in the above proof it's important to realize that if