Skip to content

Commit 8852e89

Browse files
BFS/DBS should not create paths on genereated graphs
1 parent 1106cd4 commit 8852e89

File tree

3 files changed

+3
-13
lines changed

3 files changed

+3
-13
lines changed

proc/path-finding/src/test/java/org/neo4j/gds/paths/traverse/TraverseStreamComputationResultConsumerTest.java

Lines changed: 1 addition & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,6 @@
1919
*/
2020
package org.neo4j.gds.paths.traverse;
2121

22-
import org.jetbrains.annotations.Nullable;
2322
import org.junit.jupiter.api.Test;
2423
import org.neo4j.gds.collections.ha.HugeLongArray;
2524
import org.neo4j.gds.procedures.algorithms.pathfinding.PathFactoryFacade;
@@ -87,15 +86,6 @@ void shouldComputePath() {
8786
});
8887
}
8988

90-
private static class TestResult {
91-
public final Long sourceNode;
92-
public final List<Long> nodeIds;
93-
public final Path path;
89+
private static record TestResult(long sourceNode,List<Long> nodeIds, Path path){}
9490

95-
TestResult(long sourceNode, @Nullable List<Long> nodes, @Nullable Path path) {
96-
this.sourceNode = sourceNode;
97-
this.nodeIds = nodes;
98-
this.path = path;
99-
}
100-
}
10191
}

procedures/algorithms-facade/src/main/java/org/neo4j/gds/procedures/algorithms/pathfinding/BfsStreamResultBuilder.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ public Stream<BfsStreamResult> build(
5555
result.get(),
5656
graph::toOriginalNodeId,
5757
BfsStreamResult::new,
58-
pathRequested,
58+
pathRequested && graphStore.capabilities().canWriteToLocalDatabase(),
5959
new PathFactoryFacade(),
6060
RelationshipType.withName("NEXT"),
6161
nodeLookup

procedures/algorithms-facade/src/main/java/org/neo4j/gds/procedures/algorithms/pathfinding/DfsStreamResultBuilder.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ public Stream<DfsStreamResult> build(
5555
result.get(),
5656
graph::toOriginalNodeId,
5757
DfsStreamResult::new,
58-
pathRequested,
58+
pathRequested && graphStore.capabilities().canWriteToLocalDatabase(),
5959
new PathFactoryFacade(),
6060
RelationshipType.withName("NEXT"),
6161
nodeLookup

0 commit comments

Comments
 (0)