Table of Contents
Fetching ...

From Dynamic Programs to Greedy Algorithms

Dieter van Melkebeek

TL;DR

Conceptually, the approach repeatedly expands the Bellman equations underlying the dynamic program and uses straightforward monotonicity properties to figure out which terms yield the optimal value under the respective restrictions.

Abstract

We show for several computational problems how classical greedy algorithms for special cases can be derived in a simple way from dynamic programs for the general case: interval scheduling (restricted to unit weights), knapsack (restricted to unit values), and shortest paths (restricted to nonnegative edge lengths). Conceptually, we repeatedly expand the Bellman equations underlying the dynamic program and use straightforward monotonicity properties to figure out which terms yield the optimal value under the respective restrictions. The approach offers an alternative for developing these greedy algorithms in undergraduate algorithms courses and/or for arguing their correctness. In the setting of interval scheduling, it elucidates the change in order from earliest start time first for the memoized dynamic program to earliest finish time first for the greedy algorithm.

From Dynamic Programs to Greedy Algorithms

TL;DR

Conceptually, the approach repeatedly expands the Bellman equations underlying the dynamic program and uses straightforward monotonicity properties to figure out which terms yield the optimal value under the respective restrictions.

Abstract

We show for several computational problems how classical greedy algorithms for special cases can be derived in a simple way from dynamic programs for the general case: interval scheduling (restricted to unit weights), knapsack (restricted to unit values), and shortest paths (restricted to nonnegative edge lengths). Conceptually, we repeatedly expand the Bellman equations underlying the dynamic program and use straightforward monotonicity properties to figure out which terms yield the optimal value under the respective restrictions. The approach offers an alternative for developing these greedy algorithms in undergraduate algorithms courses and/or for arguing their correctness. In the setting of interval scheduling, it elucidates the change in order from earliest start time first for the memoized dynamic program to earliest finish time first for the greedy algorithm.

Paper Structure

This paper contains 18 sections, 17 equations, 2 figures, 4 algorithms.

Figures (2)

  • Figure 1: Ordering for Interval Scheduling instance yielding $2^{\Omega(n)}$ distinct subinstances.
  • Figure 2: Interval Scheduling instance where earliest start time first yields $\Theta(n^2)$ distinct subinstances.

Theorems & Definitions (1)

  • Definition 5: distance