Safe Haskell | None |
---|---|
Language | Haskell2010 |
This graph implementation is a directed (multi-)graph that only tracks successors. This encoding is very compact. It is a multi-graph because it allows parallel edges between vertices. If you require only simple graphs, careful edge insertion is required (or another graph type might be more appropriate).
Limitations:
- Removing nodes and edges is not currently possible.
- Predecessors are not accessible
- Edge existence tests are linear in the number of edges for the source node.
Documentation
This is a compact (mutable) directed graph.
Instances
MAddEdge MDigraph Source # | |
MAddVertex MDigraph Source # | |
MGraph MDigraph Source # | |
Defined in Data.Graph.Haggle.Digraph type ImmutableGraph MDigraph Source # getVertices :: (PrimMonad m, MonadRef m) => MDigraph m -> m [Vertex] Source # getSuccessors :: (PrimMonad m, MonadRef m) => MDigraph m -> Vertex -> m [Vertex] Source # getOutEdges :: (PrimMonad m, MonadRef m) => MDigraph m -> Vertex -> m [Edge] Source # countVertices :: (PrimMonad m, MonadRef m) => MDigraph m -> m Int Source # countEdges :: (PrimMonad m, MonadRef m) => MDigraph m -> m Int Source # checkEdgeExists :: (PrimMonad m, MonadRef m) => MDigraph m -> Vertex -> Vertex -> m Bool Source # freeze :: (PrimMonad m, MonadRef m) => MDigraph m -> m (ImmutableGraph MDigraph) Source # | |
type ImmutableGraph MDigraph Source # | |
Defined in Data.Graph.Haggle.Digraph |
Instances
NFData Digraph Source # | The |
Defined in Data.Graph.Haggle.Digraph | |
Thawable Digraph Source # | |
Graph Digraph Source # | |
Defined in Data.Graph.Haggle.Digraph vertices :: Digraph -> [Vertex] Source # edges :: Digraph -> [Edge] Source # successors :: Digraph -> Vertex -> [Vertex] Source # outEdges :: Digraph -> Vertex -> [Edge] Source # maxVertexId :: Digraph -> Int Source # isEmpty :: Digraph -> Bool Source # edgesBetween :: Digraph -> Vertex -> Vertex -> [Edge] Source # | |
type MutableGraph Digraph Source # | |
Defined in Data.Graph.Haggle.Digraph |