Source: https://www.iro.umontreal.ca/~monnier/2245/notes-scheduling.pdf