nauty-pet 0.4.0

Canonical graph labelling using nauty/Traces and petgraph
docs.rs failed to build nauty-pet-0.4.0
Please check the build logs for more information.
See Builds for ideas on how to fix a failed build, or Metadata for how to configure docs.rs builds.
If you believe this is docs.rs' fault, open an issue.
Visit the last successful build: nauty-pet-0.12.1

nauty-pet

Canonical graph labelling.

Leverages nauty and Traces to find canonical labellings for petgraph graphs.

Usage

Version 2.6 or 2.7 of the nauty and Traces library has to be installed first and linked to the same C library as this crate.

Afterwards, add this to your Cargo.toml:

[dependencies]
nauty-pet = "0.4"

Example

use petgraph::graph::UnGraph;
use nauty_pet::prelude::*;

// Two different vertex labellings for the tree graph with two edges
let g1 = UnGraph::<(), ()>::from_edges([(0, 1), (1, 2)]);
let g2 = UnGraph::<(), ()>::from_edges([(0, 1), (0, 2)]);

// There are two equivalent labellings
let automorphism_info = g1.clone().try_into_autom().unwrap();
assert_eq!(automorphism_info.grpsize(), 2.);

// The canonical forms are identical
let c1 = g1.into_canon();
let c2 = g2.into_canon();
assert!(c1.is_identical(&c2))

License: Apache-2.0