public class Nauty
extends java.lang.Object
Modifier and Type | Field and Description |
---|---|
static Algorithm |
DENSE
Algorithm binding for the dense version of nauty.
|
static Algorithm |
SPARSE
Algorithm binding for the sparse version of nauty.
|
Constructor and Description |
---|
Nauty() |
Modifier and Type | Method and Description |
---|---|
private static long[] |
computeCanonDense(int[][] adj,
int[] colors)
Computes the canonical form of the given coloured graph using the dense
version of nauty.
|
private static long[] |
computeCanonSparse(int[][] adj,
int[] colors)
Computes the canonical form of the given coloured graph using the sparse
version of nauty.
|
protected static int[] |
prepareColors(GraphUtil.ColoredGraph graph)
Computes a nauty and traces compatible array of color data.
|
private static long[] |
runNauty(dev.roanh.gmark.util.Graph<dev.roanh.gmark.conjunct.cpq.QueryGraphCPQ.Vertex,dev.roanh.gmark.core.graph.Predicate> input,
java.util.function.BiFunction<int[][],int[],long[]> version)
Runs either the dense or sparse version of nauty on the given
input graph.
|
public static final Algorithm DENSE
public static final Algorithm SPARSE
private static long[] runNauty(dev.roanh.gmark.util.Graph<dev.roanh.gmark.conjunct.cpq.QueryGraphCPQ.Vertex,dev.roanh.gmark.core.graph.Predicate> input, java.util.function.BiFunction<int[][],int[],long[]> version)
input
- The input graph.version
- The version of nauty to run, either the dense or sparse version.protected static int[] prepareColors(GraphUtil.ColoredGraph graph)
graph
- The coloured graph to compute color data from.private static long[] computeCanonSparse(int[][] adj, int[] colors)
adj
- The input graph in adjacency list format, n
arrays with each the indices of the neighbours of the
n
-th vertex.colors
- The array containing raw color information data. Contains vertex
indices in blocks of the same color with the start of a block of the same
color being indicated by a negated value. All vertex indices are also always
one higher than their actual index in the graph.private static long[] computeCanonDense(int[][] adj, int[] colors)
adj
- The input graph in adjacency list format, n
arrays with each the indices of the neighbours of the
n
-th vertex.colors
- The array containing raw color information data. Contains vertex
indices in blocks of the same color with the start of a block of the same
color being indicated by a negated value. All vertex indices are also always
one higher than their actual index in the graph.