lidingxu / Traces.jl

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Traces.jl : Graph canonical labeling and automorphism group computation

Simple Julia wrapper for traces of version 27r4.

Installation

Require gcc and a POSIX style build environment.

Add the package:

pkg.add("https://github.com/lidingxu/Traces.jl.git")

Example usage

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)

API

Data structures

  • DEFAULTOPTIONS_TRACES : default options
  • TracesOptions : default constructor of options
  • TracesStats : default constructor of stats
  • SparseGraph: 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 and SparseGraph 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 function Traces via ccall
  • backend_traces_with_automs: a wrapper function call to C function Traces_With_Automs via ccall

Helper methods

  • to_sparse: return a SparseGraph of Graphs, SimpleGraphs and MetaGraphs
  • traces: return readeable orbits, canonocial graph, generators (in cyclic representation), of Graphs/SimpleGraphs/MetaGraphs for given labels, parition

Warning: reuse of SparseGraph return by to_sparse may lead to a memory leak, because the memory allocated for the internal data structure may be released.

About

License:Other


Languages

Language:Julia 100.0%