Workspace Grid Dp
0d
Problem-solving patterns

Grid Dynamic Programming

Build a table by combining valid predecessor cells.

Recognition signal

A grid path moves in directions that form an acyclic dependency order.

Method

Initialize the origin and edges, then fill rows or columns in dependency order.

Worked example

In a 2 × 3 open grid, the bottom-right count is 1 from above plus 2 from the left.

Common mistake

An unavailable predecessor should contribute the neutral or impossible value for the objective.