Consider you use A* algorithm in which heuristic can overestimate the remaining distance by a few meters. Can it happen that the final path is several kilometres longer than the really shortest path? Can you give an example of graph in which this happens, what kind of graph is it? A scenario in which Euclidean (straight line) distance can overestimate the remaining distance is:
- The graph vertices are situated in (x, y) coordinates on a plane, where x and y are floating-point
- There are arcs of some floating-point lengths between some vertices of the graph. The length of an arc is no smaller than the Euclidean distance between its vertices (but can be greater for bended/non-straight arcs)
- However, while running A* algorithm you use integer arithmetic with rounding down, while A* estimate is rounded up (this is unreasonable, but just an example of how small the differences are): so you round the length of each arc down to integer number of meters, and you round A* estimate up to integer number of meters
Is there a formula which says the upper bound on suboptimality of the final path given the upper bound on how much A* heuristic overestimates the remaining distance?