Hoogle Search
Within LTS Haskell 24.70 (ghc-9.10.3)
Note that Stackage only displays results for the latest LTS and Nightly snapshot. Learn more.
edgeSet :: Eq a => AdjacencyMap a -> Set (a, a)algebraic-graphs Algebra.Graph.AdjacencyMap The set of edges of a given graph. Complexity: O((n + m) * log(m)) time and O(m) memory.
edgeSet empty == Set.empty edgeSet (vertex x) == Set.empty edgeSet (edge x y) == Set.singleton (x,y) edgeSet . edges == Set.fromList
fromAdjacencySets :: Ord a => [(a, Set a)] -> AdjacencyMap aalgebraic-graphs Algebra.Graph.AdjacencyMap Construct a graph from a list of adjacency sets; a variation of stars. Complexity: O((n + m) * log(n)) time and O(n + m) memory.
fromAdjacencySets [] == empty fromAdjacencySets [(x, Set.empty)] == vertex x fromAdjacencySets [(x, Set.singleton y)] == edge x y fromAdjacencySets . map (fmap Set.fromList) == stars overlay (fromAdjacencySets xs) (fromAdjacencySets ys) == fromAdjacencySets (xs ++ ys)
postSet :: Ord a => a -> AdjacencyMap a -> Set aalgebraic-graphs Algebra.Graph.AdjacencyMap The postset of a vertex is the set of its direct successors. Complexity: O(log(n)) time and O(1) memory.
postSet x empty == Set.empty postSet x (vertex x) == Set.empty postSet x (edge x y) == Set.fromList [y] postSet 2 (edge 1 2) == Set.empty
preSet :: Ord a => a -> AdjacencyMap a -> Set aalgebraic-graphs Algebra.Graph.AdjacencyMap The preset of an element x is the set of its direct predecessors. Complexity: O(n * log(n)) time and O(n) memory.
preSet x empty == Set.empty preSet x (vertex x) == Set.empty preSet 1 (edge 1 2) == Set.empty preSet y (edge x y) == Set.fromList [x]
vertexSet :: AdjacencyMap a -> Set aalgebraic-graphs Algebra.Graph.AdjacencyMap The set of vertices of a given graph. Complexity: O(n) time and memory.
vertexSet empty == Set.empty vertexSet . vertex == Set.singleton vertexSet . vertices == Set.fromList
edgeSet :: (Ord a, Ord b) => AdjacencyMap a b -> Set (a, b)algebraic-graphs Algebra.Graph.Bipartite.AdjacencyMap The set of edges of a graph. Complexity: O(n + m) time and O(m) memory.
edgeSet empty == Set.empty edgeSet (vertex x) == Set.empty edgeSet (edge x y) == Set.singleton (x,y) edgeSet . edges == Set.fromList
leftVertexSet :: AdjacencyMap a b -> Set aalgebraic-graphs Algebra.Graph.Bipartite.AdjacencyMap The set of vertices of the left part of a graph. Complexity: O(l) time and memory.
leftVertexSet empty == Set.empty leftVertexSet . leftVertex == Set.singleton leftVertexSet . rightVertex == const Set.empty leftVertexSet . flip vertices [] == Set.fromList
rightVertexSet :: AdjacencyMap a b -> Set balgebraic-graphs Algebra.Graph.Bipartite.AdjacencyMap The set of vertices of the right part of a graph. Complexity: O(r) time and memory.
rightVertexSet empty == Set.empty rightVertexSet . leftVertex == const Set.empty rightVertexSet . rightVertex == Set.singleton rightVertexSet . vertices [] == Set.fromList
vertexSet :: (Ord a, Ord b) => AdjacencyMap a b -> Set (Either a b)algebraic-graphs Algebra.Graph.Bipartite.AdjacencyMap The set of vertices of a graph. Complexity: O(n) time and memory.
vertexSet empty == Set.empty vertexSet . vertex == Set.singleton vertexSet (edge x y) == Set.fromList [Left x, Right y] vertexSet (vertices (lefts xs) (rights xs)) == Set.fromList xs
type
IndependentSet a b = (Set a, Set b)algebraic-graphs Algebra.Graph.Bipartite.AdjacencyMap.Algorithm An independent set of a bipartite graph. An independent set is a subset of vertices such that no two of them are adjacent. We represent independent sets by storing two sets of vertices, one for each part. An equivalent representation, which is slightly less memory efficient, is Set (Either a b).