icentral_graph/
merge_muc_cycle.rs

1crate::ix!();
2
3impl<GH> MergeMucCycle<GH> for Graph<GH> 
4
5where GH
6: GetConnectedComponentSizes
7+ ExtendWith<GH>
8+ GetEdges
9+ GetNeighborsForNode
10+ GetNodeIdRange
11+ HasMapForNode
12+ InsertEdge
13+ InsertNode
14+ MappedNodes
15+ NumEdges
16+ NumNodes
17{
18    /**
19      | add all the edges in cycle to muc
20      |
21      */
22    fn merge_muc_cycle(
23        &mut self, 
24        muc:   &mut MinimumUnionCycle<GH>,
25        cycle: &Cycle)  {
26        
27        for i in 0..cycle.num_edges() {
28
29            let mut src: NodeId = cycle[i].src;
30            let mut dst: NodeId = cycle[i].dst;
31
32            muc.insert_edge(&Edge::new(src, dst));
33
34            self.nodes_to_mucs.set_mucid_for_node(src, muc.id());
35            self.nodes_to_mucs.set_mucid_for_node(dst, muc.id());
36        }
37    }
38}