Skip to main content

Path Cost

This video presents the same text shown beside it, spoken and on screen. It adds nothing the text does not say.

State

The cost of a path is the sum of its actions' costs, and the best solution is the cheapest — not necessarily the fewest steps.

Show

With road lengths added, Riverbend's three-road routes cost 12, 10, and 8 kilometers — same step count, different totals.

Watch for

Breadth-first happily returns the 12: its guarantee was about the wrong quantity. Ask what an optimizer optimizes.