From 47f3afe64aeb4b870ac7446b1e6b6318586e5d5b Mon Sep 17 00:00:00 2001 From: Lasse Westh-Nielsen Date: Tue, 2 Jan 2024 12:58:34 +0100 Subject: [PATCH] cleaning up procedure descriptions --- .../gds/paths/bellmanford/BellmanFord.java | 3 --- .../neo4j/gds/paths/delta/DeltaStepping.java | 3 --- .../neo4j/gds/paths/dijkstra/Dijkstra.java | 2 -- .../SingleSourceShortestPathConstants.java} | 12 ++++++--- .../bellmanford/BellmanFordMutateProc.java | 5 ++-- .../bellmanford/BellmanFordMutateSpec.java | 5 ++-- .../bellmanford/BellmanFordStatsProc.java | 5 ++-- .../bellmanford/BellmanFordStatsSpec.java | 4 ++- .../bellmanford/BellmanFordStreamProc.java | 5 ++-- .../bellmanford/BellmanFordStreamSpec.java | 4 ++- .../bellmanford/BellmanFordWriteProc.java | 5 ++-- .../bellmanford/BellmanFordWriteSpec.java | 4 ++- .../AllShortestPathsDeltaMutateProc.java | 4 ++- .../AllShortestPathsDeltaMutateSpec.java | 4 ++- .../delta/AllShortestPathsDeltaStatsProc.java | 5 ++-- .../delta/AllShortestPathsDeltaStatsSpec.java | 4 ++- .../AllShortestPathsDeltaStreamProc.java | 4 ++- .../AllShortestPathsDeltaStreamSpec.java | 4 ++- .../delta/AllShortestPathsDeltaWriteProc.java | 4 ++- .../delta/AllShortestPathsDeltaWriteSpec.java | 4 ++- .../AllShortestPathsDijkstraMutateProc.java | 4 ++- .../AllShortestPathsDijkstraMutateSpec.java | 4 ++- .../AllShortestPathsDijkstraStreamProc.java | 3 ++- .../AllShortestPathsDijkstraStreamSpec.java | 4 ++- .../AllShortestPathsDijkstraWriteProc.java | 4 ++- .../AllShortestPathsDijkstraWriteSpec.java | 4 ++- .../ShortestPathAStarMutateProc.java | 2 +- .../ShortestPathAStarMutateSpec.java | 2 +- .../ShortestPathAStarStreamProc.java | 2 +- .../ShortestPathAStarStreamSpec.java | 2 +- .../ShortestPathAStarWriteProc.java | 2 +- .../ShortestPathAStarWriteSpec.java | 2 +- .../ShortestPathDijkstraMutateProc.java | 2 +- .../ShortestPathDijkstraMutateSpec.java | 2 +- .../ShortestPathDijkstraStreamProc.java | 2 +- .../ShortestPathDijkstraStreamSpec.java | 2 +- .../ShortestPathDijkstraWriteProc.java | 2 +- .../ShortestPathDijkstraWriteSpec.java | 2 +- .../ShortestPathYensMutateProc.java | 4 +-- .../ShortestPathYensMutateSpec.java | 4 +-- .../ShortestPathYensStreamProc.java | 4 +-- .../ShortestPathYensStreamSpec.java | 3 ++- .../ShortestPathYensWriteProc.java | 4 +-- .../ShortestPathYensWriteSpec.java | 4 +-- ...a => SinglePairShortestPathConstants.java} | 8 +++--- .../gds/paths/sourcetarget/YensConstants.java | 26 ------------------- 46 files changed, 102 insertions(+), 92 deletions(-) rename proc/path-finding/src/main/java/org/neo4j/gds/paths/{sourcetarget/ShortestPathDijkstraProc.java => singlesource/SingleSourceShortestPathConstants.java} (52%) rename proc/path-finding/src/main/java/org/neo4j/gds/paths/sourcetarget/{ShortestPathAStarCompanion.java => SinglePairShortestPathConstants.java} (75%) delete mode 100644 proc/path-finding/src/main/java/org/neo4j/gds/paths/sourcetarget/YensConstants.java diff --git a/algo/src/main/java/org/neo4j/gds/paths/bellmanford/BellmanFord.java b/algo/src/main/java/org/neo4j/gds/paths/bellmanford/BellmanFord.java index e7c28b12ab0..95ffcce2ace 100644 --- a/algo/src/main/java/org/neo4j/gds/paths/bellmanford/BellmanFord.java +++ b/algo/src/main/java/org/neo4j/gds/paths/bellmanford/BellmanFord.java @@ -45,9 +45,6 @@ import static org.neo4j.gds.paths.delta.TentativeDistances.NO_PREDECESSOR; public class BellmanFord extends Algorithm { - public static final String DESCRIPTION = - "The Bellman-Ford shortest path algorithm computes the shortest (weighted) path between one node and any other node in the graph without negative cycles."; - private final long sourceNode; private final Graph graph; private final boolean trackNegativeCycles; diff --git a/algo/src/main/java/org/neo4j/gds/paths/delta/DeltaStepping.java b/algo/src/main/java/org/neo4j/gds/paths/delta/DeltaStepping.java index 6c079b597f9..b63bb2fc0ef 100644 --- a/algo/src/main/java/org/neo4j/gds/paths/delta/DeltaStepping.java +++ b/algo/src/main/java/org/neo4j/gds/paths/delta/DeltaStepping.java @@ -49,9 +49,6 @@ import static org.neo4j.gds.paths.delta.TentativeDistances.NO_PREDECESSOR; public final class DeltaStepping extends Algorithm { - public static final String DESCRIPTION = "The Delta Stepping shortest path algorithm computes the shortest (weighted) path between one node and any other node in the graph. " + - "The computation is run multi-threaded"; - private static final int NO_BIN = Integer.MAX_VALUE; private static final int BIN_SIZE_THRESHOLD = 1000; private static final int BATCH_SIZE = 64; diff --git a/algo/src/main/java/org/neo4j/gds/paths/dijkstra/Dijkstra.java b/algo/src/main/java/org/neo4j/gds/paths/dijkstra/Dijkstra.java index 38f802f2b2b..433be338465 100644 --- a/algo/src/main/java/org/neo4j/gds/paths/dijkstra/Dijkstra.java +++ b/algo/src/main/java/org/neo4j/gds/paths/dijkstra/Dijkstra.java @@ -43,8 +43,6 @@ import static org.neo4j.gds.paths.dijkstra.Dijkstra.TraversalState.EMIT_AND_STOP; public final class Dijkstra extends Algorithm { - public static final String DESCRIPTION_SOURCE_TARGET = "The Dijkstra shortest path algorithm computes the shortest (weighted) path between one node and any other node in the graph."; - private static final long NO_RELATIONSHIP = -1; private final Graph graph; diff --git a/proc/path-finding/src/main/java/org/neo4j/gds/paths/sourcetarget/ShortestPathDijkstraProc.java b/proc/path-finding/src/main/java/org/neo4j/gds/paths/singlesource/SingleSourceShortestPathConstants.java similarity index 52% rename from proc/path-finding/src/main/java/org/neo4j/gds/paths/sourcetarget/ShortestPathDijkstraProc.java rename to proc/path-finding/src/main/java/org/neo4j/gds/paths/singlesource/SingleSourceShortestPathConstants.java index 607e3edf81f..6afcafa0ea9 100644 --- a/proc/path-finding/src/main/java/org/neo4j/gds/paths/sourcetarget/ShortestPathDijkstraProc.java +++ b/proc/path-finding/src/main/java/org/neo4j/gds/paths/singlesource/SingleSourceShortestPathConstants.java @@ -17,10 +17,14 @@ * You should have received a copy of the GNU General Public License * along with this program. If not, see . */ -package org.neo4j.gds.paths.sourcetarget; +package org.neo4j.gds.paths.singlesource; -final class ShortestPathDijkstraProc { - static final String DIJKSTRA_DESCRIPTION = "The Dijkstra shortest path algorithm computes the shortest (weighted) path between a pair of nodes."; +public interface SingleSourceShortestPathConstants { + String BELLMAN_FORD_DESCRIPTION = + "The Bellman-Ford shortest path algorithm computes the shortest (weighted) path between one node and any other node in the graph without negative cycles."; - private ShortestPathDijkstraProc() {} + String DELTA_STEPPING_DESCRIPTION = "The Delta Stepping shortest path algorithm computes the shortest (weighted) path between one node and any other node in the graph. " + + "The computation is run multi-threaded"; + + String DIJKSTRA_DESCRIPTION = "The Dijkstra shortest path algorithm computes the shortest (weighted) path between one node and any other node in the graph."; } diff --git a/proc/path-finding/src/main/java/org/neo4j/gds/paths/singlesource/bellmanford/BellmanFordMutateProc.java b/proc/path-finding/src/main/java/org/neo4j/gds/paths/singlesource/bellmanford/BellmanFordMutateProc.java index c02f7003fb5..502482132f0 100644 --- a/proc/path-finding/src/main/java/org/neo4j/gds/paths/singlesource/bellmanford/BellmanFordMutateProc.java +++ b/proc/path-finding/src/main/java/org/neo4j/gds/paths/singlesource/bellmanford/BellmanFordMutateProc.java @@ -22,7 +22,7 @@ import org.neo4j.gds.BaseProc; import org.neo4j.gds.executor.MemoryEstimationExecutor; import org.neo4j.gds.executor.ProcedureExecutor; -import org.neo4j.gds.paths.bellmanford.BellmanFord; +import org.neo4j.gds.paths.singlesource.SingleSourceShortestPathConstants; import org.neo4j.gds.results.MemoryEstimateResult; import org.neo4j.procedure.Description; import org.neo4j.procedure.Name; @@ -31,12 +31,13 @@ import java.util.Map; import java.util.stream.Stream; +import static org.neo4j.gds.paths.singlesource.SingleSourceShortestPathConstants.BELLMAN_FORD_DESCRIPTION; import static org.neo4j.procedure.Mode.READ; public class BellmanFordMutateProc extends BaseProc { @Procedure(name = "gds.bellmanFord.mutate", mode = READ) - @Description(BellmanFord.DESCRIPTION) + @Description(BELLMAN_FORD_DESCRIPTION) public Stream mutate( @Name(value = "graphName") String graphName, @Name(value = "configuration", defaultValue = "{}") Map configuration diff --git a/proc/path-finding/src/main/java/org/neo4j/gds/paths/singlesource/bellmanford/BellmanFordMutateSpec.java b/proc/path-finding/src/main/java/org/neo4j/gds/paths/singlesource/bellmanford/BellmanFordMutateSpec.java index 07dba450840..a09a27aa5bc 100644 --- a/proc/path-finding/src/main/java/org/neo4j/gds/paths/singlesource/bellmanford/BellmanFordMutateSpec.java +++ b/proc/path-finding/src/main/java/org/neo4j/gds/paths/singlesource/bellmanford/BellmanFordMutateSpec.java @@ -28,13 +28,14 @@ import org.neo4j.gds.paths.bellmanford.BellmanFordAlgorithmFactory; import org.neo4j.gds.paths.bellmanford.BellmanFordMutateConfig; import org.neo4j.gds.paths.bellmanford.BellmanFordResult; -import org.neo4j.gds.paths.delta.DeltaStepping; +import org.neo4j.gds.paths.singlesource.SingleSourceShortestPathConstants; import java.util.stream.Stream; import static org.neo4j.gds.executor.ExecutionMode.MUTATE_RELATIONSHIP; +import static org.neo4j.gds.paths.singlesource.SingleSourceShortestPathConstants.BELLMAN_FORD_DESCRIPTION; -@GdsCallable(name = "gds.bellmanFord.mutate", description = DeltaStepping.DESCRIPTION, executionMode = MUTATE_RELATIONSHIP) +@GdsCallable(name = "gds.bellmanFord.mutate", description = BELLMAN_FORD_DESCRIPTION, executionMode = MUTATE_RELATIONSHIP) public class BellmanFordMutateSpec implements AlgorithmSpec, BellmanFordAlgorithmFactory> { @Override diff --git a/proc/path-finding/src/main/java/org/neo4j/gds/paths/singlesource/bellmanford/BellmanFordStatsProc.java b/proc/path-finding/src/main/java/org/neo4j/gds/paths/singlesource/bellmanford/BellmanFordStatsProc.java index d45cdb2282a..d89f932a30d 100644 --- a/proc/path-finding/src/main/java/org/neo4j/gds/paths/singlesource/bellmanford/BellmanFordStatsProc.java +++ b/proc/path-finding/src/main/java/org/neo4j/gds/paths/singlesource/bellmanford/BellmanFordStatsProc.java @@ -22,7 +22,7 @@ import org.neo4j.gds.BaseProc; import org.neo4j.gds.executor.MemoryEstimationExecutor; import org.neo4j.gds.executor.ProcedureExecutor; -import org.neo4j.gds.paths.bellmanford.BellmanFord; +import org.neo4j.gds.paths.singlesource.SingleSourceShortestPathConstants; import org.neo4j.gds.results.MemoryEstimateResult; import org.neo4j.procedure.Description; import org.neo4j.procedure.Name; @@ -31,13 +31,14 @@ import java.util.Map; import java.util.stream.Stream; +import static org.neo4j.gds.paths.singlesource.SingleSourceShortestPathConstants.BELLMAN_FORD_DESCRIPTION; import static org.neo4j.procedure.Mode.READ; public class BellmanFordStatsProc extends BaseProc { @Procedure(name = "gds.bellmanFord.stats", mode = READ) - @Description(BellmanFord.DESCRIPTION) + @Description(BELLMAN_FORD_DESCRIPTION) public Stream stats( @Name(value = "graphName") String graphName, @Name(value = "configuration", defaultValue = "{}") Map configuration diff --git a/proc/path-finding/src/main/java/org/neo4j/gds/paths/singlesource/bellmanford/BellmanFordStatsSpec.java b/proc/path-finding/src/main/java/org/neo4j/gds/paths/singlesource/bellmanford/BellmanFordStatsSpec.java index 6aaf229efd8..2b1a1cf6ee4 100644 --- a/proc/path-finding/src/main/java/org/neo4j/gds/paths/singlesource/bellmanford/BellmanFordStatsSpec.java +++ b/proc/path-finding/src/main/java/org/neo4j/gds/paths/singlesource/bellmanford/BellmanFordStatsSpec.java @@ -28,12 +28,14 @@ import org.neo4j.gds.paths.bellmanford.BellmanFordAlgorithmFactory; import org.neo4j.gds.paths.bellmanford.BellmanFordResult; import org.neo4j.gds.paths.bellmanford.BellmanFordStatsConfig; +import org.neo4j.gds.paths.singlesource.SingleSourceShortestPathConstants; import java.util.stream.Stream; import static org.neo4j.gds.executor.ExecutionMode.STATS; +import static org.neo4j.gds.paths.singlesource.SingleSourceShortestPathConstants.BELLMAN_FORD_DESCRIPTION; -@GdsCallable(name = "gds.bellmanFord.stats", description = BellmanFord.DESCRIPTION, executionMode = STATS) +@GdsCallable(name = "gds.bellmanFord.stats", description = BELLMAN_FORD_DESCRIPTION, executionMode = STATS) public class BellmanFordStatsSpec implements AlgorithmSpec, BellmanFordAlgorithmFactory> { @Override public String name() { diff --git a/proc/path-finding/src/main/java/org/neo4j/gds/paths/singlesource/bellmanford/BellmanFordStreamProc.java b/proc/path-finding/src/main/java/org/neo4j/gds/paths/singlesource/bellmanford/BellmanFordStreamProc.java index 5ba19b522e4..990d52c3819 100644 --- a/proc/path-finding/src/main/java/org/neo4j/gds/paths/singlesource/bellmanford/BellmanFordStreamProc.java +++ b/proc/path-finding/src/main/java/org/neo4j/gds/paths/singlesource/bellmanford/BellmanFordStreamProc.java @@ -22,7 +22,7 @@ import org.neo4j.gds.BaseProc; import org.neo4j.gds.executor.MemoryEstimationExecutor; import org.neo4j.gds.executor.ProcedureExecutor; -import org.neo4j.gds.paths.bellmanford.BellmanFord; +import org.neo4j.gds.paths.singlesource.SingleSourceShortestPathConstants; import org.neo4j.gds.results.MemoryEstimateResult; import org.neo4j.procedure.Description; import org.neo4j.procedure.Name; @@ -31,12 +31,13 @@ import java.util.Map; import java.util.stream.Stream; +import static org.neo4j.gds.paths.singlesource.SingleSourceShortestPathConstants.BELLMAN_FORD_DESCRIPTION; import static org.neo4j.procedure.Mode.READ; public class BellmanFordStreamProc extends BaseProc { @Procedure(name = "gds.bellmanFord.stream", mode = READ) - @Description(BellmanFord.DESCRIPTION) + @Description(BELLMAN_FORD_DESCRIPTION) public Stream stream( @Name(value = "graphName") String graphName, @Name(value = "configuration", defaultValue = "{}") Map configuration diff --git a/proc/path-finding/src/main/java/org/neo4j/gds/paths/singlesource/bellmanford/BellmanFordStreamSpec.java b/proc/path-finding/src/main/java/org/neo4j/gds/paths/singlesource/bellmanford/BellmanFordStreamSpec.java index 544f1940e16..5bcb871c9b5 100644 --- a/proc/path-finding/src/main/java/org/neo4j/gds/paths/singlesource/bellmanford/BellmanFordStreamSpec.java +++ b/proc/path-finding/src/main/java/org/neo4j/gds/paths/singlesource/bellmanford/BellmanFordStreamSpec.java @@ -29,13 +29,15 @@ import org.neo4j.gds.paths.bellmanford.BellmanFordResult; import org.neo4j.gds.paths.bellmanford.BellmanFordStreamConfig; import org.neo4j.gds.paths.dijkstra.PathFindingResult; +import org.neo4j.gds.paths.singlesource.SingleSourceShortestPathConstants; import java.util.stream.Stream; import static org.neo4j.gds.LoggingUtil.runWithExceptionLogging; import static org.neo4j.gds.executor.ExecutionMode.STREAM; +import static org.neo4j.gds.paths.singlesource.SingleSourceShortestPathConstants.BELLMAN_FORD_DESCRIPTION; -@GdsCallable(name = "gds.bellmanFord.stream", description = BellmanFord.DESCRIPTION, executionMode = STREAM) +@GdsCallable(name = "gds.bellmanFord.stream", description = BELLMAN_FORD_DESCRIPTION, executionMode = STREAM) public class BellmanFordStreamSpec implements AlgorithmSpec, BellmanFordAlgorithmFactory> { diff --git a/proc/path-finding/src/main/java/org/neo4j/gds/paths/singlesource/bellmanford/BellmanFordWriteProc.java b/proc/path-finding/src/main/java/org/neo4j/gds/paths/singlesource/bellmanford/BellmanFordWriteProc.java index 5abe9f7f2b8..e7296cf3e4b 100644 --- a/proc/path-finding/src/main/java/org/neo4j/gds/paths/singlesource/bellmanford/BellmanFordWriteProc.java +++ b/proc/path-finding/src/main/java/org/neo4j/gds/paths/singlesource/bellmanford/BellmanFordWriteProc.java @@ -24,7 +24,7 @@ import org.neo4j.gds.executor.ExecutionContext; import org.neo4j.gds.executor.MemoryEstimationExecutor; import org.neo4j.gds.executor.ProcedureExecutor; -import org.neo4j.gds.paths.bellmanford.BellmanFord; +import org.neo4j.gds.paths.singlesource.SingleSourceShortestPathConstants; import org.neo4j.gds.results.MemoryEstimateResult; import org.neo4j.procedure.Context; import org.neo4j.procedure.Description; @@ -34,6 +34,7 @@ import java.util.Map; import java.util.stream.Stream; +import static org.neo4j.gds.paths.singlesource.SingleSourceShortestPathConstants.BELLMAN_FORD_DESCRIPTION; import static org.neo4j.procedure.Mode.READ; import static org.neo4j.procedure.Mode.WRITE; @@ -42,7 +43,7 @@ public class BellmanFordWriteProc extends BaseProc { public RelationshipStreamExporterBuilder relationshipStreamExporterBuilder; @Procedure(name = "gds.bellmanFord.write", mode = WRITE) - @Description(BellmanFord.DESCRIPTION) + @Description(BELLMAN_FORD_DESCRIPTION) public Stream write( @Name(value = "graphName") String graphName, @Name(value = "configuration", defaultValue = "{}") Map configuration diff --git a/proc/path-finding/src/main/java/org/neo4j/gds/paths/singlesource/bellmanford/BellmanFordWriteSpec.java b/proc/path-finding/src/main/java/org/neo4j/gds/paths/singlesource/bellmanford/BellmanFordWriteSpec.java index 7fdbba26cf8..ec67982220b 100644 --- a/proc/path-finding/src/main/java/org/neo4j/gds/paths/singlesource/bellmanford/BellmanFordWriteSpec.java +++ b/proc/path-finding/src/main/java/org/neo4j/gds/paths/singlesource/bellmanford/BellmanFordWriteSpec.java @@ -28,12 +28,14 @@ import org.neo4j.gds.paths.bellmanford.BellmanFordAlgorithmFactory; import org.neo4j.gds.paths.bellmanford.BellmanFordResult; import org.neo4j.gds.paths.bellmanford.BellmanFordWriteConfig; +import org.neo4j.gds.paths.singlesource.SingleSourceShortestPathConstants; import java.util.stream.Stream; import static org.neo4j.gds.executor.ExecutionMode.WRITE_RELATIONSHIP; +import static org.neo4j.gds.paths.singlesource.SingleSourceShortestPathConstants.BELLMAN_FORD_DESCRIPTION; -@GdsCallable(name = "gds.bellmanFord.write", description = BellmanFord.DESCRIPTION, executionMode = WRITE_RELATIONSHIP) +@GdsCallable(name = "gds.bellmanFord.write", description = BELLMAN_FORD_DESCRIPTION, executionMode = WRITE_RELATIONSHIP) public class BellmanFordWriteSpec implements AlgorithmSpec, BellmanFordAlgorithmFactory> { @Override public String name() { diff --git a/proc/path-finding/src/main/java/org/neo4j/gds/paths/singlesource/delta/AllShortestPathsDeltaMutateProc.java b/proc/path-finding/src/main/java/org/neo4j/gds/paths/singlesource/delta/AllShortestPathsDeltaMutateProc.java index 1f0944d4fb1..e3e37f85aa2 100644 --- a/proc/path-finding/src/main/java/org/neo4j/gds/paths/singlesource/delta/AllShortestPathsDeltaMutateProc.java +++ b/proc/path-finding/src/main/java/org/neo4j/gds/paths/singlesource/delta/AllShortestPathsDeltaMutateProc.java @@ -23,6 +23,7 @@ import org.neo4j.gds.executor.MemoryEstimationExecutor; import org.neo4j.gds.executor.ProcedureExecutor; import org.neo4j.gds.executor.ProcedureExecutorSpec; +import org.neo4j.gds.paths.singlesource.SingleSourceShortestPathConstants; import org.neo4j.gds.procedures.pathfinding.PathFindingMutateResult; import org.neo4j.gds.paths.delta.DeltaStepping; import org.neo4j.gds.paths.delta.config.AllShortestPathsDeltaMutateConfig; @@ -35,12 +36,13 @@ import java.util.Map; import java.util.stream.Stream; +import static org.neo4j.gds.paths.singlesource.SingleSourceShortestPathConstants.DELTA_STEPPING_DESCRIPTION; import static org.neo4j.procedure.Mode.READ; public class AllShortestPathsDeltaMutateProc extends BaseProc { @Procedure(name = "gds.allShortestPaths.delta.mutate", mode = READ) - @Description(DeltaStepping.DESCRIPTION) + @Description(DELTA_STEPPING_DESCRIPTION) public Stream stream( @Name(value = "graphName") String graphName, @Name(value = "configuration", defaultValue = "{}") Map configuration diff --git a/proc/path-finding/src/main/java/org/neo4j/gds/paths/singlesource/delta/AllShortestPathsDeltaMutateSpec.java b/proc/path-finding/src/main/java/org/neo4j/gds/paths/singlesource/delta/AllShortestPathsDeltaMutateSpec.java index b62790fa7e2..4f6185fd7d2 100644 --- a/proc/path-finding/src/main/java/org/neo4j/gds/paths/singlesource/delta/AllShortestPathsDeltaMutateSpec.java +++ b/proc/path-finding/src/main/java/org/neo4j/gds/paths/singlesource/delta/AllShortestPathsDeltaMutateSpec.java @@ -24,6 +24,7 @@ import org.neo4j.gds.executor.ExecutionContext; import org.neo4j.gds.executor.GdsCallable; import org.neo4j.gds.executor.NewConfigFunction; +import org.neo4j.gds.paths.singlesource.SingleSourceShortestPathConstants; import org.neo4j.gds.procedures.pathfinding.PathFindingMutateResult; import org.neo4j.gds.paths.ShortestPathMutateResultConsumer; import org.neo4j.gds.paths.delta.DeltaStepping; @@ -34,8 +35,9 @@ import java.util.stream.Stream; import static org.neo4j.gds.executor.ExecutionMode.MUTATE_RELATIONSHIP; +import static org.neo4j.gds.paths.singlesource.SingleSourceShortestPathConstants.DELTA_STEPPING_DESCRIPTION; -@GdsCallable(name = "gds.allShortestPaths.delta.mutate", description = DeltaStepping.DESCRIPTION, executionMode = MUTATE_RELATIONSHIP) +@GdsCallable(name = "gds.allShortestPaths.delta.mutate", description = DELTA_STEPPING_DESCRIPTION, executionMode = MUTATE_RELATIONSHIP) public class AllShortestPathsDeltaMutateSpec implements AlgorithmSpec, DeltaSteppingFactory> { @Override diff --git a/proc/path-finding/src/main/java/org/neo4j/gds/paths/singlesource/delta/AllShortestPathsDeltaStatsProc.java b/proc/path-finding/src/main/java/org/neo4j/gds/paths/singlesource/delta/AllShortestPathsDeltaStatsProc.java index fbd06319d6d..9a1f6d2a73d 100644 --- a/proc/path-finding/src/main/java/org/neo4j/gds/paths/singlesource/delta/AllShortestPathsDeltaStatsProc.java +++ b/proc/path-finding/src/main/java/org/neo4j/gds/paths/singlesource/delta/AllShortestPathsDeltaStatsProc.java @@ -22,7 +22,7 @@ import org.neo4j.gds.BaseProc; import org.neo4j.gds.executor.MemoryEstimationExecutor; import org.neo4j.gds.executor.ProcedureExecutor; -import org.neo4j.gds.paths.delta.DeltaStepping; +import org.neo4j.gds.paths.singlesource.SingleSourceShortestPathConstants; import org.neo4j.gds.results.MemoryEstimateResult; import org.neo4j.gds.results.StandardStatsResult; import org.neo4j.procedure.Description; @@ -32,12 +32,13 @@ import java.util.Map; import java.util.stream.Stream; +import static org.neo4j.gds.paths.singlesource.SingleSourceShortestPathConstants.DELTA_STEPPING_DESCRIPTION; import static org.neo4j.procedure.Mode.READ; public class AllShortestPathsDeltaStatsProc extends BaseProc { @Procedure(name = "gds.allShortestPaths.delta.stats", mode = READ) - @Description(DeltaStepping.DESCRIPTION) + @Description(DELTA_STEPPING_DESCRIPTION) public Stream stats( @Name(value = "graphName") String graphName, @Name(value = "configuration", defaultValue = "{}") Map configuration diff --git a/proc/path-finding/src/main/java/org/neo4j/gds/paths/singlesource/delta/AllShortestPathsDeltaStatsSpec.java b/proc/path-finding/src/main/java/org/neo4j/gds/paths/singlesource/delta/AllShortestPathsDeltaStatsSpec.java index ef447ce4b9c..fa22960e334 100644 --- a/proc/path-finding/src/main/java/org/neo4j/gds/paths/singlesource/delta/AllShortestPathsDeltaStatsSpec.java +++ b/proc/path-finding/src/main/java/org/neo4j/gds/paths/singlesource/delta/AllShortestPathsDeltaStatsSpec.java @@ -28,13 +28,15 @@ import org.neo4j.gds.paths.delta.DeltaSteppingFactory; import org.neo4j.gds.paths.delta.config.AllShortestPathsDeltaStatsConfig; import org.neo4j.gds.paths.dijkstra.PathFindingResult; +import org.neo4j.gds.paths.singlesource.SingleSourceShortestPathConstants; import org.neo4j.gds.results.StandardStatsResult; import java.util.stream.Stream; import static org.neo4j.gds.executor.ExecutionMode.STATS; +import static org.neo4j.gds.paths.singlesource.SingleSourceShortestPathConstants.DELTA_STEPPING_DESCRIPTION; -@GdsCallable(name = "gds.allShortestPaths.delta.stats", description = DeltaStepping.DESCRIPTION, executionMode = STATS) +@GdsCallable(name = "gds.allShortestPaths.delta.stats", description = DELTA_STEPPING_DESCRIPTION, executionMode = STATS) public class AllShortestPathsDeltaStatsSpec implements AlgorithmSpec, DeltaSteppingFactory> { @Override diff --git a/proc/path-finding/src/main/java/org/neo4j/gds/paths/singlesource/delta/AllShortestPathsDeltaStreamProc.java b/proc/path-finding/src/main/java/org/neo4j/gds/paths/singlesource/delta/AllShortestPathsDeltaStreamProc.java index 1be971648f8..9d7f519edf1 100644 --- a/proc/path-finding/src/main/java/org/neo4j/gds/paths/singlesource/delta/AllShortestPathsDeltaStreamProc.java +++ b/proc/path-finding/src/main/java/org/neo4j/gds/paths/singlesource/delta/AllShortestPathsDeltaStreamProc.java @@ -23,6 +23,7 @@ import org.neo4j.gds.executor.MemoryEstimationExecutor; import org.neo4j.gds.executor.ProcedureExecutor; import org.neo4j.gds.executor.ProcedureExecutorSpec; +import org.neo4j.gds.paths.singlesource.SingleSourceShortestPathConstants; import org.neo4j.gds.procedures.pathfinding.PathFindingStreamResult; import org.neo4j.gds.paths.delta.DeltaStepping; import org.neo4j.gds.paths.delta.config.AllShortestPathsDeltaStreamConfig; @@ -35,12 +36,13 @@ import java.util.Map; import java.util.stream.Stream; +import static org.neo4j.gds.paths.singlesource.SingleSourceShortestPathConstants.DELTA_STEPPING_DESCRIPTION; import static org.neo4j.procedure.Mode.READ; public class AllShortestPathsDeltaStreamProc extends BaseProc { @Procedure(name = "gds.allShortestPaths.delta.stream", mode = READ) - @Description(DeltaStepping.DESCRIPTION) + @Description(DELTA_STEPPING_DESCRIPTION) public Stream stream( @Name(value = "graphName") String graphName, @Name(value = "configuration", defaultValue = "{}") Map configuration diff --git a/proc/path-finding/src/main/java/org/neo4j/gds/paths/singlesource/delta/AllShortestPathsDeltaStreamSpec.java b/proc/path-finding/src/main/java/org/neo4j/gds/paths/singlesource/delta/AllShortestPathsDeltaStreamSpec.java index c2150eb49ba..0a2b3f0e785 100644 --- a/proc/path-finding/src/main/java/org/neo4j/gds/paths/singlesource/delta/AllShortestPathsDeltaStreamSpec.java +++ b/proc/path-finding/src/main/java/org/neo4j/gds/paths/singlesource/delta/AllShortestPathsDeltaStreamSpec.java @@ -25,6 +25,7 @@ import org.neo4j.gds.executor.GdsCallable; import org.neo4j.gds.executor.NewConfigFunction; import org.neo4j.gds.paths.ShortestPathStreamResultConsumer; +import org.neo4j.gds.paths.singlesource.SingleSourceShortestPathConstants; import org.neo4j.gds.procedures.pathfinding.PathFindingStreamResult; import org.neo4j.gds.paths.delta.DeltaStepping; import org.neo4j.gds.paths.delta.DeltaSteppingFactory; @@ -34,8 +35,9 @@ import java.util.stream.Stream; import static org.neo4j.gds.executor.ExecutionMode.STREAM; +import static org.neo4j.gds.paths.singlesource.SingleSourceShortestPathConstants.DELTA_STEPPING_DESCRIPTION; -@GdsCallable(name = "gds.allShortestPaths.delta.stream", description = DeltaStepping.DESCRIPTION, executionMode = STREAM) +@GdsCallable(name = "gds.allShortestPaths.delta.stream", description = DELTA_STEPPING_DESCRIPTION, executionMode = STREAM) public class AllShortestPathsDeltaStreamSpec implements AlgorithmSpec, DeltaSteppingFactory> { @Override diff --git a/proc/path-finding/src/main/java/org/neo4j/gds/paths/singlesource/delta/AllShortestPathsDeltaWriteProc.java b/proc/path-finding/src/main/java/org/neo4j/gds/paths/singlesource/delta/AllShortestPathsDeltaWriteProc.java index e0a7ef6d937..73396120cf2 100644 --- a/proc/path-finding/src/main/java/org/neo4j/gds/paths/singlesource/delta/AllShortestPathsDeltaWriteProc.java +++ b/proc/path-finding/src/main/java/org/neo4j/gds/paths/singlesource/delta/AllShortestPathsDeltaWriteProc.java @@ -28,6 +28,7 @@ import org.neo4j.gds.paths.delta.DeltaStepping; import org.neo4j.gds.paths.delta.config.AllShortestPathsDeltaWriteConfig; import org.neo4j.gds.paths.dijkstra.PathFindingResult; +import org.neo4j.gds.paths.singlesource.SingleSourceShortestPathConstants; import org.neo4j.gds.results.MemoryEstimateResult; import org.neo4j.gds.results.StandardWriteRelationshipsResult; import org.neo4j.procedure.Context; @@ -38,6 +39,7 @@ import java.util.Map; import java.util.stream.Stream; +import static org.neo4j.gds.paths.singlesource.SingleSourceShortestPathConstants.DELTA_STEPPING_DESCRIPTION; import static org.neo4j.procedure.Mode.READ; import static org.neo4j.procedure.Mode.WRITE; @@ -47,7 +49,7 @@ public class AllShortestPathsDeltaWriteProc extends BaseProc { public RelationshipStreamExporterBuilder relationshipStreamExporterBuilder; @Procedure(name = "gds.allShortestPaths.delta.write", mode = WRITE) - @Description(DeltaStepping.DESCRIPTION) + @Description(DELTA_STEPPING_DESCRIPTION) public Stream stream( @Name(value = "graphName") String graphName, @Name(value = "configuration", defaultValue = "{}") Map configuration diff --git a/proc/path-finding/src/main/java/org/neo4j/gds/paths/singlesource/delta/AllShortestPathsDeltaWriteSpec.java b/proc/path-finding/src/main/java/org/neo4j/gds/paths/singlesource/delta/AllShortestPathsDeltaWriteSpec.java index 4a8c7b129fa..107e19b49c6 100644 --- a/proc/path-finding/src/main/java/org/neo4j/gds/paths/singlesource/delta/AllShortestPathsDeltaWriteSpec.java +++ b/proc/path-finding/src/main/java/org/neo4j/gds/paths/singlesource/delta/AllShortestPathsDeltaWriteSpec.java @@ -29,13 +29,15 @@ import org.neo4j.gds.paths.delta.DeltaSteppingFactory; import org.neo4j.gds.paths.delta.config.AllShortestPathsDeltaWriteConfig; import org.neo4j.gds.paths.dijkstra.PathFindingResult; +import org.neo4j.gds.paths.singlesource.SingleSourceShortestPathConstants; import org.neo4j.gds.results.StandardWriteRelationshipsResult; import java.util.stream.Stream; import static org.neo4j.gds.executor.ExecutionMode.WRITE_RELATIONSHIP; +import static org.neo4j.gds.paths.singlesource.SingleSourceShortestPathConstants.DELTA_STEPPING_DESCRIPTION; -@GdsCallable(name = "gds.allShortestPaths.delta.write", description = DeltaStepping.DESCRIPTION, executionMode = WRITE_RELATIONSHIP) +@GdsCallable(name = "gds.allShortestPaths.delta.write", description = DELTA_STEPPING_DESCRIPTION, executionMode = WRITE_RELATIONSHIP) public class AllShortestPathsDeltaWriteSpec implements AlgorithmSpec, DeltaSteppingFactory> { @Override public String name() { diff --git a/proc/path-finding/src/main/java/org/neo4j/gds/paths/singlesource/dijkstra/AllShortestPathsDijkstraMutateProc.java b/proc/path-finding/src/main/java/org/neo4j/gds/paths/singlesource/dijkstra/AllShortestPathsDijkstraMutateProc.java index 815a00a7f4f..6ab2c5f63e7 100644 --- a/proc/path-finding/src/main/java/org/neo4j/gds/paths/singlesource/dijkstra/AllShortestPathsDijkstraMutateProc.java +++ b/proc/path-finding/src/main/java/org/neo4j/gds/paths/singlesource/dijkstra/AllShortestPathsDijkstraMutateProc.java @@ -22,6 +22,7 @@ import org.neo4j.gds.BaseProc; import org.neo4j.gds.executor.MemoryEstimationExecutor; import org.neo4j.gds.executor.ProcedureExecutorSpec; +import org.neo4j.gds.paths.singlesource.SingleSourceShortestPathConstants; import org.neo4j.gds.procedures.pathfinding.PathFindingMutateResult; import org.neo4j.gds.paths.dijkstra.Dijkstra; import org.neo4j.gds.paths.dijkstra.PathFindingResult; @@ -36,6 +37,7 @@ import java.util.Map; import java.util.stream.Stream; +import static org.neo4j.gds.paths.singlesource.SingleSourceShortestPathConstants.DIJKSTRA_DESCRIPTION; import static org.neo4j.procedure.Mode.READ; public class AllShortestPathsDijkstraMutateProc extends BaseProc { @@ -43,7 +45,7 @@ public class AllShortestPathsDijkstraMutateProc extends BaseProc { public GraphDataScience facade; @Procedure(name = "gds.allShortestPaths.dijkstra.mutate", mode = READ) - @Description(Dijkstra.DESCRIPTION_SOURCE_TARGET) + @Description(DIJKSTRA_DESCRIPTION) public Stream mutate( @Name(value = "graphName") String graphName, @Name(value = "configuration", defaultValue = "{}") Map configuration diff --git a/proc/path-finding/src/main/java/org/neo4j/gds/paths/singlesource/dijkstra/AllShortestPathsDijkstraMutateSpec.java b/proc/path-finding/src/main/java/org/neo4j/gds/paths/singlesource/dijkstra/AllShortestPathsDijkstraMutateSpec.java index 08c2bf3c2ff..79a737b97a5 100644 --- a/proc/path-finding/src/main/java/org/neo4j/gds/paths/singlesource/dijkstra/AllShortestPathsDijkstraMutateSpec.java +++ b/proc/path-finding/src/main/java/org/neo4j/gds/paths/singlesource/dijkstra/AllShortestPathsDijkstraMutateSpec.java @@ -24,6 +24,7 @@ import org.neo4j.gds.executor.ExecutionContext; import org.neo4j.gds.executor.GdsCallable; import org.neo4j.gds.executor.NewConfigFunction; +import org.neo4j.gds.paths.singlesource.SingleSourceShortestPathConstants; import org.neo4j.gds.procedures.pathfinding.PathFindingMutateResult; import org.neo4j.gds.paths.ShortestPathMutateResultConsumer; import org.neo4j.gds.paths.dijkstra.Dijkstra; @@ -34,8 +35,9 @@ import java.util.stream.Stream; import static org.neo4j.gds.executor.ExecutionMode.MUTATE_RELATIONSHIP; +import static org.neo4j.gds.paths.singlesource.SingleSourceShortestPathConstants.DIJKSTRA_DESCRIPTION; -@GdsCallable(name = "gds.allShortestPaths.dijkstra.mutate", description = Dijkstra.DESCRIPTION_SOURCE_TARGET, executionMode = MUTATE_RELATIONSHIP) +@GdsCallable(name = "gds.allShortestPaths.dijkstra.mutate", description = DIJKSTRA_DESCRIPTION, executionMode = MUTATE_RELATIONSHIP) public class AllShortestPathsDijkstraMutateSpec implements AlgorithmSpec, DijkstraFactory.AllShortestPathsDijkstraFactory> { @Override diff --git a/proc/path-finding/src/main/java/org/neo4j/gds/paths/singlesource/dijkstra/AllShortestPathsDijkstraStreamProc.java b/proc/path-finding/src/main/java/org/neo4j/gds/paths/singlesource/dijkstra/AllShortestPathsDijkstraStreamProc.java index 3a9e0fef8ea..3fc535b4f82 100644 --- a/proc/path-finding/src/main/java/org/neo4j/gds/paths/singlesource/dijkstra/AllShortestPathsDijkstraStreamProc.java +++ b/proc/path-finding/src/main/java/org/neo4j/gds/paths/singlesource/dijkstra/AllShortestPathsDijkstraStreamProc.java @@ -36,6 +36,7 @@ import java.util.Map; import java.util.stream.Stream; +import static org.neo4j.gds.paths.singlesource.SingleSourceShortestPathConstants.DIJKSTRA_DESCRIPTION; import static org.neo4j.procedure.Mode.READ; public class AllShortestPathsDijkstraStreamProc extends BaseProc { @@ -43,7 +44,7 @@ public class AllShortestPathsDijkstraStreamProc extends BaseProc { public GraphDataScience facade; @Procedure(name = "gds.allShortestPaths.dijkstra.stream", mode = READ) - @Description(Dijkstra.DESCRIPTION_SOURCE_TARGET) + @Description(DIJKSTRA_DESCRIPTION) public Stream stream( @Name(value = "graphName") String graphName, @Name(value = "configuration", defaultValue = "{}") Map configuration diff --git a/proc/path-finding/src/main/java/org/neo4j/gds/paths/singlesource/dijkstra/AllShortestPathsDijkstraStreamSpec.java b/proc/path-finding/src/main/java/org/neo4j/gds/paths/singlesource/dijkstra/AllShortestPathsDijkstraStreamSpec.java index 415f6c8abd9..a835520b11c 100644 --- a/proc/path-finding/src/main/java/org/neo4j/gds/paths/singlesource/dijkstra/AllShortestPathsDijkstraStreamSpec.java +++ b/proc/path-finding/src/main/java/org/neo4j/gds/paths/singlesource/dijkstra/AllShortestPathsDijkstraStreamSpec.java @@ -25,6 +25,7 @@ import org.neo4j.gds.executor.GdsCallable; import org.neo4j.gds.executor.NewConfigFunction; import org.neo4j.gds.paths.ShortestPathStreamResultConsumer; +import org.neo4j.gds.paths.singlesource.SingleSourceShortestPathConstants; import org.neo4j.gds.procedures.pathfinding.PathFindingStreamResult; import org.neo4j.gds.paths.dijkstra.Dijkstra; import org.neo4j.gds.paths.dijkstra.DijkstraFactory; @@ -34,8 +35,9 @@ import java.util.stream.Stream; import static org.neo4j.gds.executor.ExecutionMode.MUTATE_RELATIONSHIP; +import static org.neo4j.gds.paths.singlesource.SingleSourceShortestPathConstants.DIJKSTRA_DESCRIPTION; -@GdsCallable(name = "gds.allShortestPaths.dijkstra.stream", description = Dijkstra.DESCRIPTION_SOURCE_TARGET, executionMode = MUTATE_RELATIONSHIP) +@GdsCallable(name = "gds.allShortestPaths.dijkstra.stream", description = DIJKSTRA_DESCRIPTION, executionMode = MUTATE_RELATIONSHIP) public class AllShortestPathsDijkstraStreamSpec implements AlgorithmSpec, DijkstraFactory.AllShortestPathsDijkstraFactory> { @Override diff --git a/proc/path-finding/src/main/java/org/neo4j/gds/paths/singlesource/dijkstra/AllShortestPathsDijkstraWriteProc.java b/proc/path-finding/src/main/java/org/neo4j/gds/paths/singlesource/dijkstra/AllShortestPathsDijkstraWriteProc.java index b304fa0b784..da56c9614ad 100644 --- a/proc/path-finding/src/main/java/org/neo4j/gds/paths/singlesource/dijkstra/AllShortestPathsDijkstraWriteProc.java +++ b/proc/path-finding/src/main/java/org/neo4j/gds/paths/singlesource/dijkstra/AllShortestPathsDijkstraWriteProc.java @@ -28,6 +28,7 @@ import org.neo4j.gds.paths.dijkstra.Dijkstra; import org.neo4j.gds.paths.dijkstra.PathFindingResult; import org.neo4j.gds.paths.dijkstra.config.AllShortestPathsDijkstraWriteConfig; +import org.neo4j.gds.paths.singlesource.SingleSourceShortestPathConstants; import org.neo4j.gds.results.MemoryEstimateResult; import org.neo4j.gds.results.StandardWriteRelationshipsResult; import org.neo4j.procedure.Context; @@ -38,6 +39,7 @@ import java.util.Map; import java.util.stream.Stream; +import static org.neo4j.gds.paths.singlesource.SingleSourceShortestPathConstants.DIJKSTRA_DESCRIPTION; import static org.neo4j.procedure.Mode.READ; import static org.neo4j.procedure.Mode.WRITE; @@ -47,7 +49,7 @@ public class AllShortestPathsDijkstraWriteProc extends BaseProc { public RelationshipStreamExporterBuilder relationshipStreamExporterBuilder; @Procedure(name = "gds.allShortestPaths.dijkstra.write", mode = WRITE) - @Description(Dijkstra.DESCRIPTION_SOURCE_TARGET) + @Description(DIJKSTRA_DESCRIPTION) public Stream stream( @Name(value = "graphName") String graphName, @Name(value = "configuration", defaultValue = "{}") Map configuration diff --git a/proc/path-finding/src/main/java/org/neo4j/gds/paths/singlesource/dijkstra/AllShortestPathsDijkstraWriteSpec.java b/proc/path-finding/src/main/java/org/neo4j/gds/paths/singlesource/dijkstra/AllShortestPathsDijkstraWriteSpec.java index ff03621e5af..0fb9c32b993 100644 --- a/proc/path-finding/src/main/java/org/neo4j/gds/paths/singlesource/dijkstra/AllShortestPathsDijkstraWriteSpec.java +++ b/proc/path-finding/src/main/java/org/neo4j/gds/paths/singlesource/dijkstra/AllShortestPathsDijkstraWriteSpec.java @@ -29,13 +29,15 @@ import org.neo4j.gds.paths.dijkstra.DijkstraFactory; import org.neo4j.gds.paths.dijkstra.PathFindingResult; import org.neo4j.gds.paths.dijkstra.config.AllShortestPathsDijkstraWriteConfig; +import org.neo4j.gds.paths.singlesource.SingleSourceShortestPathConstants; import org.neo4j.gds.results.StandardWriteRelationshipsResult; import java.util.stream.Stream; import static org.neo4j.gds.executor.ExecutionMode.WRITE_RELATIONSHIP; +import static org.neo4j.gds.paths.singlesource.SingleSourceShortestPathConstants.DIJKSTRA_DESCRIPTION; -@GdsCallable(name = "gds.allShortestPaths.dijkstra.write", description = Dijkstra.DESCRIPTION_SOURCE_TARGET, executionMode = WRITE_RELATIONSHIP) +@GdsCallable(name = "gds.allShortestPaths.dijkstra.write", description = DIJKSTRA_DESCRIPTION, executionMode = WRITE_RELATIONSHIP) public class AllShortestPathsDijkstraWriteSpec implements AlgorithmSpec, DijkstraFactory.AllShortestPathsDijkstraFactory> { @Override diff --git a/proc/path-finding/src/main/java/org/neo4j/gds/paths/sourcetarget/ShortestPathAStarMutateProc.java b/proc/path-finding/src/main/java/org/neo4j/gds/paths/sourcetarget/ShortestPathAStarMutateProc.java index 5c8bee3270d..06255cfc3a0 100644 --- a/proc/path-finding/src/main/java/org/neo4j/gds/paths/sourcetarget/ShortestPathAStarMutateProc.java +++ b/proc/path-finding/src/main/java/org/neo4j/gds/paths/sourcetarget/ShortestPathAStarMutateProc.java @@ -31,7 +31,7 @@ import java.util.Map; import java.util.stream.Stream; -import static org.neo4j.gds.paths.sourcetarget.ShortestPathAStarCompanion.ASTAR_DESCRIPTION; +import static org.neo4j.gds.paths.sourcetarget.SinglePairShortestPathConstants.ASTAR_DESCRIPTION; import static org.neo4j.procedure.Mode.READ; public class ShortestPathAStarMutateProc extends BaseProc { diff --git a/proc/path-finding/src/main/java/org/neo4j/gds/paths/sourcetarget/ShortestPathAStarMutateSpec.java b/proc/path-finding/src/main/java/org/neo4j/gds/paths/sourcetarget/ShortestPathAStarMutateSpec.java index 8758598c9ea..f4cd67fca9c 100644 --- a/proc/path-finding/src/main/java/org/neo4j/gds/paths/sourcetarget/ShortestPathAStarMutateSpec.java +++ b/proc/path-finding/src/main/java/org/neo4j/gds/paths/sourcetarget/ShortestPathAStarMutateSpec.java @@ -34,7 +34,7 @@ import java.util.stream.Stream; import static org.neo4j.gds.executor.ExecutionMode.MUTATE_RELATIONSHIP; -import static org.neo4j.gds.paths.sourcetarget.ShortestPathAStarCompanion.ASTAR_DESCRIPTION; +import static org.neo4j.gds.paths.sourcetarget.SinglePairShortestPathConstants.ASTAR_DESCRIPTION; @GdsCallable(name = "gds.shortestPath.astar.mutate", description = ASTAR_DESCRIPTION, executionMode = MUTATE_RELATIONSHIP) public class ShortestPathAStarMutateSpec implements AlgorithmSpec, AStarFactory> { diff --git a/proc/path-finding/src/main/java/org/neo4j/gds/paths/sourcetarget/ShortestPathAStarStreamProc.java b/proc/path-finding/src/main/java/org/neo4j/gds/paths/sourcetarget/ShortestPathAStarStreamProc.java index 04880d2bb3e..327d742ae95 100644 --- a/proc/path-finding/src/main/java/org/neo4j/gds/paths/sourcetarget/ShortestPathAStarStreamProc.java +++ b/proc/path-finding/src/main/java/org/neo4j/gds/paths/sourcetarget/ShortestPathAStarStreamProc.java @@ -32,7 +32,7 @@ import java.util.Map; import java.util.stream.Stream; -import static org.neo4j.gds.paths.sourcetarget.ShortestPathAStarCompanion.ASTAR_DESCRIPTION; +import static org.neo4j.gds.paths.sourcetarget.SinglePairShortestPathConstants.ASTAR_DESCRIPTION; import static org.neo4j.procedure.Mode.READ; public class ShortestPathAStarStreamProc extends BaseProc { diff --git a/proc/path-finding/src/main/java/org/neo4j/gds/paths/sourcetarget/ShortestPathAStarStreamSpec.java b/proc/path-finding/src/main/java/org/neo4j/gds/paths/sourcetarget/ShortestPathAStarStreamSpec.java index a2252b9b2ad..8dfbbdd136f 100644 --- a/proc/path-finding/src/main/java/org/neo4j/gds/paths/sourcetarget/ShortestPathAStarStreamSpec.java +++ b/proc/path-finding/src/main/java/org/neo4j/gds/paths/sourcetarget/ShortestPathAStarStreamSpec.java @@ -34,7 +34,7 @@ import java.util.stream.Stream; import static org.neo4j.gds.executor.ExecutionMode.STREAM; -import static org.neo4j.gds.paths.sourcetarget.ShortestPathAStarCompanion.ASTAR_DESCRIPTION; +import static org.neo4j.gds.paths.sourcetarget.SinglePairShortestPathConstants.ASTAR_DESCRIPTION; @GdsCallable(name = "gds.shortestPath.astar.stream", description = ASTAR_DESCRIPTION, executionMode = STREAM) public class ShortestPathAStarStreamSpec implements AlgorithmSpec, AStarFactory> { diff --git a/proc/path-finding/src/main/java/org/neo4j/gds/paths/sourcetarget/ShortestPathAStarWriteProc.java b/proc/path-finding/src/main/java/org/neo4j/gds/paths/sourcetarget/ShortestPathAStarWriteProc.java index 78b16a3c6f4..ac7b1318e84 100644 --- a/proc/path-finding/src/main/java/org/neo4j/gds/paths/sourcetarget/ShortestPathAStarWriteProc.java +++ b/proc/path-finding/src/main/java/org/neo4j/gds/paths/sourcetarget/ShortestPathAStarWriteProc.java @@ -34,7 +34,7 @@ import java.util.Map; import java.util.stream.Stream; -import static org.neo4j.gds.paths.sourcetarget.ShortestPathAStarCompanion.ASTAR_DESCRIPTION; +import static org.neo4j.gds.paths.sourcetarget.SinglePairShortestPathConstants.ASTAR_DESCRIPTION; import static org.neo4j.procedure.Mode.READ; import static org.neo4j.procedure.Mode.WRITE; diff --git a/proc/path-finding/src/main/java/org/neo4j/gds/paths/sourcetarget/ShortestPathAStarWriteSpec.java b/proc/path-finding/src/main/java/org/neo4j/gds/paths/sourcetarget/ShortestPathAStarWriteSpec.java index 3d70eb75e24..3b594d21174 100644 --- a/proc/path-finding/src/main/java/org/neo4j/gds/paths/sourcetarget/ShortestPathAStarWriteSpec.java +++ b/proc/path-finding/src/main/java/org/neo4j/gds/paths/sourcetarget/ShortestPathAStarWriteSpec.java @@ -34,7 +34,7 @@ import java.util.stream.Stream; import static org.neo4j.gds.executor.ExecutionMode.WRITE_RELATIONSHIP; -import static org.neo4j.gds.paths.sourcetarget.ShortestPathAStarCompanion.ASTAR_DESCRIPTION; +import static org.neo4j.gds.paths.sourcetarget.SinglePairShortestPathConstants.ASTAR_DESCRIPTION; @GdsCallable(name = "gds.shortestPath.astar.write", description = ASTAR_DESCRIPTION, executionMode = WRITE_RELATIONSHIP) public class ShortestPathAStarWriteSpec implements AlgorithmSpec, AStarFactory> { diff --git a/proc/path-finding/src/main/java/org/neo4j/gds/paths/sourcetarget/ShortestPathDijkstraMutateProc.java b/proc/path-finding/src/main/java/org/neo4j/gds/paths/sourcetarget/ShortestPathDijkstraMutateProc.java index 88261389857..4143275cb9a 100644 --- a/proc/path-finding/src/main/java/org/neo4j/gds/paths/sourcetarget/ShortestPathDijkstraMutateProc.java +++ b/proc/path-finding/src/main/java/org/neo4j/gds/paths/sourcetarget/ShortestPathDijkstraMutateProc.java @@ -31,7 +31,7 @@ import java.util.Map; import java.util.stream.Stream; -import static org.neo4j.gds.paths.sourcetarget.ShortestPathDijkstraProc.DIJKSTRA_DESCRIPTION; +import static org.neo4j.gds.paths.sourcetarget.SinglePairShortestPathConstants.DIJKSTRA_DESCRIPTION; import static org.neo4j.procedure.Mode.READ; public class ShortestPathDijkstraMutateProc extends BaseProc { diff --git a/proc/path-finding/src/main/java/org/neo4j/gds/paths/sourcetarget/ShortestPathDijkstraMutateSpec.java b/proc/path-finding/src/main/java/org/neo4j/gds/paths/sourcetarget/ShortestPathDijkstraMutateSpec.java index 5b4ea05aa0e..e7f58d61ee1 100644 --- a/proc/path-finding/src/main/java/org/neo4j/gds/paths/sourcetarget/ShortestPathDijkstraMutateSpec.java +++ b/proc/path-finding/src/main/java/org/neo4j/gds/paths/sourcetarget/ShortestPathDijkstraMutateSpec.java @@ -34,7 +34,7 @@ import java.util.stream.Stream; import static org.neo4j.gds.executor.ExecutionMode.MUTATE_RELATIONSHIP; -import static org.neo4j.gds.paths.sourcetarget.ShortestPathDijkstraProc.DIJKSTRA_DESCRIPTION; +import static org.neo4j.gds.paths.sourcetarget.SinglePairShortestPathConstants.DIJKSTRA_DESCRIPTION; @GdsCallable(name = "gds.shortestPath.dijkstra.mutate", description = DIJKSTRA_DESCRIPTION, executionMode = MUTATE_RELATIONSHIP) public class ShortestPathDijkstraMutateSpec implements AlgorithmSpec, DijkstraFactory.SourceTargetDijkstraFactory> { diff --git a/proc/path-finding/src/main/java/org/neo4j/gds/paths/sourcetarget/ShortestPathDijkstraStreamProc.java b/proc/path-finding/src/main/java/org/neo4j/gds/paths/sourcetarget/ShortestPathDijkstraStreamProc.java index f5efed1f0ba..d9a18652d21 100644 --- a/proc/path-finding/src/main/java/org/neo4j/gds/paths/sourcetarget/ShortestPathDijkstraStreamProc.java +++ b/proc/path-finding/src/main/java/org/neo4j/gds/paths/sourcetarget/ShortestPathDijkstraStreamProc.java @@ -32,7 +32,7 @@ import java.util.Map; import java.util.stream.Stream; -import static org.neo4j.gds.paths.sourcetarget.ShortestPathDijkstraProc.DIJKSTRA_DESCRIPTION; +import static org.neo4j.gds.paths.sourcetarget.SinglePairShortestPathConstants.DIJKSTRA_DESCRIPTION; import static org.neo4j.procedure.Mode.READ; public class ShortestPathDijkstraStreamProc extends BaseProc { diff --git a/proc/path-finding/src/main/java/org/neo4j/gds/paths/sourcetarget/ShortestPathDijkstraStreamSpec.java b/proc/path-finding/src/main/java/org/neo4j/gds/paths/sourcetarget/ShortestPathDijkstraStreamSpec.java index 51b46e708e7..a162b6a64f2 100644 --- a/proc/path-finding/src/main/java/org/neo4j/gds/paths/sourcetarget/ShortestPathDijkstraStreamSpec.java +++ b/proc/path-finding/src/main/java/org/neo4j/gds/paths/sourcetarget/ShortestPathDijkstraStreamSpec.java @@ -34,7 +34,7 @@ import java.util.stream.Stream; import static org.neo4j.gds.executor.ExecutionMode.STREAM; -import static org.neo4j.gds.paths.sourcetarget.ShortestPathDijkstraProc.DIJKSTRA_DESCRIPTION; +import static org.neo4j.gds.paths.sourcetarget.SinglePairShortestPathConstants.DIJKSTRA_DESCRIPTION; @GdsCallable(name = "gds.shortestPath.dijkstra.stream", description = DIJKSTRA_DESCRIPTION, executionMode = STREAM) public class ShortestPathDijkstraStreamSpec implements AlgorithmSpec, DijkstraFactory.SourceTargetDijkstraFactory> { diff --git a/proc/path-finding/src/main/java/org/neo4j/gds/paths/sourcetarget/ShortestPathDijkstraWriteProc.java b/proc/path-finding/src/main/java/org/neo4j/gds/paths/sourcetarget/ShortestPathDijkstraWriteProc.java index eb0e431fcc2..de412fa129c 100644 --- a/proc/path-finding/src/main/java/org/neo4j/gds/paths/sourcetarget/ShortestPathDijkstraWriteProc.java +++ b/proc/path-finding/src/main/java/org/neo4j/gds/paths/sourcetarget/ShortestPathDijkstraWriteProc.java @@ -34,7 +34,7 @@ import java.util.Map; import java.util.stream.Stream; -import static org.neo4j.gds.paths.sourcetarget.ShortestPathDijkstraProc.DIJKSTRA_DESCRIPTION; +import static org.neo4j.gds.paths.sourcetarget.SinglePairShortestPathConstants.DIJKSTRA_DESCRIPTION; import static org.neo4j.procedure.Mode.READ; import static org.neo4j.procedure.Mode.WRITE; diff --git a/proc/path-finding/src/main/java/org/neo4j/gds/paths/sourcetarget/ShortestPathDijkstraWriteSpec.java b/proc/path-finding/src/main/java/org/neo4j/gds/paths/sourcetarget/ShortestPathDijkstraWriteSpec.java index ebb42f94d2a..f1ab3fa1f83 100644 --- a/proc/path-finding/src/main/java/org/neo4j/gds/paths/sourcetarget/ShortestPathDijkstraWriteSpec.java +++ b/proc/path-finding/src/main/java/org/neo4j/gds/paths/sourcetarget/ShortestPathDijkstraWriteSpec.java @@ -34,7 +34,7 @@ import java.util.stream.Stream; import static org.neo4j.gds.executor.ExecutionMode.WRITE_RELATIONSHIP; -import static org.neo4j.gds.paths.sourcetarget.ShortestPathDijkstraProc.DIJKSTRA_DESCRIPTION; +import static org.neo4j.gds.paths.sourcetarget.SinglePairShortestPathConstants.DIJKSTRA_DESCRIPTION; @GdsCallable(name = "gds.shortestPath.dijkstra.write", description = DIJKSTRA_DESCRIPTION, executionMode = WRITE_RELATIONSHIP) public class ShortestPathDijkstraWriteSpec implements AlgorithmSpec, DijkstraFactory.SourceTargetDijkstraFactory> { diff --git a/proc/path-finding/src/main/java/org/neo4j/gds/paths/sourcetarget/ShortestPathYensMutateProc.java b/proc/path-finding/src/main/java/org/neo4j/gds/paths/sourcetarget/ShortestPathYensMutateProc.java index 5b78d3ce791..42709fda048 100644 --- a/proc/path-finding/src/main/java/org/neo4j/gds/paths/sourcetarget/ShortestPathYensMutateProc.java +++ b/proc/path-finding/src/main/java/org/neo4j/gds/paths/sourcetarget/ShortestPathYensMutateProc.java @@ -31,12 +31,12 @@ import java.util.Map; import java.util.stream.Stream; -import static org.neo4j.gds.paths.sourcetarget.YensConstants.DESCRIPTION; +import static org.neo4j.gds.paths.sourcetarget.SinglePairShortestPathConstants.YENS_DESCRIPTION; import static org.neo4j.procedure.Mode.READ; public class ShortestPathYensMutateProc extends BaseProc { @Procedure(name = "gds.shortestPath.yens.mutate", mode = READ) - @Description(DESCRIPTION) + @Description(YENS_DESCRIPTION) public Stream mutate( @Name(value = "graphName") String graphName, @Name(value = "configuration", defaultValue = "{}") Map configuration diff --git a/proc/path-finding/src/main/java/org/neo4j/gds/paths/sourcetarget/ShortestPathYensMutateSpec.java b/proc/path-finding/src/main/java/org/neo4j/gds/paths/sourcetarget/ShortestPathYensMutateSpec.java index 9681a2bf470..8c690cd03f1 100644 --- a/proc/path-finding/src/main/java/org/neo4j/gds/paths/sourcetarget/ShortestPathYensMutateSpec.java +++ b/proc/path-finding/src/main/java/org/neo4j/gds/paths/sourcetarget/ShortestPathYensMutateSpec.java @@ -34,9 +34,9 @@ import java.util.stream.Stream; import static org.neo4j.gds.executor.ExecutionMode.MUTATE_RELATIONSHIP; -import static org.neo4j.gds.paths.sourcetarget.YensConstants.DESCRIPTION; +import static org.neo4j.gds.paths.sourcetarget.SinglePairShortestPathConstants.YENS_DESCRIPTION; -@GdsCallable(name = "gds.shortestPath.yens.mutate", description = DESCRIPTION, executionMode = MUTATE_RELATIONSHIP) +@GdsCallable(name = "gds.shortestPath.yens.mutate", description = YENS_DESCRIPTION, executionMode = MUTATE_RELATIONSHIP) public class ShortestPathYensMutateSpec implements AlgorithmSpec, YensFactory> { @Override public String name() { diff --git a/proc/path-finding/src/main/java/org/neo4j/gds/paths/sourcetarget/ShortestPathYensStreamProc.java b/proc/path-finding/src/main/java/org/neo4j/gds/paths/sourcetarget/ShortestPathYensStreamProc.java index 007cc7c8a4f..ec41a0f7e74 100644 --- a/proc/path-finding/src/main/java/org/neo4j/gds/paths/sourcetarget/ShortestPathYensStreamProc.java +++ b/proc/path-finding/src/main/java/org/neo4j/gds/paths/sourcetarget/ShortestPathYensStreamProc.java @@ -31,12 +31,12 @@ import java.util.Map; import java.util.stream.Stream; -import static org.neo4j.gds.paths.sourcetarget.YensConstants.DESCRIPTION; +import static org.neo4j.gds.paths.sourcetarget.SinglePairShortestPathConstants.YENS_DESCRIPTION; import static org.neo4j.procedure.Mode.READ; public class ShortestPathYensStreamProc extends BaseProc { @Procedure(name = "gds.shortestPath.yens.stream", mode = READ) - @Description(DESCRIPTION) + @Description(YENS_DESCRIPTION) public Stream stream( @Name(value = "graphName") String graphName, @Name(value = "configuration", defaultValue = "{}") Map configuration diff --git a/proc/path-finding/src/main/java/org/neo4j/gds/paths/sourcetarget/ShortestPathYensStreamSpec.java b/proc/path-finding/src/main/java/org/neo4j/gds/paths/sourcetarget/ShortestPathYensStreamSpec.java index f815b164025..9d670903b77 100644 --- a/proc/path-finding/src/main/java/org/neo4j/gds/paths/sourcetarget/ShortestPathYensStreamSpec.java +++ b/proc/path-finding/src/main/java/org/neo4j/gds/paths/sourcetarget/ShortestPathYensStreamSpec.java @@ -34,8 +34,9 @@ import java.util.stream.Stream; import static org.neo4j.gds.executor.ExecutionMode.STREAM; +import static org.neo4j.gds.paths.sourcetarget.SinglePairShortestPathConstants.YENS_DESCRIPTION; -@GdsCallable(name = "gds.shortestPath.yens.stream", description = YensConstants.DESCRIPTION, executionMode = STREAM) +@GdsCallable(name = "gds.shortestPath.yens.stream", description = YENS_DESCRIPTION, executionMode = STREAM) public class ShortestPathYensStreamSpec implements AlgorithmSpec, YensFactory> { @Override diff --git a/proc/path-finding/src/main/java/org/neo4j/gds/paths/sourcetarget/ShortestPathYensWriteProc.java b/proc/path-finding/src/main/java/org/neo4j/gds/paths/sourcetarget/ShortestPathYensWriteProc.java index 593d369f5c7..cad5a6fef6a 100644 --- a/proc/path-finding/src/main/java/org/neo4j/gds/paths/sourcetarget/ShortestPathYensWriteProc.java +++ b/proc/path-finding/src/main/java/org/neo4j/gds/paths/sourcetarget/ShortestPathYensWriteProc.java @@ -34,7 +34,7 @@ import java.util.Map; import java.util.stream.Stream; -import static org.neo4j.gds.paths.sourcetarget.YensConstants.DESCRIPTION; +import static org.neo4j.gds.paths.sourcetarget.SinglePairShortestPathConstants.YENS_DESCRIPTION; import static org.neo4j.procedure.Mode.READ; import static org.neo4j.procedure.Mode.WRITE; @@ -43,7 +43,7 @@ public class ShortestPathYensWriteProc extends BaseProc { public RelationshipStreamExporterBuilder relationshipStreamExporterBuilder; @Procedure(name = "gds.shortestPath.yens.write", mode = WRITE) - @Description(DESCRIPTION) + @Description(YENS_DESCRIPTION) public Stream write( @Name(value = "graphName") String graphName, @Name(value = "configuration", defaultValue = "{}") Map configuration diff --git a/proc/path-finding/src/main/java/org/neo4j/gds/paths/sourcetarget/ShortestPathYensWriteSpec.java b/proc/path-finding/src/main/java/org/neo4j/gds/paths/sourcetarget/ShortestPathYensWriteSpec.java index f59e487e847..e0fa4111896 100644 --- a/proc/path-finding/src/main/java/org/neo4j/gds/paths/sourcetarget/ShortestPathYensWriteSpec.java +++ b/proc/path-finding/src/main/java/org/neo4j/gds/paths/sourcetarget/ShortestPathYensWriteSpec.java @@ -34,9 +34,9 @@ import java.util.stream.Stream; import static org.neo4j.gds.executor.ExecutionMode.WRITE_RELATIONSHIP; -import static org.neo4j.gds.paths.sourcetarget.YensConstants.DESCRIPTION; +import static org.neo4j.gds.paths.sourcetarget.SinglePairShortestPathConstants.YENS_DESCRIPTION; -@GdsCallable(name = "gds.shortestPath.yens.write", description = DESCRIPTION, executionMode = WRITE_RELATIONSHIP) +@GdsCallable(name = "gds.shortestPath.yens.write", description = YENS_DESCRIPTION, executionMode = WRITE_RELATIONSHIP) public class ShortestPathYensWriteSpec implements AlgorithmSpec, YensFactory> { @Override public String name() { diff --git a/proc/path-finding/src/main/java/org/neo4j/gds/paths/sourcetarget/ShortestPathAStarCompanion.java b/proc/path-finding/src/main/java/org/neo4j/gds/paths/sourcetarget/SinglePairShortestPathConstants.java similarity index 75% rename from proc/path-finding/src/main/java/org/neo4j/gds/paths/sourcetarget/ShortestPathAStarCompanion.java rename to proc/path-finding/src/main/java/org/neo4j/gds/paths/sourcetarget/SinglePairShortestPathConstants.java index d5de0990a6a..c5ac72d2cd0 100644 --- a/proc/path-finding/src/main/java/org/neo4j/gds/paths/sourcetarget/ShortestPathAStarCompanion.java +++ b/proc/path-finding/src/main/java/org/neo4j/gds/paths/sourcetarget/SinglePairShortestPathConstants.java @@ -19,11 +19,13 @@ */ package org.neo4j.gds.paths.sourcetarget; -final class ShortestPathAStarCompanion { - static final String ASTAR_DESCRIPTION = +interface SinglePairShortestPathConstants { + String ASTAR_DESCRIPTION = "The A* shortest path algorithm computes the shortest path between a pair of nodes. " + "It uses the relationship weight property to compare path lengths. " + "In addition, this implementation uses the haversine distance as a heuristic to converge faster."; - private ShortestPathAStarCompanion() {} + String DIJKSTRA_DESCRIPTION = "The Dijkstra shortest path algorithm computes the shortest (weighted) path between a pair of nodes."; + + String YENS_DESCRIPTION = "The Yen's shortest path algorithm computes the k shortest (weighted) paths between a pair of nodes."; } diff --git a/proc/path-finding/src/main/java/org/neo4j/gds/paths/sourcetarget/YensConstants.java b/proc/path-finding/src/main/java/org/neo4j/gds/paths/sourcetarget/YensConstants.java deleted file mode 100644 index f584a62b594..00000000000 --- a/proc/path-finding/src/main/java/org/neo4j/gds/paths/sourcetarget/YensConstants.java +++ /dev/null @@ -1,26 +0,0 @@ -/* - * Copyright (c) "Neo4j" - * Neo4j Sweden AB [http://neo4j.com] - * - * This file is part of Neo4j. - * - * Neo4j is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - */ -package org.neo4j.gds.paths.sourcetarget; - -final class YensConstants { - static final String DESCRIPTION = "The Yen's shortest path algorithm computes the k shortest (weighted) paths between a pair of nodes."; - - private YensConstants() {} -}