Module M30 · 30 of 35 in teaching order · Advanced

Greedy

When a locally best choice is globally best, how to prove it, and counterexamples when it is not.

Lessons

  1. Earliest end first, proved optimal by an exchange argument; merging overlapping intervals; and the counterexamples that show when a greedy rule fails.

Topics this module covers

The full module scope. Topics without a lesson above are not written yet.

  • local/global
  • greedy choice
  • optimal substructure
  • exchange argument
  • activity selection
  • intervals
  • fractional knapsack
  • Huffman
  • counterexamples

Builds toward