Uniform Cost Search
UCS expands the cheapest path-so-far first (priority queue on g). Optimal if costs ≥ 0. Like Dijkstra. No heuristic. If all costs are 1, UCS behaves like BFS.
Uniform Cost Search — output — three exam lines. Graph on paper first.
start
├── BFS queue
├── DFS stack
└── A* g+h
│
▼
goalExam tip
UCS vs BFS when costs differ.