Full API

NautyGraphs.DenseNautyGraphType
DenseNautyGraph{D,W}

Memory-efficient graph format compatible with nauty. Can be directed (D = true) or undirected (D = false). This graph format stores the adjacency matrix in bit vector form. W is the underlying unsigned integer type that holds the individual bits of the graph's adjacency matrix (defaults to UInt).

source
NautyGraphs.DenseNautyGraphMethod
DenseNautyGraph{D}(A::AbstractMatrix; [vertex_labels]) where {D}

Construct a DenseNautyGraph{D} from the adjacency matrix A. If A[i][j] != 0, an edge (i, j) is inserted. A must be a square matrix. The graph can be directed (D = true) or undirected (D = false). If D = false, A must be symmetric. Vertex labels can optionally be specified.

source
NautyGraphs.DenseNautyGraphMethod
DenseNautyGraph{D}(n::Integer; [vertex_labels]) where {D}

Construct a DenseNautyGraph on n vertices and 0 edges. Can be directed (D = true) or undirected (D = false). Vertex labels can optionally be specified.

source
NautyGraphs.DenseNautyGraphMethod
DenseNautyGraph{D}(edge_list::Vector{<:AbstractEdge}; [vertex_labels]) where {D}

Construct a DenseNautyGraph from a vector of edges. The number of vertices is the highest that is used in an edge in edge_list. The graph can be directed (D = true) or undirected (D = false). Vertex labels can optionally be specified.

source
NautyGraphs.DenseNautyGraphMethod
DenseNautyGraph{D}(; vertex_labels) where {D}

Construct a vertex-labeled DenseNautyGraph on length(vertex_labels) vertices and 0 edges. Can be directed (D = true) or undirected (D = false).

source
NautyGraphs.GraphsetType
Graphset{W}

A graphset is a special bit matrix used to represent the adjacency matrix of a nauty graph in dense format. For a graph on n vertices, the graphset contains n*m "words", i.e. unsigned integers that contain the bits of the adjacency matrix, where m is the number of words per vertex.

The organization of words is as follows:

   ------------ m words per vertex ----->  
   | 0x00000000, 0x00000000, 0x00000000, ...  
 n | 0x00000000, 0x00000000, 0x00000000, ...  
   | 0x00000000, 0x00000000, 0x00000000, ...  
   v
source
NautyGraphs.NautyDiGraphType
NautyDiGraph <: AbstractNautyGraph{Int}

Memory-efficient directed graph format compatible with nauty, which represents the graph as an adjacency matrix in bit vector form. Alias for DenseNautyGraph{true}.

See also NautyGraph, SpNautyGraph, and SpNautyDiGraph for other nauty-compatible graph formats.

source
NautyGraphs.NautyGraphType
NautyGraph <: AbstractNautyGraph{Int}

Memory-efficient undirected graph format compatible with nauty, which represents the graph as an adjacency matrix in bit vector form. Alias for DenseNautyGraph{false}.

See also NautyDiGraph, SpNautyGraph, and SpNautyDiGraph for other nauty-compatible graph formats.

source
NautyGraphs.SpNautyDiGraphType
SpNautyDiGraph

Sparse directed graph format compatible with nauty, which represents the graph via an edgelist. Repeated modifications to a SpNautyGraph may result in suboptimal memory usage. Alias for SparseNautyGraph{true}.

See also NautyGraph, NautyDiGraph, and SpNautyGraph for other nauty-compatible graph formats.

source
NautyGraphs.SpNautyGraphType
SpNautyGraph

Sparse undirected graph format compatible with nauty, which represents the graph via an edgelist. Repeated modifications to a SpNautyGraph may result in suboptimal memory usage. Alias for SparseNautyGraph{false}.

See also NautyGraph, NautyDiGraph, and SpNautyDiGraph for other nauty-compatible graph formats.

source
NautyGraphs.SparseNautyGraphType
SparseNautyGraph{D}

Sparse graph format compatible with nauty. Can be directed (D = true) or undirected (D = false). This graph format stores the adjacency matrix as an edgelist. Repeated modifications to the graph may result in suboptimal memory usage.

source
NautyGraphs.SparseNautyGraphMethod
SparseNautyGraph{D}(A::AbstractMatrix; [vertex_labels]) where {D}

Construct a SparseNautyGraph{D} from the adjacency matrix A. If A[i][j] != 0, an edge (i, j) is inserted. A must be a square matrix. The graph can be directed (D = true) or undirected (D = false). If D = false, A must be symmetric. Vertex labels can optionally be specified.

source
NautyGraphs.SparseNautyGraphMethod
SparseNautyGraph{D}(n::Integer; [vertex_labels, ne=n]) where {D}

Construct a SparseNautyGraph on n vertices and 0 edges. Can be directed (D = true) or undirected (D = false). Vertex labels can optionally be specified. If ne is provided, enough memory for ne optimally packed edges is allocated.

source
NautyGraphs.SparseNautyGraphMethod
SparseNautyGraph{D}(edge_list::Vector{<:AbstractEdge}; [vertex_labels]) where {D}

Construct a SparseNautyGraph from a vector of edges. The number of vertices is the highest that is used in an edge in edge_list. The graph can be directed (D = true) or undirected (D = false). Vertex labels can optionally be specified. To achieve optimal memory efficiency, it is recommended to sort the edge list beforehand.

source
NautyGraphs.SparseNautyGraphMethod
SparseNautyGraph{D}(; vertex_labels) where {D}

Construct a vertex-labeled SparseNautyGraph on length(vertex_labels) vertices and 0 edges. Can be directed (D = true) or undirected (D = false).

source
NautyGraphs.canonical_idMethod
canonical_id(g::AbstractNautyGraph)

Hash the canonical version of g, using the first 128 bits returned by the SHA256 algorithm.

The canonical id has the property that is_isomorphic(g1, g2) == true implies canonical_id(g1) == canonical_id(g2). The converse usually holds as well, but in very rare cases, hash collisions may cause non-isomorphic graphs to have the same canonical id.

Note

canonical_id computes different results depending on whether the input is a dense NautyGraph or sparse SpNautyGraph, meaning that different graph types cannot be compared using their canonical ids.

source
NautyGraphs.is_isomorphicFunction
is_isomorphic(g::AbstractNautyGraph, h::AbstractNautyGraph)

Check whether two graphs g and h are isomorphic to each other by comparing their canonical forms.

source
NautyGraphs.iscanonMethod
iscanon(g::AbstractNautyGraph)

Return true if g has previously been canonized.

iscanon(g) == false does not necessarily imply that g is not in canonical form, it just means g has never been explicitly canonized. This function should be considered internal and may be removed in future versions.

source
NautyGraphs.nautyFunction
nauty(g::AbstractNautyGraph, [options::NautyOptions]; [canonize=false])

Compute a graph g's canonical permutation and automorphism group. If canonize=true, g will additionally be canonized in-place.

See also canonize! and canonical_permutation for other tools related to canonization.

source
NautyGraphs.setlabel!Method
setlabel!(g::AbstractNautyGraph, i::Integer, vertex_label)

Set the label of vertex i of g equal to vertex_label.

source