Skip to content

Commit 0196377

Browse files
committed
..
1 parent 22d02b7 commit 0196377

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

src/main/java/com/github/coderodde/graph/pathfinding/delayed/impl/ThreadPoolBidirectionalBFSPathFinder.java

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -841,7 +841,10 @@ private void tryUpdateIfImprovementPossible(
841841
if (distance.get(node) > updatedDistance) {
842842
distance.put(node, updatedDistance);
843843
parents.put(node, predecessor);
844-
heap.updatePriority(node, updatedDistance);
844+
845+
if (heap.containsDatum(node)) {
846+
heap.updatePriority(node, updatedDistance);
847+
}
845848
}
846849
}
847850

0 commit comments

Comments
 (0)