Skip to content

Commit d26b50e

Browse files
Explicitly deal with NO_BIN case.
1 parent 6547ac5 commit d26b50e

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

algo/src/main/java/org/neo4j/gds/steiner/SteinerBasedDeltaStepping.java

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -183,9 +183,12 @@ private boolean ensureShortest(
183183
long currentBin,
184184
List<SteinerBasedDeltaTask> tasks
185185
) {
186+
if (currentBin == NO_BIN) { //there is no more nodes to relax, path to target node is certainly shortest
187+
return true;
188+
}
186189
if (oldBin == currentBin) {
187190
//if closest terminal is in another bucket, can't be sure it's the best path
188-
if (distance >= (currentBin+1) * delta) {
191+
if (distance >= (currentBin + 1) * delta) {
189192
return false;
190193
}
191194
//find closest node to be processed afterwards

0 commit comments

Comments
 (0)