Today in class, my professor introduced us to admissable heuristics, and stated that they guarantee optimality for the A* algorithm.
I asked him to explain it using an extreme example to make it obvious, but he couldn't.
Can someone please help?
Also, A* is only optimal if two conditions are met: The heuristic is admissible, as it will never overestimate the cost. The heuristic is monotonic, that is, if h(ni) < h(ni + 1), then real-cost(ni) < real-cost(ni + 1).
A problem with A* is that it fails to guarantee optimal solutions when its heuristic, h, overestimates. Since optimal solutions are often desired and an underestimating h is not always available, we seek to remedy this. From a non- admissible h an admissible one is generated using h's statistical properties.
With a consistent heuristic, A* is guaranteed to find an optimal path without processing any node more than once and A* is equivalent to running Dijkstra's algorithm with the reduced cost d'(x, y) = d(x, y) + h(y) − h(x).
It has combined features of UCS and greedy best-first search, by which it solve the problem efficiently. It finds the shortest path through the search space using the heuristic function. This search algorithm expands fewer search tree and gives optimal results faster.
We have a list of candidates, right?
And each of them has an ETC (expected total cost) to reach the goal from the starting node (i.e. the cost to reach that node + the expected remaining cost to the goal (the heuristic)).
Now if the expected cost is identical to the actual cost, we'll literally just pick the nodes on the shortest path (well, any of the shortest paths), and nothing else. Since we pick the lowest ETC, it should be pretty obvious why we only pick nodes from the shortest path - anything not on the shortest path will have a higher ETC.
What if the ETC is less than the actual cost? We always pick the lowest ETC, so we may end up picking nodes not on the shortest path. But we can never reach the goal through a path that's not a shortest path because:
As an example, let's say we have costs as follows: (the cost above / below a node is the expected remaining cost, the cost at an edge is the actual cost)
0 10 0 100 0
START ---- O ------ GOAL
0 | | 100
O ------ O ------ O
100 1 100 1 100
So clearly we'd start off visiting the top middle node, since the ETC is 10 (10+0).
Then the goal would be a candidate, with an ETC of 110 (10+100+0).
Then we'd clearly pick the bottom nodes one after the other, followed by the updated goal, since they all have ETC's lower than the ETC of the current goal, i.e. their ETC's are: 100, 101, 102, 102.
So even though the goal was a candidate, we couldn't pick it because there was still a better path out there.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With