Skip to main content

Module traversal

Module traversal 

Source
Expand description

Graph traversal: 1-hop neighbors and BFS via recursive CTEs.

Functions§

build_graph
Build a graph snapshot (node summaries + edges) from the database.
graph_neighbors
Get 1-hop neighbors from seed IDs. Returns (neighbor_id, total_weight) sorted by weight DESC.
related_nodes
BFS traversal from start_id via SQL recursive CTE.