Dynamic Programming Visualiser

A dynamic programming visualizer: watch the table fill cell by cell with arrows to its sources, then trace back the answer, from Fibonacci to matrix chain.

A frontend app built by Ananda Rizki. More of them at Labs.

Labs — by Ananda Rizki

Dynamic Programming Visualiser

Simulator

Thirteen runs over eight problems, ordered as a curriculum rather than by difficulty: Fibonacci first, as four runs on one problem — naive recursion tree, memoised, bottom-up table, two variables — because the argument for the whole technique is watching the same tree get pruned. Then grid paths, coin change, knapsack, longest common subsequence, edit distance, longest increasing subsequence and matrix chain. Three things a printed table cannot do carry the app: arrows drawn from the cells each new cell was read from, a traceback phase that walks backwards and reconstructs the actual answer rather than just its number, and a deliberate wrong run — the knapsack rolling array iterated upwards — where per-cell item stamps make the double-count visible instead of merely described. Every traceback was checked against an independently computed answer: the edit script is replayed and has to turn one word into the other, and the matrix-chain bracketing is re-priced by multiplying it out.

Built with
  • react
  • tailwind
Related

Built by Ananda Rizki, a software engineer and designer, one of the small web apps he writes for fun.

Explore more apps on Labs