Practice Discrete Math

Algorithms / Greedy Exchange Arguments

Least You Need to Know: Greedy Proofs via Exchange Arguments

An exchange argument proves a greedy algorithm by showing that some optimal solution can be modified step by step to agree with the greedy choice without getting worse. The core idea is not that the greedy step 'feels good,' but that a formal swap preserves feasibility and objective value or improves it.

The least you need to know

Key notation

exchange replace part of an optimal solution with the greedy choice
feasible still satisfies all problem constraints after the swap
optimal achieves the best objective value

Tiny worked example

  • Suppose a greedy algorithm picks the interval with earliest finishing time.
  • Take any optimal schedule.
  • If its first interval is different, swap in the greedy interval.
  • Because the greedy interval finishes no later, the remaining schedule still fits.
  • So there exists an optimal schedule starting with the greedy choice.

Common mistakes

How to recognize this kind of problem

Start practice