nauty-parser-1.0.0.0: Parse/encode graph6, digraph6 and sparse6 formats (nauty).
Copyright(c) Marcelo Garlet Milani 2026
LicenseMIT
Maintainermgmilani@pm.me
Stabilityunstable
Safe HaskellSafe-Inferred
LanguageHaskell2010

Nauty.Graph6.Internal

Description

This module contains internal functions used by the Nauty.Graph6 module. Except for test cases, you should not import this module.

Synopsis

Documentation

data AdjacencyMatrix Source #

A graph represented as an adjacency matrix.

Constructors

AdjacencyMatrix 

Fields

areAdjacent :: AdjacencyMatrix -> Word64 -> Word64 -> Bool Source #

Whether two vertices are adjacent.

encode :: AdjacencyMatrix -> Text Source #

Encode a graph into graph6 format.

encodeMatrix :: AdjacencyMatrix -> Text Source #

Encode the adjacency matrix.

fromEdgeList Source #

Arguments

:: Word64

Number of vertices

-> [(Word64, Word64)]

List of edges

-> AdjacencyMatrix 

Create an adjacency matrix from a list of edges. Vertices need to be in the range from 0 to n - 1.

toEdgeList :: AdjacencyMatrix -> (Word64, [(Word64, Word64)]) Source #

The list of edges of a graph together with the number of vertices.

parse :: Text -> [Either Text AdjacencyMatrix] Source #

Parse all graphs in the input text. Graphs are stored one per line.

graph :: Text -> Either Text AdjacencyMatrix Source #

Parse a single graph in graph6 format.

parseMatrix :: Word64 -> StateT ByteString (Either Text) AdjacencyMatrix Source #

Parse the adjacency matrix of a graph.