Skip to main content
SWStudyWalks Search

Artificial Intelligence / Unit 2   AI 0086 worked example, 60 to 90 seconds

Depth-First, Run Whole

Captions available

The idea

A complete depth-first run shows the diving strategy at its best — and exposes what the speed depends on.

In practice

Riverbend again, start Home, goal Grandmother's — extensions filed in reverse alphabetical order, so the last filed sits on top. Turn one: select Home; file Home–School, then Home–Bakery on top. Turn two: select Home–Bakery; file Home–Bakery–Park. Turn three: select Home–Bakery–Park; its extensions file with Grandmother's on top. Turn four: select Home–Bakery–Park–Grandmother's. Goal — three roads, four turns, against breadth-first's seven, and the frontier never held more than three paths. Now re-run with alphabetical filing: the dive goes down the School line instead, and on a slightly meaner map the same strategy happily returns a five-road tour while the three-road route sits unexplored.

Where people slip

Both runs are the same algorithm; the brilliance and the blunder differ only in filing order.

Your place on the trail

Every lesson rests on earlier ones and opens later ones. Tap any to jump.

Something wrong in this lesson? Flag it  ·  Sources for Artificial Intelligence