Q5 — SEARCH FOR OPTIMAL SOLUTION

Arbitrary edge costs retire BFS, and an unknown-quality heuristic retires everything that trusts h — only Dijkstra and Branch-and-Bound remain.

The Question

#QuestionOfficial answer
5Given a finite state space with edge costs that may or may not be Euclidean and a heuristic function whose properties are not known, which of the following algorithms are suitable for finding the optimal path?C, D

The Topic in 60 Seconds

A guarantee can only rest on what the question gives you. Here you are given: finite space, arbitrary (possibly non-uniform) costs — and explicitly not given anything about hh. So every algorithm whose correctness proof says "…assuming admissible hh" is disqualified.

Deep-dive: browse the Concepts section for optimal search.

Solutions

5 — Finite space, costs of unknown shape, heuristic of unknown quality. Which find the optimal path?

OptionVerdict
A — Depth First SearchNo: ignores costs completely; returns a goal, rarely the cheapest
B — Breadth First SearchNo: minimises the NUMBER of edges; with non-uniform costs one long edge can beat three short ones
C — Dijkstra's algorithmYes: expands in increasing true cost gg; never consults hh; correct for any non-negative costs
D — Branch and BoundYes: ranks partial paths by accumulated gg and prunes against the best complete tour; no heuristic involved
E — A*No: optimal only when hh is admissible — "properties not known" removes the guarantee
F — WA* for some wNo: any w>1w > 1 is inadmissible by design; even w=1w=1 is just A* needing admissibility
G — SMGSNo: its pruning rule is safe only under admissible hh, which we are not given

Answer: C, D

The pattern

The two survivors share one property: they ignore hh entirely. Their correctness needs nothing beyond finite space + non-negative costs — both supplied.

AlgorithmDepends on h?Survives unknown h?
DFS / BFSno — but fails on costs insteadout for a different reason
Dijkstra / BnBnoin
A* / SMGSyes (admissibility)out
WA*yes (w·admissibility)out

Compare the sibling questions: add "unit costs" and BFS joins the club; swap to "best admissible h" and A*/SMGS join. Guarantees attach to assumptions, not algorithms.

Tricks & Tips

Answers: 5 C, D