Lesson 6-1 · When Fewest Steps Isn't Fastest — Knowledge ChecksAnswer key
Why does compute_bfs_path() choose the slow road without hesitation?
BFS finds the path with the fewest edges. Nothing in the graph or the planner knows one edge takes longer to drive than another. That information does not exist yet — this module adds it.
A normal block takes 4 seconds and the slow segment takes 16. What is its weight?
weight = slow time / normal time = 16 / 4 = 4. A weight is measured in blocks, not seconds, so the same number works whatever speed the robot drives at.
With the slow segment at weight 5, which route does BFS choose from (0,0) to (0,3), and what does it cost?
BFS compares 3 steps against 5 steps and takes 3. It never sees the 7, because cost is not something it computes. The robot pays the extra time on the floor.
The slow segment measures weight 3. From (0,0) to (0,3), what happens?
Going round one segment costs three normal blocks on an open grid, so weight 3 exactly breaks even. The module needs the slow segment to be worse than that.