Greedy Algorithms8 sections · 316 units
Open in Course

Minimum Waiting - The Greedy Claim

Shortest first

Greedy strategy: Serve people in order of increasing service time. Shortest first.

Intuition: A person with short service time adds little to everyone behind them. Putting them first minimizes the cumulative delay.

Claim: Sorting by service time (ascending) minimizes total waiting time. I will prove this using exchange argument. If you swap a long and short person where the long person comes first, you reduce total waiting. The person who takes less time should go earlier to minimize the delay for others.