A new universe for your graph data.Meet Galactus DB
GALACTUS DB WIKIDeployment · Queries · Operations

Live graph algorithms

Wiki / Graph data science

Graph algorithms

These run directly on the live graph (no named projections). The illustrative IDs below must be replaced with existing IDs from your database. Use application keys to find nodes first. The direction argument accepts 'OUT'/'OUTGOING', 'IN'/'INCOMING', or anything else for both directions.

ProcedureYIELDArgs
gdb.dijkstra(sourceId, targetId, relType, weightProp, direction)nodeIds, totalCost, pathnode ids (int), relationship type (string), weight property name (string; omit/empty → each hop costs 1), direction
gdb.astar(sourceId, targetId, relType, weightProp, pointProp, direction)nodeIds, totalCost, pathas Dijkstra, plus pointProp — a Point property used for the straight-line heuristic
gdb.pageRank(relType, iterations, dampingFactor)nodeId, scoretype (string), iterations (int, default 20), damping (float, default 0.85)
gdb.degree(nodeId, direction)degreenode id (int), direction
// shortest weighted path from node 0 to node 42 over :ROAD by 'km':
CALL gdb.dijkstra(0, 42, 'ROAD', 'km', 'OUT')
YIELD nodeIds, totalCost, path
RETURN nodeIds, totalCost;

// A* using a 'loc' point property as the heuristic:
CALL gdb.astar(0, 42, 'ROAD', 'km', 'loc', 'OUT') YIELD totalCost RETURN totalCost;

// PageRank over :LINKS, 30 iterations:
CALL gdb.pageRank('LINKS', 30, 0.85) YIELD nodeId, score
RETURN nodeId, score ORDER BY score DESC LIMIT 10;

CALL gdb.degree(0, 'OUT') YIELD degree RETURN degree;

Cypher also offers shortestPath/allShortestPaths for unweighted shortest paths inside a MATCH — see Paths and shortest-path queries.

Graph projections and catalogue · GDS algorithms and execution modes · GDS resources and cancellation · Graph data science

Planning a deployment? Review compatibility and licence setup for your instance.