Safe Haskell | Safe |
---|---|
Language | Haskell2010 |
Functions for interacting with a graph as a directed graph
Synopsis
- type Node = Int
- type NodeSet = IntSet
- type Edge = (Node, Node)
- data IntGraph
- empty :: IntGraph
- addNode :: Node -> IntGraph -> IntGraph
- nodes :: IntGraph -> [Node]
- removeNode :: Node -> IntGraph -> IntGraph
- addEdge :: Edge -> IntGraph -> IntGraph
- edges :: IntGraph -> [Edge]
- removeEdge :: Edge -> IntGraph -> IntGraph
- fromEdges :: [Edge] -> IntGraph
- null :: IntGraph -> Bool
- nullEdges :: IntGraph -> Bool
Documentation
An IntGraph is a maping of Ints (Nodes) to sets of Nodes (Ints)
addNode :: Node -> IntGraph -> IntGraph Source #
Adds a single node with no neighbors. | If node already in graph, does nothing.