Copyright | (c) Martin Erwig Christian Maeder and Uni Bremen 1999-2006 |
---|---|
License | GPLv2 or higher, see LICENSE.txt |
Maintainer | Christian.Maeder@dfki.de |
Stability | provisional |
Portability | portable |
Safe Haskell | Safe |
Common.Lib.Graph
Description
Tree-based implementation of Graph
and DynGraph
using Data.IntMap
instead of Data.Graph.Inductive.Internal.FiniteMap
- newtype Gr a b = Gr {
- convertToMap :: IntMap (GrContext a b)
- data GrContext a b = GrContext {}
- unsafeConstructGr :: IntMap (GrContext a b) -> Gr a b
- decomposeGr :: Node -> Gr a b -> Maybe (GrContext a b, Gr a b)
- getPaths :: Node -> Gr a b -> [[LEdge b]]
- getAllPathsTo :: Node -> Gr a b -> [[LEdge b]]
- getPathsTo :: Node -> Node -> Gr a b -> [[LEdge b]]
- getLEdges :: Node -> Node -> Gr a b -> [b]
- delLEdge :: (b -> b -> Ordering) -> LEdge b -> Gr a b -> Gr a b
- insLEdge :: Bool -> (b -> b -> Ordering) -> LEdge b -> Gr a b -> (Gr a b, Bool)
- delLNode :: (a -> a -> Bool) -> LNode a -> Gr a b -> Gr a b
- labelNode :: LNode a -> Gr a b -> (Gr a b, a)
- getNewNode :: Gr a b -> Node
- rmIsolated :: Gr a b -> Gr a b
Documentation
the graph type constructor
Constructors
Gr | |
Fields
|
Constructors
GrContext | |
unsafeConstructGr :: IntMap (GrContext a b) -> Gr a b Source #
getPaths :: Node -> Gr a b -> [[LEdge b]] Source #
compute the possible cycle free paths from a start node
getAllPathsTo :: Node -> Gr a b -> [[LEdge b]] Source #
compute the possible cycle free reversed paths from a start node
getPathsTo :: Node -> Node -> Gr a b -> [[LEdge b]] Source #
compute the possible cycle free paths from a start node to a target node.
delLEdge :: (b -> b -> Ordering) -> LEdge b -> Gr a b -> Gr a b Source #
delete a labeled edge from a graph
insLEdge :: Bool -> (b -> b -> Ordering) -> LEdge b -> Gr a b -> (Gr a b, Bool) Source #
insert a labeled edge into a graph, returns False if edge exists
labelNode :: LNode a -> Gr a b -> (Gr a b, a) Source #
sets the node with new label and returns the new graph and the old label
getNewNode :: Gr a b -> Node Source #
returns one new node id for the given graph
rmIsolated :: Gr a b -> Gr a b Source #
remove isolated nodes without edges