Dynamic Programming Visualizer illustration

Dynamic Programming Visualizer

Dynamic programming is just this: solve tiny subproblems first, store the answers in a table, and build bigger answers from smaller ones. This visualizer fills the tables live for two classic problems — edit distance between two words you type, and the 0/1 knapsack — highlighting for every cell which neighbours it reads and which choice wins. When the table is full, the optimal solution is traced backwards through it, glowing, so you see both the answer and the reasoning.

Runs 100% in your browser — simulations are computed locally on your device.

Notes

  • Each edit-distance cell reads three neighbours: match or substitute (diagonal), delete (left), insert (above).
  • The traceback path through the table is the optimal alignment or item choice — stored decisions, replayed.
  • DP beats brute force by never solving the same subproblem twice: n² cells instead of 3ⁿ paths.
  • Runs 100% in your browser — simulations are computed locally on your device.