Projected pathfinding
Projected pathfinding
Use an existing projection; the source and targets must be selected projected nodes. See modes for write/mutate configuration.
gds.shortestPath.dijkstragds.shortestPath.astargds.shortestPath.yensgds.allShortestPaths.dijkstra(single-source distances/paths)
Each has stream, stats, write and mutate entry points. Specify
sourceNode, targetNode or targetNodes, and optionally
relationshipWeightProperty. The single-source procedure visits every reachable
target using a single Dijkstra tree, also reused for multi-target Dijkstra.
Returned paths still require memory proportional to their total length.
Yen additionally takes positive k and enumerates distinct simple node
paths in cost order. Parallel edges with the same endpoints are not treated as
separate Yen paths. A* needs latitudeProperty and longitudeProperty; its
geographic heuristic is scaled to the cheapest cost/metre edge so other weight
units cannot invalidate shortest-path correctness.
Stream columns are index, sourceNode, targetNode, totalCost, nodeIds, costs, path. Paths use virtual PATH relationships with per-step costs. Unreachable
targets return no row. A source equal to its target returns a zero-cost path.
Write/mutate create source-to-target summary relationships, with the property
defaulting to totalCost; they do not rewrite the traversed relationships.
Related articles
Graph projections and catalogue · GDS algorithms and execution modes · GDS resources and cancellation · Graph data science