Skip to main content

has_hamiltonian_path

Function has_hamiltonian_path 

Source
pub fn has_hamiltonian_path(graph: &Graph) -> IgraphResult<bool>
Expand description

Check whether a graph has a Hamiltonian path.

ยงExamples

use rust_igraph::{Graph, has_hamiltonian_path};

let g = Graph::from_edges(&[(0,1),(1,2),(2,3)], false, Some(4)).unwrap();
assert!(has_hamiltonian_path(&g).unwrap());