With multiple branches it was possible the search could run for a long time, especially when there was no possible path to the target. Now use a heap to keep track of the best path and finish immediately once its reached.
With multiple branches it was possible the search could run for a long time, especially when there was no possible path to the target. Now use a heap to keep track of the best path and finish immediately once its reached.