Function graphalgs::tournament::is_tournament_transitive
source · pub fn is_tournament_transitive<G>(graph: G) -> boolwhere
G: IntoEdgeReferences + NodeCount + EdgeCount + IntoNodeIdentifiers,
G::NodeId: Eq + Hash,
Expand description
Is the tournament transitive?
Check if the tournament is transitive and return the corresponding boolean value.
Examples
use graphalgs::tournament::is_tournament_transitive;
use petgraph::Graph;
let graph = Graph::<(), ()>::from_edges(&[
(0, 1), (0, 2), (0, 3),
(1, 2), (1, 3), (2, 3),
]);
assert!(is_tournament_transitive(&graph));
let graph = Graph::<(), ()>::from_edges(&[
(0, 2), (1, 0), (1, 2),
(3, 0), (3, 1), (2, 3),
]);
assert!(!is_tournament_transitive(&graph));