pub fn cycle_size<T: graph::Vertex>(
    vertex_index: usize,
    vv: &graph::VertexVec<T>
) -> usize {
    let mut open_routes: Vec<Vec<usize>> = vec![vec![vertex_index]];
    let mut cyclic_routes: Vec<Vec<usize>> = vec![];

    while open_routes.len() > 0 {
        let open_routes_tmp = open_routes.clone();
        open_routes.clear();
        for route in open_routes_tmp.iter() {
            extend_one_edge(route, vv, &mut cyclic_routes, &mut open_routes);
            if cyclic_routes.len() > 0 {
                return cyclic_routes[0].len()
            }
        }
    }

    0
}
/// Find the size of the minimun cycle which the vertex belongs to. If the vertex is acylic, return 0 
Find the size of the minimun cycle which the vertex belongs to. If the vertex is acylic, return 0
Find the size of the minimun cycle which the vertex belongs to . If the vertex is acylic return 0
pub fn cycle_size<T: graph::Vertex>(
    vertex_index: usize,
    vv: &graph::VertexVec<T>
) -> usize {
    let mut open_routes: Vec<Vec<usize>> = vec![vec![vertex_index]];
    let mut cyclic_routes: Vec<Vec<usize>> = vec![];
    while open_routes.len() > 0 {
        let open_routes_tmp = open_routes.clone();
        open_routes.clear();
        for route in open_routes_tmp.iter() {
            extend_one_edge(route, vv, &mut cyclic_routes, &mut open_routes);
            if cyclic_routes.len() > 0 {
                return cyclic_routes[0].len()
            }
        }
    }
    0
}
pub fn cycle_size < T : graph :: Vertex > ( vertex_index : usize , vv : & graph :: VertexVec < T > ) -> usize { let mut open_routes : Vec < Vec < usize > > = vec ! [ vec [ vertex_index ] ] ; let mut cyclic_routes : Vec < Vec < usize > > = vec ! [ ] ; while open_routes . len ( ) > 0 { let open_routes_tmp = open_routes . clone ( ) ; open_routes . clear ( ) ; for route in open_routes_tmp . iter ( ) { extend_one_edge ( route , vv , & mut cyclic_routes , & mut open_routes ) ; if cyclic_routes . len ( ) > 0 { return cyclic_routes [ 0 ] . len ( ) } } } 0 }
Find the size of the minimun cycle which the vertex belongs to.
Find the size of the minimun cycle which the vertex belongs to .
vertex_index
usize
vv
&graph::VertexVec<T>
vertex_index
usize
vv
&graph::VertexVec<T>