Tweaking AStar to find closest location to unreachable destination
- by Shivan Dragon
I've implemented AStar in Java and it works ok for an area with obstacles where the chosen destination is reachable.
However, when the destination is unreachable, the calculated "path" is in no way to the closest location (to the unreachable location) but is instead some random path.
Is there a feasible way to tweak AStar into finding the path to the closest location to an unreachable destination?