graph LR
M' --- W
M --- W
M --- W'
Assume that $W$ … complete later
|
|
|
| ------- <------ conflicting/overlapping jobs (must choose one in advance)
| ------- ------
|
|
------------------------------- time
Every job has a start time $s_i$ and end time $f_i$.
Definition: Two jobs $i,j$ are compatible $\mathrm{iff}$ $f_i \leq s_j$ or $f_j \leq s_i$.
Given a set of jobs, maximize number of accepted jobs.
1
|-----------------|
2 3
|-------||--------|
4 5 6
|----||----||-----|
Obviously, choosing jobs 4, 5, 6 would maximize.
Claim: We can solve this problem using a greedy algorithm.
Which rule to use to pick a job?