/// Find vertex cycles that include the specified vertex, with a maximum size. If one cycle is found, return
Find vertex cycles that include the specified vertex, with a maximum size. If one cycle is found, return
Find vertex cycles that include the specified vertex with a maximum size . If one cycle is found return
fn find_cycles<T: graph::Vertex>(
    vertex_index: usize,
    vv: &graph::VertexVec<T>,
    max_cycle_size: usize
) -> Vec<Vec<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 && open_routes[0].len() <= max_cycle_size {
        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
            }
        }
    }
    vec![]
}
fn find_cycles < T : graph :: Vertex > ( vertex_index : usize , vv : & graph :: VertexVec < T > , max_cycle_size : usize ) -> Vec < Vec < 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 && open_routes [ 0 ] . len ( ) <= max_cycle_size { 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 } } } vec ! [ ] }
Find vertex cycles that include the specified vertex, with a maximum size.
Find vertex cycles that include the specified vertex with a maximum size .
vertex_index
usize
vv
&graph::VertexVec<T>
max_cycle_size
usize