Skip to main content

isoclass

Function isoclass 

Source
pub fn isoclass(graph: &Graph) -> IgraphResult<u32>
Expand description

Determines the isomorphism class of a graph.

The graph must have exactly 3 or 4 vertices (directed), or 3, 4, or 5 vertices (undirected). Multi-edges and self-loops are ignored.

Class 0 is always the empty graph; the highest class is the complete graph.

§Examples

use rust_igraph::{Graph, isoclass};

// Empty directed graph on 3 vertices → class 0
let g = Graph::new(3, true).unwrap();
assert_eq!(isoclass(&g).unwrap(), 0);

// Complete undirected graph on 3 vertices (triangle) → class 3
let mut g = Graph::with_vertices(3);
g.add_edge(0, 1).unwrap();
g.add_edge(1, 2).unwrap();
g.add_edge(0, 2).unwrap();
assert_eq!(isoclass(&g).unwrap(), 3);