Safe Haskell | Safe |
---|---|

Language | Haskell2010 |

- newtype UGraph v e = UGraph {}
- 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
- removeEdge' :: (Hashable v, Eq v) => (v, v) -> 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
- containsEdge' :: (Hashable v, Eq v) => UGraph v e -> (v, v) -> Bool
- incidentEdges :: (Hashable v, Eq v) => UGraph v e -> v -> [Edge v e]
- toList :: (Hashable v, Eq v) => UGraph v e -> [Edge v e]
- fromList :: (Hashable v, Eq v) => [Edge v e] -> UGraph v e

# Documentation

Undirected Graph of Vertices in *v* and Edges with attributes in *e*

Graph UGraph Source # | |

(Eq e, Eq v) => Eq (UGraph v e) Source # | |

(Hashable v, Eq v, Read v, Read e) => Read (UGraph v e) Source # | |

(Hashable v, Eq v, Show v, Show e) => Show (UGraph v e) Source # | |

Generic (UGraph v e) Source # | |

(Arbitrary v, Arbitrary e, Hashable v, Num v, Ord v) => Arbitrary (UGraph v e) Source # | |

(NFData v, NFData e) => NFData (UGraph v e) Source # | |

type Rep (UGraph v e) Source # | |

insertEdges :: (Hashable v, Eq v) => [Edge v e] -> UGraph v e -> UGraph v e Source #

`O(m*log n)`

Insert many directed `Edge`

s into a `UGraph`

| Same rules as `insertEdge`

are applied

removeEdge' :: (Hashable v, Eq v) => (v, v) -> UGraph v e -> UGraph v e Source #

Same as `removeEdge`

but the edge is an unordered pair

containsEdge :: (Hashable v, Eq v) => UGraph v e -> Edge v e -> Bool Source #

`O(log n)`

Tell if an undirected `Edge`

exists in the graph

containsEdge' :: (Hashable v, Eq v) => UGraph v e -> (v, v) -> Bool Source #

Same as `containsEdge`

but the edge is an unordered pair

incidentEdges :: (Hashable v, Eq v) => UGraph v e -> v -> [Edge v e] Source #

Retrieve the incident `Edge`

s of a Vertex