ghc-7.8.4: The GHC API

Safe HaskellNone
LanguageHaskell98

Digraph

Synopsis

Documentation

data Graph node Source

Instances

Outputable node => Outputable (Graph node) 

graphFromVerticesAndAdjacency :: Ord key => [(node, key)] -> [(key, key)] -> Graph (node, key) Source

graphFromEdgedVertices :: Ord key => [Node key payload] -> Graph (Node key payload) Source

data SCC vertex Source

Constructors

AcyclicSCC vertex 
CyclicSCC [vertex] 

Instances

type Node key payload = (payload, key, [key]) Source

flattenSCC :: SCC a -> [a] Source

flattenSCCs :: [SCC a] -> [a] Source

stronglyConnCompG :: Graph node -> [SCC node] Source

topologicalSortG :: Graph node -> [node] Source

dfsTopSortG :: Graph node -> [[node]] Source

verticesG :: Graph node -> [node] Source

edgesG :: Graph node -> [Edge node] Source

hasVertexG :: Graph node -> node -> Bool Source

reachableG :: Graph node -> node -> [node] Source

reachablesG :: Graph node -> [node] -> [node] Source

transposeG :: Graph node -> Graph node Source

outdegreeG :: Graph node -> node -> Maybe Int Source

indegreeG :: Graph node -> node -> Maybe Int Source

vertexGroupsG :: Graph node -> [[node]] Source

emptyG :: Graph node -> Bool Source

componentsG :: Graph node -> [[node]] Source

findCycle :: forall payload key. Ord key => [Node key payload] -> Maybe [payload] Source

Find a reasonably short cycle a->b->c->a, in a strongly connected component. The input nodes are presumed to be a SCC, so you can start anywhere.

stronglyConnCompFromEdgedVertices :: Ord key => [Node key payload] -> [SCC payload] Source

stronglyConnCompFromEdgedVerticesR :: Ord key => [Node key payload] -> [SCC (Node key payload)] Source

tabulate :: Bounds -> [Vertex] -> Table Int Source

preArr :: Bounds -> Forest Vertex -> Table Int Source

components :: IntGraph -> Forest Vertex Source

undirected :: IntGraph -> IntGraph Source

back :: IntGraph -> Table Int -> IntGraph Source

cross :: IntGraph -> Table Int -> Table Int -> IntGraph Source

forward :: IntGraph -> IntGraph -> Table Int -> IntGraph Source

path :: IntGraph -> Vertex -> Vertex -> Bool Source

bcc :: IntGraph -> Forest [Vertex] Source

do_label :: IntGraph -> Table Int -> Tree Vertex -> Tree (Vertex, Int, Int) Source

bicomps :: Tree (Vertex, Int, Int) -> Forest [Vertex] Source

collect :: Tree (Vertex, Int, Int) -> (Int, Tree [Vertex]) Source