Price your future right. 60% off with code BLACKSCHOLES at USD checkout. Offer ends in 1d 16h 01m 43s1 days 16 hours 1 minutes 43 seconds.
Price your future right. 60% off with code BLACKSCHOLES at USD checkout. Offer ends in 1d 16h 01m 43s1 days 16 hours 1 minutes 43 seconds.

Sign in to watch this lesson
Advanced - Greedy and Scheduling · 4:18
One machine, a queue of jobs, and a penalty for every moment a job waits. An adjacent swap changes the total by c_i·t_j − c_j·t_i, so the optimal order sorts by c/t (Smith's ratio rule), compared exactly as integer products. The same argument covers exponential and identical penalties, and a theorem of Livshits and Kladov says those three families are the only ones a sort can solve.