Safe Haskell | None |
---|---|
Language | Haskell2010 |
- findRootPaths :: Graph gr => gr n e -> Context n e -> (Node, [[Node]])
- findRootPathsBy :: Graph gr => (Context n e -> a) -> gr n e -> Context n e -> (a, [[a]])
- treeRootStatefulBy :: Graph gr => (st -> Context n e -> (a, st)) -> st -> gr n e -> Context n e -> Tree (a, st)
- cyclesOfGraph :: Graph gr => gr n l -> [[LNode n]]
- cyclicSubgraphs :: forall gr n e. (DynGraph gr, Ord n, Ord e) => gr n e -> [gr n e]
- hasSome :: [a] -> Bool
- hasSome' :: [Context n l] -> Bool
- buildFromNodes :: (DynGraph gr, Foldable t) => t a -> gr a ()
- topsortWithCycles :: (Graph gr, Ord a) => gr a b -> [Either [a] a]
- treeToPaths :: Tree a -> [[a]]
- edgeyTopsort :: Graph gr => gr n e -> Maybe [(n, e)]
- unvalidatedEdgeyTopsort :: Graph gr => gr n e -> [(n, e)]
Documentation
cyclesOfGraph :: Graph gr => gr n l -> [[LNode n]] Source #
cyclicSubgraphs :: forall gr n e. (DynGraph gr, Ord n, Ord e) => gr n e -> [gr n e] Source #
Given a graph, generate a possibly empty list of subgraphs that are the it's cycles.
hasSome' :: [Context n l] -> Bool Source #
Returns true if a list of contexts has more than one element or a loop in it's only element.
buildFromNodes :: (DynGraph gr, Foldable t) => t a -> gr a () Source #
Build a graph with no edges from a foldable container of node values.
topsortWithCycles :: (Graph gr, Ord a) => gr a b -> [Either [a] a] Source #
A version of topsort that returns cycles as groups rather than incorperating them into it's result arbitrarily.
It's result is a list of eithers, with Left values representing cycles and Right values as nodes not within a cycle, in an order similar to what is given by a regular topsort.
treeToPaths :: Tree a -> [[a]] Source #
Convert a tree into a list of all of it's paths.
edgeyTopsort :: Graph gr => gr n e -> Maybe [(n, e)] Source #
Build a topsort inclusive of outward edges. Nodes without outward edges are ignored.
If there are cycles in the graph, Nothing is returned.
unvalidatedEdgeyTopsort :: Graph gr => gr n e -> [(n, e)] Source #
edgeyTopsort
but doesn't check for cycles first.