bovine3dom / Nauty.jl

A small Julia wrapper for nauty
Other
8 stars 5 forks source link

Nauty.jl

Simple wrapper for using nauty, a graph isomorphism package, with LightGraphs in Julia. Requires gcc and a POSIX style build environment.

Currently under development. Interface may change / break by the day.

Example usage

Check if two graphs are isomorphs of each other:

baked_canonical_form(g1).canong == baked_canonical_form(g2).canong

LightGraphs interface:

using Nauty
BenchmarkTools.@btime LightGraphs.Experimental.has_isomorph(g1,g2,alg=NautyAlg())

If you need to provide custom options to nauty, use densenauty(g, optionblk(optionblk_mutable(DEFAULTOPTIONS_GRAPH))), but be aware that it is around 2-4x slower than using baked in options as Julia cannot optimise across the C boundary. Consider baking your own.

Todo

API

canonical_isomorph(g: LightGraph) -> g' canonical_isomorph(g: ColouredGraph) -> g'

isisomorph(g1, g2) -> bool operator overload (congruence sign?)

nauty(g, options) -> all the stuff nauty gives