Skip to content

Commit

Permalink
minors
Browse files Browse the repository at this point in the history
Co-authored-by: Veselin Nikolov <veselin.nikolov@neotechnology.com>
  • Loading branch information
IoannisPanagiotas and vnickolov committed Jul 31, 2024
1 parent fa769c9 commit 0c7ff7e
Showing 1 changed file with 3 additions and 5 deletions.
8 changes: 3 additions & 5 deletions algo/src/main/java/org/neo4j/gds/paths/yens/YensTask.java
Original file line number Diff line number Diff line change
Expand Up @@ -107,9 +107,7 @@ private void process(int indexId) {
var spurPath = computeDijkstra(spurNode);

// No new candidate from this spur node, continue with next node.
if (spurPath.isPresent()) {
storePath(indexId, rootPath, spurPath);
}
spurPath.ifPresent(pathResult -> storePath(indexId, rootPath, pathResult));

}

Expand Down Expand Up @@ -137,10 +135,10 @@ private Optional<PathResult> computeDijkstra(long spurNode) {
return localDijkstra.compute().findFirst();
}

private void storePath(int indexId, MutablePathResult rootPath, Optional<PathResult> spurPath) {
private void storePath(int indexId, MutablePathResult rootPath, PathResult spurPath) {

// Entire path is made up of the root path and spur path.
pathAppender.accept(rootPath, spurPath.get());
pathAppender.accept(rootPath, spurPath);

//https://en.wikipedia.org/wiki/Yen%27s_algorithm#Lawler's_modification
//We store the index of the spur node
Expand Down

0 comments on commit 0c7ff7e

Please sign in to comment.