Safe Haskell | Safe-Inferred |
---|---|
Language | Haskell2010 |
Wrapper around Data.Graph with support for edge labels
Synopsis
- type Graph e = Array Vertex [(e, Vertex)]
- type Vertex = Int
- graphFromEdges :: forall key node edge. Ord key => [(node, key, [(edge, key)])] -> (Graph edge, Vertex -> (node, key, [(edge, key)]), key -> Maybe Vertex)
- graphFromEdges' :: Ord key => [(node, key, [(edge, key)])] -> (Graph edge, Vertex -> (node, key, [(edge, key)]))
- buildG :: Bounds -> [Edge e] -> Graph e
- transposeG :: Graph e -> Graph e
- vertices :: Graph e -> [Vertex]
- edges :: Graph e -> [Edge e]
- forgetLabels :: Graph e -> Graph
- topSort :: Graph e -> [Vertex]
Graphs
Building graphs
graphFromEdges :: forall key node edge. Ord key => [(node, key, [(edge, key)])] -> (Graph edge, Vertex -> (node, key, [(edge, key)]), key -> Maybe Vertex) Source #
Construct an edge-labeled graph
This is a simple adaptation of the definition in Data.Graph
graphFromEdges' :: Ord key => [(node, key, [(edge, key)])] -> (Graph edge, Vertex -> (node, key, [(edge, key)])) Source #
transposeG :: Graph e -> Graph e Source #
Graph properties
Operations on the underlying unlabeled graph
forgetLabels :: Graph e -> Graph Source #