Safe Haskell | Safe |
---|---|
Language | Haskell2010 |
Synopsis
- data UGraph v e
- insertEdge :: (Hashable v, Eq v) => Edge v e -> UGraph v e -> UGraph v e
- insertEdges :: (Hashable v, Eq v) => [Edge v e] -> UGraph v e -> UGraph v e
- removeEdge :: (Hashable v, Eq v) => Edge v e -> UGraph v e -> UGraph v e
- removeEdges :: (Hashable v, Eq v) => [Edge v e] -> UGraph v e -> UGraph v e
- removeEdgeAndVertices :: (Hashable v, Eq v) => Edge v e -> UGraph v e -> UGraph v e
- edges :: forall v e. (Hashable v, Eq v) => UGraph v e -> [Edge v e]
- containsEdge :: (Hashable v, Eq v) => UGraph v e -> Edge v e -> Bool
- incidentEdges :: (Hashable v, Eq v) => UGraph v e -> v -> [Edge v e]
- toEdgesList :: (Hashable v, Eq v) => UGraph v e -> [Edge v e]
- fromEdgesList :: (Hashable v, Eq v) => [Edge v e] -> UGraph v e
- prettyPrint :: (Hashable v, Eq v, Show v, Show e) => UGraph v e -> String
UGraph data type
Undirected Graph of Vertices in v and Edges with attributes in e
Instances
Functions on UGraph
insertEdges :: (Hashable v, Eq v) => [Edge v e] -> UGraph v e -> UGraph v e Source #
Same as insertEdge
but for a list of Edge
s
removeEdges :: (Hashable v, Eq v) => [Edge v e] -> UGraph v e -> UGraph v e Source #
Same as removeEdge
but for a list of Edge
s
containsEdge :: (Hashable v, Eq v) => UGraph v e -> Edge v e -> Bool Source #
Tell if an undirected Edge
exists in the graph
incidentEdges :: (Hashable v, Eq v) => UGraph v e -> v -> [Edge v e] Source #
Retrieve the incident Edge
s of a Vertex
List conversions
toEdgesList :: (Hashable v, Eq v) => UGraph v e -> [Edge v e] Source #
Convert a UGraph
to a list of Edge
s discarding isolated vertices
Note that because toEdgesList
discards isolated vertices:
> fromEdgesList . toEdgesList /= id