Lesson 6-2 · Weights in the Graph — Knowledge ChecksAnswer key
SLOW_EDGES holds ((0, 1), (0, 2), 5). What do weight((0, 2), (0, 1)) and weight((1, 1), (1, 2)) return?
The or in the if makes the match direction-free; the final return 1 is the default for every ordinary segment.
Why does path_cost() need the position parameter, when the path is right there?
Every planner in the course returns the intersections to drive TO. The segment from where the robot is to the first of those is part of the trip, and its weight counts.
BFS passes every Module 5 property on the slow grid and fails only the cost check. What does that tell you?
A property test tells you precisely which promise failed. The path is valid, connected, unblocked and shortest in steps. It is not cheapest — and nothing in BFS ever looks at a weight.