| Copyright | (c) Marcelo Garlet Milani 2025 |
|---|---|
| License | GPL-3 |
| Maintainer | mgmilani@pm.me |
| Stability | unstable |
| Safe Haskell | Safe-Inferred |
| Language | Haskell2010 |
Nauty.Internal
Description
This module contains internal functions used by the Nauty module. Except for test cases, you should not import this module.
Synopsis
- data GraphType
- data Format
- = Graph6
- | Sparse6
- | Digraph6
- | Incremental
- data Graph = Graph {}
- parse :: Text -> [Either Text Graph]
- parse' :: Maybe Graph -> [Text] -> [Either Text Graph]
- getFormat :: Text -> Format
- encodeMany :: [Graph] -> Text
- encodeMany' :: Maybe Graph -> [Graph] -> [Text]
- encode :: Graph -> Text
- edgeExists :: Graph -> Word64 -> Word64 -> Bool
- toEdgeList :: Graph -> (Word64, [(Word64, Word64)])
Documentation
Format in used for encoding and decoding.
Constructors
| Graph6 | |
| Sparse6 | |
| Digraph6 | |
| Incremental |
A directed or undirected graph. See nauty documentation for an explanation of the format used by the adjacency matrix.
Constructors
| Graph | |
Fields
| |
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<<.
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.
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.
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.