Visualizes when dynamic programming applies by contrasting naive recursion (repeated calls to the same state n) with memoization (storing and reusing dp[state]). A Fibonacci-style subproblem graph shows optimal substructure via edges (n depends on n-1 and n-2), while the animated cursor highlights overlapping subproblems and the dp table turning repeated work into cache HITs.
Uses a fixed DAG layout for states n=0..6 and an animated traversal sequence to demonstrate repeated calls. The cycle splits into two modes (naive recursion vs memoization); in memoization mode, rows become 'computed' and later visits display HIT. All geometry is grid-snapped for a blocky aesthetic and scales with Math.min(w,h)/BASE.