algorithm - Why do admissable heuristics guarantee optimality? -
today in class, professor introduced admissable heuristics, , stated guarantee optimality a* algorithm.
i asked him explain using extreme example make obvious, couldn't.
can please help?
we have list of candidates, right?
and each of them has etc (expected total cost) reach goal starting node (i.e. cost reach node + expected remaining cost goal (the heuristic)).
now if expected cost identical actual cost, we'll literally pick nodes on shortest path (well, of shortest paths), , nothing else. since pick lowest etc, should pretty obvious why pick nodes shortest path - not on shortest path have higher etc.
what if etc less actual cost? pick lowest etc, may end picking nodes not on shortest path. can never reach goal through path that's not shortest path because:
- the shortest path has lower actual cost non-shortest path
- the etc @ goal same cost reach goal via path (since we're @ goal, expected remaining cost 0)
- the etc less or equal actual total cost on path
- thus etc on shortest path strictly less etc @ goal reached via non-shortest path.
as example, let's have costs follows: (the cost above / below node expected remaining cost, cost @ edge actual cost)
0 10 0 100 0 start ---- o ------ goal 0 | | 100 o ------ o ------ o 100 1 100 1 100
so we'd start off visiting top middle node, since etc 10 (10+0).
then goal candidate, etc of 110 (10+100+0).
then we'd pick bottom nodes 1 after other, followed updated goal, since have etc's lower etc of current goal, i.e. etc's are: 100, 101, 102, 102.
so though goal candidate, couldn't pick because there still better path out there.
Comments
Post a Comment