Safe Haskell | None |
---|---|
Language | Haskell2010 |
Data structures to represent Directed Acyclic Graphs (DAGs).
- newtype VertexId = VertexId {}
- data Edge e = Edge {}
- data Vertex v = Vertex {
- vertexId :: !VertexId
- vertexData :: !v
- data VertexEdge e v = VertexEdge {
- veEndVertex :: !(Vertex v)
- veEdge :: !(Edge e)
- type AdjacencyMap v e = Map VertexId (Vector (VertexEdge e v))
- data Graph v e = Graph {
- gEdges :: !(AdjacencyMap v e)
- gVertices :: !(Vector (Vertex v))
- class GraphVertexOperations v where
- class GraphVertexOperations v => GraphOperations v e where
Documentation
The unique ID of a vertex.
An edge in a graph, parametrized by some payload.
A vertex in a graph, parametrized by some payload.
Vertex | |
|
data VertexEdge e v Source #
An edge, along with its end node.
VertexEdge | |
|
type AdjacencyMap v e = Map VertexId (Vector (VertexEdge e v)) Source #
The adjacency map of a graph.
The node Id corresponds to the start node, the pairs are the end node and and the edge to reach to the node. There may be multiple edges leading to the same node.
The representation of a graph.
In all the project, it is considered as a DAG.
class GraphVertexOperations v where Source #
Graph operations on types that are supposed to represent vertices.
vertexToId :: v -> VertexId Source #
expandVertexAsVertices :: v -> [v] Source #
class GraphVertexOperations v => GraphOperations v e where Source #
Graph operations on types that are supposed to represent edges.
expandVertex :: v -> [(e, v)] Source #