-- Hoogle documentation, generated by Haddock -- See Hoogle, http://www.haskell.org/hoogle/ -- | Dynamically sized graph library -- -- Graph implemented as an IntMap to Sets of Ints. Functions for Directed -- and Undirected graphs are provided. @package IntGraph @version 0.1.0.0 -- | Functions for interacting with a graph as a directed graph module Data.IntGraph.Directed -- | The nodes of the graph are Ints type Node = Int -- | A NodeSet is a Set of Nodes type NodeSet = Set Node -- | An edge is a pair of nodes type Edge = (Node, Node) -- | An IntGraph is a maping of Ints (Nodes) to sets of Nodes (Ints) data IntGraph -- | the empty graph empty :: IntGraph -- | Adds a single node with no neighbors. | If node already in graph, does -- nothing. addNode :: Node -> IntGraph -> IntGraph -- | Returns a list of the nodes in the graph nodes :: IntGraph -> [Node] -- | removes a node and all its incident edges removeNode :: Node -> IntGraph -> IntGraph -- | Add an edge to the graph | If either of the nodes are not already -- present in the graph, | They are added. addEdge :: Edge -> IntGraph -> IntGraph -- | Returns a list of all edges in the graph edges :: IntGraph -> [Edge] -- | Remove an edge from the graph removeEdge :: Edge -> IntGraph -> IntGraph -- | Turns a list of edges into a graph fromEdges :: [Edge] -> IntGraph -- | Functions for interacting with a graph as an undirected graph module Data.IntGraph.Undirected -- | The nodes of the graph are Ints type Node = Int -- | A NodeSet is a Set of Nodes type NodeSet = Set Node -- | An edge is a pair of nodes type Edge = (Node, Node) -- | An IntGraph is a maping of Ints (Nodes) to sets of Nodes (Ints) data IntGraph -- | the empty graph empty :: IntGraph -- | Adds a single node with no neighbors. | If node already in graph, does -- nothing. addNode :: Node -> IntGraph -> IntGraph -- | Returns a list of the nodes in the graph nodes :: IntGraph -> [Node] -- | removes a node and all its incident edges removeNode :: Node -> IntGraph -> IntGraph -- | Add an edge to the graph | If either nodes is not already in the -- graph, they are added addEdge :: Edge -> IntGraph -> IntGraph -- | Returns a list of all edges in the graph edges :: IntGraph -> [Edge] -- | remove an edge from the graph removeEdge :: Edge -> IntGraph -> IntGraph -- | turns a list of edges into a graph fromEdges :: [Edge] -> IntGraph