Skip to main content
Module 5 · Dijkstra's Algorithm

Lesson 1 · The Grid as a Graph — Knowledge ChecksAnswer key

Correct answers are marked and the explanation follows each question.

  1. Why can't the Manhattan algorithm route around a blocked intersection?

    1. A.It runs too slowly
    2. B.It only knows one fixed strategy (rows then columns) and has no concept of obstacles
    3. C.It can, if you turn it off and on again
    4. D.The robot has no wheels

    Manhattan always follows the same L-shaped route. It never checks whether a cell is blocked, so it can't detour.

  2. On a 3×3 grid, how many neighbors does the interior node (1,1) have?

    1. A.2
    2. B.3
    3. C.4
    4. D.8

    (1,1) connects up, down, left, and right — (0,1), (2,1), (1,0), (1,2). No diagonals, so four neighbors.

  3. After (1,1) is blocked, how many neighbors does (0,1) have?

    1. A.3 — nothing changed
    2. B.2 — it lost its downward connection to (1,1)
    3. C.4
    4. D.0

    (0,1) used to connect to (0,0), (0,2), and (1,1). With (1,1) removed, only two neighbors remain.

  4. 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?

    1. A.The Manhattan distance is wrong
    2. B.With obstacles, the real shortest path can be longer than the Manhattan distance
    3. C.Obstacles always add exactly 2 steps
    4. D.The destination is unreachable

    Manhattan distance is the shortest path with NO obstacles. Blocked nodes can force a longer detour, so it becomes a lower bound.

  5. In computer science, what does the word 'graph' mean?

    1. A.A bar chart or scatter plot
    2. B.A network of nodes connected by edges
    3. C.A grid of pixels
    4. D.A line showing data over time

    Same word, different field. In CS a graph is nodes and edges — the structure behind maps, networks, and our grid.