Lesson 1 · The Grid as a Graph — Knowledge ChecksAnswer key
Why can't the Manhattan algorithm route around a blocked intersection?
Manhattan always follows the same L-shaped route. It never checks whether a cell is blocked, so it can't detour.
On a 3×3 grid, how many neighbors does the interior node (1,1) have?
(1,1) connects up, down, left, and right — (0,1), (2,1), (1,0), (1,2). No diagonals, so four neighbors.
After (1,1) is blocked, how many neighbors does (0,1) have?
(0,1) used to connect to (0,0), (0,2), and (1,1). With (1,1) removed, only two neighbors remain.
With (1,0) blocked, the shortest path from (0,0) to (2,0) is 4 steps, but the Manhattan distance is 2. What does that tell you?
Manhattan distance is the shortest path with NO obstacles. Blocked nodes can force a longer detour, so it becomes a lower bound.
In computer science, what does the word 'graph' mean?
Same word, different field. In CS a graph is nodes and edges — the structure behind maps, networks, and our grid.