Skip to main content
Module 6 · Dijkstra's Algorithm (optional)

Lesson 6-5 · Three Planners, One Harness — Knowledge Checks

Name Date
  1. Where does the slow-edge list live in the class version, and why?

    1. A.In a global SLOW_EDGES, as in Lesson 6-2
    2. B.Inside the Dijkstra object as self.slow_edges, like self.blocked — it is the planner's own knowledge of the grid, reached only through add_slow_edge()
    3. C.Inside the harness
    4. D.In the Navigator

    Answer Why?

  2. Why must BFS have an add_slow_edge() method that does nothing?

    1. A.Python requires every class to have the same methods
    2. B.So the harness can call planner.add_slow_edge() on whichever planner it holds without checking which one — the same reason Manhattan has an add_blocked() that does nothing
    3. C.Because BFS secretly uses weights
    4. D.It does not; the harness skips BFS

    Answer Why?