pub fn new(graph: &'a Graph, is_directed: bool) -> Self {
        let mut connect = Self {
            graph: graph,
            cc: vec![0; graph.num_v()],
            vcc: vec![0; graph.num_e()],
            num_cc: 0,
            num_vcc: 0,
        };
        let mut t = 0;
        let mut vis = vec![0; graph.num_v()];
        let mut low = vec![0; graph.num_v()];
        let mut v_stack = Vec::new();
        let mut e_stack = Vec::new();
        for u in 0..graph.num_v() {
            if vis[u] == 0 {
                if is_directed {
                    connect.scc(u, &mut t, &mut vis, &mut low, &mut v_stack);
                } else {
                    connect.bcc(
                        u,
                        graph.num_e() + 1,
                        &mut t,
                        &mut vis,
                        &mut low,
                        &mut v_stack,
                        &mut e_stack,
                    );
                }
            }
        }
        connect
    }
/// Computes the SCCs of a directed graph in reverse topological order, or
/// the 2ECCs/2VCCS of an undirected graph. Can also get CCs by passing an
/// undirected graph using `is_directed == true`.
Computes the SCCs of a directed graph in reverse topological order, or
the 2ECCs/2VCCS of an undirected graph. Can also get CCs by passing an
undirected graph using `is_directed == true`.
Computes the SCCs of a directed graph in reverse topological order or the 2ECCs / 2VCCS of an undirected graph . Can also get CCs by passing an undirected graph using ` is_directed == true ` .
pub fn new(graph: &'a Graph, is_directed: bool) -> Self {
        let mut connect = Self {
            graph: graph,
            cc: vec![0; graph.num_v()],
            vcc: vec![0; graph.num_e()],
            num_cc: 0,
            num_vcc: 0,
        };
        let mut t = 0;
        let mut vis = vec![0; graph.num_v()];
        let mut low = vec![0; graph.num_v()];
        let mut v_stack = Vec::new();
        let mut e_stack = Vec::new();
        for u in 0..graph.num_v() {
            if vis[u] == 0 {
                if is_directed {
                    connect.scc(u, &mut t, &mut vis, &mut low, &mut v_stack);
                } else {
                    connect.bcc(
                        u,
                        graph.num_e() + 1,
                        &mut t,
                        &mut vis,
                        &mut low,
                        &mut v_stack,
                        &mut e_stack,
                    );
                }
            }
        }
        connect
    }
pub fn new ( graph : & ' a Graph , is_directed : bool ) -> Self { let mut connect = Self { graph : graph , cc : vec ! [ 0 graph num_v ( ) ] , vcc : vec ! [ 0 graph num_e ( ) ] , num_cc : 0 , num_vcc : 0 , } ; let mut t = 0 ; let mut vis = vec ! [ 0 graph num_v ( ) ] ; let mut low = vec ! [ 0 graph num_v ( ) ] ; let mut v_stack = Vec :: new ( ) ; let mut e_stack = Vec :: new ( ) ; for u in 0 .. graph . num_v ( ) { if vis [ u ] == 0 { if is_directed { connect . scc ( u , & mut t , & mut vis , & mut low , & mut v_stack ) ; } else { connect . bcc ( u , graph . num_e ( ) + 1 , & mut t , & mut vis , & mut low , & mut v_stack , & mut e_stack , ) ; } } } connect }
Computes the SCCs of a directed graph in reverse topological order, or
the 2ECCs/2VCCS of an undirected graph.
Computes the SCCs of a directed graph in reverse topological order or the 2ECCs / 2VCCS of an undirected graph .
graph
&'a Graph
is_directed
bool
graph
&'a Graph
is_directed
bool