Skip to content

Commit 7fee208

Browse files
committed
Resolved merge conflict.
2 parents 8fcf8b8 + 0196377 commit 7fee208

File tree

2 files changed

+5
-4
lines changed

2 files changed

+5
-4
lines changed

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

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -843,9 +843,7 @@ private void tryUpdateIfImprovementPossible(
843843
parents.put(node, predecessor);
844844

845845
if (heap.containsDatum(node)) {
846-
heap.updatePriority(node, updatedDistance);
847-
} else {
848-
heap.insert(node, updatedDistance);
846+
heap.updatePriority(node, updatedDistance);
849847
}
850848
}
851849
}
@@ -1117,7 +1115,10 @@ private void processCurrentInMasterThread() {
11171115

11181116
for (int trials = 0; trials < threadSleepTrials; trials++) {
11191117
mysleep(threadSleepDurationNanos);
1118+
1119+
lock();
11201120
currentHead = searchState.heap.minimumNode();
1121+
unlock();
11211122

11221123
if (currentHead != null) {
11231124
break;

src/test/java/com/github/coderodde/graph/pathfinding/delayed/impl/ThreadPoolBidirectionalBFSPathFinderTest.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
public final class ThreadPoolBidirectionalBFSPathFinderTest {
1818

1919
private static final long SEED = 13L;
20-
private static final int NODES = 50_000;
20+
private static final int NODES = 100_000;
2121
private static final int DISCONNECTED_GRAPH_NODES = 1000;
2222
private static final int MINIMUM_DISCONNECTED_GRAPH_DEGREE = 2;
2323
private static final int MAXIMUM_DISCONNECTED_GRAPH_DEGREE = 5;

0 commit comments

Comments
 (0)