Overview

Greedy algorithms solve optimization problems by making a sequence of locally optimal choices, each of which looks best at the moment, with the hope of arriving at a globally optimal solution. Unlike dynamic programming, which considers all subproblem solutions before choosing, a greedy algorithm commits to a choice first and then solves the resulting subproblem. The chapter develops the greedy method through the activity-selection problem and Huffman coding, formalizes when greedy works via the greedy-choice property and optimal substructure, and presents a rigorous matroid-theoretic framework that unifies many greedy algorithms.

Key Concepts

Algorithms and Techniques

1. Activity-Selection Problem

2. Huffman Codes