Function graphalgs::tournament::random_tournament
source · pub fn random_tournament(n: usize) -> Vec<(usize, usize)>
Expand description
Random tournament on n vertices.
Returns a vector of edges Vec<(usize, usize)>
.
Examples
use graphalgs::tournament::{ random_tournament, is_tournament };
use petgraph::{ Graph, Directed };
let graph: Graph::<(), (), Directed, usize> = Graph::from_edges(random_tournament(4));
assert!(is_tournament(&graph));