pub fn is_self_complementary(graph: &Graph) -> IgraphResult<bool>Expand description
Check whether a graph is self-complementary.
A graph is self-complementary if it is isomorphic to its complement.
Returns false for directed graphs. Handles simple undirected
graphs; for multigraphs or graphs with self-loops, the complement
is computed without loops.
An empty graph (0 vertices) is self-complementary (vacuously). A single vertex is self-complementary.
ยงExamples
use rust_igraph::{Graph, is_self_complementary};
// P4 (0-1-2-3) is self-complementary
let mut g = Graph::with_vertices(4);
g.add_edge(0, 1).unwrap();
g.add_edge(1, 2).unwrap();
g.add_edge(2, 3).unwrap();
assert!(is_self_complementary(&g).unwrap());
// Triangle K3 is NOT self-complementary
let mut g = Graph::with_vertices(3);
g.add_edge(0, 1).unwrap();
g.add_edge(1, 2).unwrap();
g.add_edge(2, 0).unwrap();
assert!(!is_self_complementary(&g).unwrap());