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

Nauty.Internal

Description

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

Synopsis

Documentation

data GraphType Source #

Whether the graph has undirected or directed edges.

Constructors

Undirected 
Directed 

Instances

Instances details
Show GraphType Source # 
Instance details

Defined in Nauty.Internal

Eq GraphType Source # 
Instance details

Defined in Nauty.Internal

data Format Source #

Format in used for encoding and decoding.

Instances

Instances details
Show Format Source # 
Instance details

Defined in Nauty.Internal

Eq Format Source # 
Instance details

Defined in Nauty.Internal

Methods

(==) :: Format -> Format -> Bool #

(/=) :: Format -> Format -> Bool #

data Graph Source #

A directed or undirected graph. See nauty documentation for an explanation of the format used by the adjacency matrix.

Constructors

Graph 

Fields

Instances

Instances details
Show Graph Source # 
Instance details

Defined in Nauty.Internal

Methods

showsPrec :: Int -> Graph -> ShowS #

show :: Graph -> String #

showList :: [Graph] -> ShowS #

Eq Graph Source # 
Instance details

Defined in Nauty.Internal

Methods

(==) :: Graph -> Graph -> Bool #

(/=) :: Graph -> Graph -> Bool #

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

Parse a list of graphs encoded in graph6, sparse6 or digraph6 format. Each line encodes one graph. Optionally, the first line might be a header of the form >>graph6<<, >>sparse6<< or >>digraph6<<.

parse' Source #

Arguments

:: Maybe Graph

Used in case the first graph of the list uses incremental sparse6 format.

-> [Text] 
-> [Either Text Graph] 

Parse a list of graphs in graph6, digraph6, sparse6 or incremental sparse6 format.

getFormat :: Text -> Format Source #

Format used for encoding the graph.

encodeMany :: [Graph] -> Text Source #

Encode a sequence of graphs using the given formats. Graphs may be encoded with the incremental format, but only if the previous graph is encoded with sparse6.

encodeMany' Source #

Arguments

:: Maybe Graph

Used as a predecessor in case the first graph of the list is to be encoded in incremental sparse6 format.

-> [Graph] 
-> [Text] 

Encode a sequence of graphs using the given formats. Graphs may be encoded with the incremental format, but only if the previous graph is encoded with sparse6.

encode :: Graph -> Text Source #

Encode a graph using the format given by the format field. Graphs with the Incremental format are encoded using sparse6.

edgeExists Source #

Arguments

:: Graph 
-> Word64

From vertex in directed graphs.

-> Word64

To vertex in directed graphs.

-> Bool 

Whether the graph contains and edge between two vertices. In digraph6 format, the edge is a directed edge from the first to the second vertex.

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

The number of vertices and the list of (potentially directed) edges of a graph.