Skip to main content

mycielski_graph

Function mycielski_graph 

Source
pub fn mycielski_graph(k: u32) -> IgraphResult<Graph>
Expand description

Construct the canonical Mycielski graph M_k.

M_0 is the null graph, M_1 is a single vertex, M_2 is the two-path P_2, M_3 is the five-cycle C_5, M_4 is the Grötzsch graph (11 vertices, 20 edges, triangle-free, chromatic number 4), and M_k for k > 4 is the (k - 2)-fold Mycielskian of P_2.

§Errors

§Examples

use rust_igraph::mycielski_graph;

// M_3 is the 5-cycle.
let c5 = mycielski_graph(3).unwrap();
assert_eq!(c5.vcount(), 5);
assert_eq!(c5.ecount(), 5);

// M_4 is the Grötzsch graph: 11 vertices, 20 edges, triangle-free.
let g = mycielski_graph(4).unwrap();
assert_eq!(g.vcount(), 11);
assert_eq!(g.ecount(), 20);