Skip to content
Preptima
mediumCodingConceptMidSeniorStaff

How do you know a greedy choice is safe and not merely plausible?

4 min readUpdated 2026-08-15

Answer

Short answer

A greedy choice is safe when you can show at least one optimal solution contains it, usually via an exchange argument that swaps an optimum's first choice for yours without losing anything.

Mention exchange argument where it changes the risk, the owner, or the next check.

Was this answer helpful?

Likely follow-ups

  • Fractional knapsack is greedy-solvable but 0/1 is not. What exactly does the fraction restore?
  • How would you decide whether a given set of coin denominations is canonical?
  • Interval scheduling for maximum count sorts by finish time; weighted interval scheduling does not. Why?
  • Both matroids and greedy come up in this discussion. What does the matroid framing buy you?

Related questions

Further reading

Related Topics