Greedy Choice

Definition

A greedy choice takes the currently preferred feasible option according to a local rule, then handles what remains. A global guarantee requires showing that the local choice can always be included in an optimal solution.

Core rule: Fix the objective and constraints, then write the local ordering rule. Try substituting your first choice into a good overall plan and check whether the rest stays feasible without lowering the result.

In 1952, David Huffman published a paper about sending messages. Some messages come up again and again, while others barely show up. He wanted to send them using fewer digits on average, and he began with the two rarest.

The common messages are taking up most of the line. Why would you start by doing something about the two that hardly ever come through?

Huffman made a Greedy Choice, using a local rule to pick one feasible option and then dealing with what remained. Let's follow him through that choice and see when you can commit to a step like that.

How it works

Start with what Huffman needs to deliver. Every kind of message gets a string of digits. A string for a common message gets sent more often, so its length counts more. The aim is to make the average as short as possible.

The receiver also needs to know where one message stops. A complete code can't be the beginning of another code. Otherwise, when a few digits arrive, the receiver has to wait to learn whether the message is over.

  1. 01 · Set the objective State whether the outcome is count, value or another measure.
  2. 02 · Choose a local rule Pick an action that can be chosen by the same criterion at each step.
  3. +1 more mechanism steps & animation in the app

When it fails & limits

Huffman could commit at each step because the pieces of his problem could be swapped that way. Change the goal or have two choices compete for the same resource, and you have to look farther ahead.

✦ Unlock full lesson in ConceptFlow

Unlock the full Greedy Choice lesson in ConceptFlow

You’ve read the core idea and opening case. Get the ConceptFlow app to continue through the full breakdown, failure modes, 5-minute audio lesson, and decision practice.

  • ▸5-minute English & Mandarin audio lesson
  • ▸5 more deep-dive case & mechanism insights
  • ▸All 5 failure boundaries & counter-examples
  • ▸4-point decision checklist + 6-step practice

Tap a store button on mobile, or scan with your phone camera on desktop.