Strongly Connected Components
In short: a strongly connected component, or district, is a largest group of junctions where every one can reach every other along one-way streets. Collapse each district to a blob and keep only the streets between them, and you get a condensation with no loop — a dependency graph of districts. Kosaraju's finds every district in two DFS passes: record each junction's finish order, flip every street, then peel districts off in reverse finish order, each search landing in exactly one district because it starts in what is now a sink.

The old town on Meridian's east side is a maze of one-way streets. A driver who starts at the dock can loop round the fair and the gate and come back to the dock. Take the street from the gate up to the hill, though, and you can circle between the hill and the inn all day without ever finding a way back down to the dock.
Dispatch wants to group junctions into districts: groups where every junction can drive to every other and back. A van assigned to a district can then serve all of it without getting stranded outside. In graph terms, a district is a strongly connected component, or SCC. It's a largest set of nodes in which every node can reach every other along directed edges.
Reachability runs one way
In the graphs section, "connected" was symmetric: if Ana could reach Bo, Bo could reach Ana. One-way streets break that.
ahead = {"lane": ["dock"], "dock": ["fair"], "fair": ["dock"]}
def reach(start):
seen, todo = {start}, [start]
while todo:
j = todo.pop()
for nxt in ahead[j]:
if nxt not in seen:
seen.add(nxt)
todo.append(nxt)
return seen
print("dock" in reach("lane"), "lane" in reach("dock"))So "same district" means "reachable both ways". Testing that for every pair of junctions takes one search per junction, O(V × (V + E)), and it gets slow fast. Two classic algorithms find every district in linear time: Kosaraju's, which is easier to understand, and Tarjan's, which does it in a single pass.