Graph Theory37 sections · 1633 units
Open in Course

Think About It

(Pause before pattern reveal)

Before reading on, answer these:

1.1. Is the graph weighted or unweighted?

2.2. Do you need any path or the shortest path?

3.3. Which technique from your framework fits? Try to reason through it. Next unit reveals the pattern.

If you said BFS, you are on the right track. Connections have no weights, so every edge costs 11. BFS explores nodes layer by layer, guaranteeing that the first time you reach a node, you have found the shortest path to it. DFS would find a path, but not the shortest one.