Simple Julia wrapper for traces
of version 27r4.
Require gcc
and a POSIX style build environment.
Add the package:
pkg.add("https://github.com/lidingxu/Traces.jl.git")
Convert a Graph
g to a nauty's SparseGraph
, and return its canonical labelling (permutation), automophism (generators), orbits:
using Traces
using Graphs
g = Graph()
# add vertices and edges to g ...
canon_label, automorphism, orbit_class = Traces.traces(g, true, true)
Data structures
DEFAULTOPTIONS_TRACES
: default optionsTracesOptions
: default constructor of optionsTracesStats
: default constructor of statsSparseGraph
: default constructor of traces'SparseGraph
tracesreturn
: a struct containing return of traces, i.e., canonocial graph, generators, labels, partition, orbits, stats
Note: the index of Julia and
Graph
start at 1, the index of C andSparseGraph
start at 0. See the user guide of nauty and traces for details about their data structure and function call.
Interfaces
backend_traces
: a wrapper function call to C functionTraces
via ccallbackend_traces_with_automs
: a wrapper function call to C functionTraces_With_Automs
via ccall
Helper methods
to_sparse
: return aSparseGraph
ofGraphs
,SimpleGraphs
andMetaGraphs
traces
: return readeable orbits, canonocial graph, generators (in cyclic representation), ofGraphs
/SimpleGraphs
/MetaGraphs
for given labels, parition
Warning: reuse of
SparseGraph
return byto_sparse
may lead to a memory leak, because the memory allocated for the internal data structure may be released.