| Copyright | (c) Marcelo Garlet Milani 2026 |
|---|---|
| License | MIT |
| Maintainer | mgmilani@pm.me |
| Stability | unstable |
| Safe Haskell | Safe-Inferred |
| Language | Haskell2010 |
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
- data AdjacencyMatrix = AdjacencyMatrix {}
- areAdjacent :: AdjacencyMatrix -> Word64 -> Word64 -> Bool
- encode :: AdjacencyMatrix -> Text
- encodeMatrix :: AdjacencyMatrix -> Text
- fromEdgeList :: Word64 -> [(Word64, Word64)] -> AdjacencyMatrix
- toEdgeList :: AdjacencyMatrix -> (Word64, [(Word64, Word64)])
- parse :: Text -> [Either Text AdjacencyMatrix]
- graph :: Text -> Either Text AdjacencyMatrix
- parseMatrix :: Word64 -> StateT ByteString (Either Text) AdjacencyMatrix
Documentation
data AdjacencyMatrix Source #
A graph represented as an adjacency matrix.
Constructors
| AdjacencyMatrix | |
Instances
| Show AdjacencyMatrix Source # | |
Defined in Nauty.Graph6.Internal Methods showsPrec :: Int -> AdjacencyMatrix -> ShowS # show :: AdjacencyMatrix -> String # showList :: [AdjacencyMatrix] -> ShowS # | |
| Eq AdjacencyMatrix Source # | |
Defined in Nauty.Graph6.Internal Methods (==) :: AdjacencyMatrix -> AdjacencyMatrix -> Bool # (/=) :: AdjacencyMatrix -> AdjacencyMatrix -> Bool # | |
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.
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.
parseMatrix :: Word64 -> StateT ByteString (Either Text) AdjacencyMatrix Source #
Parse the adjacency matrix of a graph.