Skip to main content

induced_components

Function induced_components 

Source
pub fn induced_components<T>(
    graph: &CompressedSparseData2<T>,
    members: &[usize],
) -> Result<(usize, Vec<usize>), MethodsErrors>
where T: Clone,
Expand description

Weakly connected components of the subgraph induced by members.

Only edges with both endpoints in members are considered. Duplicated entries in members are tolerated and land in the same component.

§Params

  • graph - Square CSR adjacency. Edge direction is ignored.
  • members - Node indices spanning the induced subgraph.

§Returns

(n_components, labels) where labels[p] is the component of members[p]. Labels are assigned in ascending members position.