fn new_from<Graph: EdgeIdGraph>(original_graph: &Graph, node_order: NodeOrder, contracted_graph: UnweightedOwnedGraph) -> Self {
        let elimination_tree = Self::build_elimination_tree(&contracted_graph);
        let n = contracted_graph.num_nodes() as NodeId;
        let m = contracted_graph.num_arcs();
        let mut tail = vec![0; m];

        let cch_edge_to_orig_arc = (0..n)
            .flat_map(|node| {
                let node_order = &node_order;
                LinkIterable::<NodeIdT>::link_iter(&contracted_graph, node).map(move |NodeIdT(neighbor)| {
                    (
                        original_graph.edge_indices(node_order.node(node), node_order.node(neighbor)).collect(),
                        original_graph.edge_indices(node_order.node(neighbor), node_order.node(node)).collect(),
                    )
                })
            })
            .collect();

        for node in 0..n {
            tail[contracted_graph.neighbor_edge_indices_usize(node)]
                .iter_mut()
                .for_each(|tail| *tail = node);
        }

        let inverted = ReversedGraphWithEdgeIds::reversed(&contracted_graph);
        let (first_out, head) = contracted_graph.decompose();

        CCH {
            first_out,
            head,
            node_order,
            cch_edge_to_orig_arc,
            elimination_tree,
            tail,
            inverted,
        }
    }
// this method creates all the other structures from the contracted graph
this method creates all the other structures from the contracted graph
this method creates all the other structures from the contracted graph
fn new_from<Graph: EdgeIdGraph>(original_graph: &Graph, node_order: NodeOrder, contracted_graph: UnweightedOwnedGraph) -> Self {
        let elimination_tree = Self::build_elimination_tree(&contracted_graph);
        let n = contracted_graph.num_nodes() as NodeId;
        let m = contracted_graph.num_arcs();
        let mut tail = vec![0; m];
        let cch_edge_to_orig_arc = (0..n)
            .flat_map(|node| {
                let node_order = &node_order;
                LinkIterable::<NodeIdT>::link_iter(&contracted_graph, node).map(move |NodeIdT(neighbor)| {
                    (
                        original_graph.edge_indices(node_order.node(node), node_order.node(neighbor)).collect(),
                        original_graph.edge_indices(node_order.node(neighbor), node_order.node(node)).collect(),
                    )
                })
            })
            .collect();
        for node in 0..n {
            tail[contracted_graph.neighbor_edge_indices_usize(node)]
                .iter_mut()
                .for_each(|tail| *tail = node);
        }
        let inverted = ReversedGraphWithEdgeIds::reversed(&contracted_graph);
        let (first_out, head) = contracted_graph.decompose();
        CCH {
            first_out,
            head,
            node_order,
            cch_edge_to_orig_arc,
            elimination_tree,
            tail,
            inverted,
        }
    }
fn new_from < Graph : EdgeIdGraph > ( original_graph : & Graph , node_order : NodeOrder , contracted_graph : UnweightedOwnedGraph ) -> Self { let elimination_tree = Self :: build_elimination_tree ( & contracted_graph ) ; let n = contracted_graph . num_nodes ( ) as NodeId ; let m = contracted_graph . num_arcs ( ) ; let mut tail = vec ! [ 0 m ] ; let cch_edge_to_orig_arc = ( 0 .. n ) . flat_map ( | node | { let node_order = & node_order ; LinkIterable :: < NodeIdT > :: link_iter ( & contracted_graph , node ) . map ( move | NodeIdT ( neighbor ) | { ( original_graph . edge_indices ( node_order . node ( node ) , node_order . node ( neighbor ) ) . collect ( ) , original_graph . edge_indices ( node_order . node ( neighbor ) , node_order . node ( node ) ) . collect ( ) , ) } ) } ) . collect ( ) ; for node in 0 .. n { tail [ contracted_graph . neighbor_edge_indices_usize ( node ) ] . iter_mut ( ) . for_each ( | tail | * tail = node ) ; } let inverted = ReversedGraphWithEdgeIds :: reversed ( & contracted_graph ) ; let ( first_out , head ) = contracted_graph . decompose ( ) ; CCH { first_out , head , node_order , cch_edge_to_orig_arc , elimination_tree , tail , inverted , } }
this method creates all the other structures from the contracted graph
this method creates all the other structures from the contracted graph
original_graph
&Graph
node_order
NodeOrder
contracted_graph
UnweightedOwnedGraph
original_graph
&Graph
node_order
NodeOrder
contracted_graph
UnweightedOwnedGraph