bfs

Function bfs 

Source
pub fn bfs(
    graph: &CodeGraph,
    start: NodeId,
    direction: Direction,
    max_depth: Option<usize>,
) -> Result<Vec<NodeId>>
Expand description

Breadth-First Search traversal from a starting node.

Returns all reachable nodes within the specified depth limit.

§Parameters

  • graph: The graph to traverse
  • start: Starting node ID
  • direction: Follow outgoing or incoming edges
  • max_depth: Optional maximum depth (None for unlimited)

§Returns

Vec of reachable node IDs (excluding the start node)