Function pathfinding::undirected::connected_components::separate_components[][src]

#[must_use]
pub fn separate_components<N>(
    groups: &[Vec<N>]
) -> (HashMap<N, usize>, Vec<usize>) where
    N: Clone + Hash + Eq

Separate components of an undirected graph into disjoint sets.

This function returns a pair containing:

Note that if you have a raw undirected graph, you can build such a structure by creating a group for every vertex containing the vertex itself and its immediate neighbours.