Skip to main content

Module traversal

Module traversal 

Source
Expand description

BFS, DFS, shortest path, and subgraph extraction. Graph traversal algorithms: BFS, DFS, shortest path, subgraph extraction.

Functionsยง

bfs
Breadth-first search returning (node, depth) pairs.
bfs_filtered
BFS that only follows edges matching the given edge types.
dfs
Depth-first search returning (node, depth) pairs.
extract_subgraph
Extract all nodes and edges within radius hops of center.
shortest_path
Find shortest path using BFS. Returns None if no path exists.