priority_first_search_digraph

Function priority_first_search_digraph 

Source
pub fn priority_first_search_digraph<N, E, Ix, P, F>(
    graph: &DiGraph<N, E, Ix>,
    source: &N,
    priority_fn: F,
) -> Result<Vec<N>>
where N: Node + Debug + Clone, E: EdgeWeight, Ix: IndexType, P: PartialOrd + Clone + Copy, F: Fn(&N) -> P,
Expand description

Performs priority-first search from a given starting node in a directed graph

§Arguments

  • graph - The directed graph to traverse
  • source - The source node
  • priority_fn - Function that assigns priority to each node (lower values visited first)

§Returns

  • Result<Vec<N>> - The nodes visited in priority order