Modulefgl-5.8.2.0Haskell98
Data.Graph.Inductive.Query.DFS
Depth-first search algorithms.
Names consist of:
An optional direction parameter, specifying which nodes to visit next.
uundirectional: ignore edge direction
rreversed: walk edges in reverse
xuser defined: speciy which paths to follow
"df" for depth-first
A structure parameter, specifying the type of the result.
sFlat list of results
fStructured
of results
An optional "With", which instead of putting the found nodes directly into the result, adds the result of a computation on them into it.
An optional prime character, in which case all nodes of the graph will be visited, instead of a user-given subset.
- 1 type
- 31 values
- Packagefgl-5.8.2.0
- Exports32
- LanguageHaskell98
- LicenceBSD-3-Clause
- SourceDFS.hs
Standard
11 declarationsDepth-first search.
Directed depth-first forest.
xdfsWith Discard the graph part of the result of xdfWith.
xdffWith d f vs g = fst (xdfWith d f vs g)
Undirected
6 declarationsUndirected depth-first search, obtained by following edges regardless of their direction.
Undirected depth-first forest, obtained by following edges regardless of their direction.
Reversed
6 declarationsReverse depth-first forest, obtained by following predecessors.
Reverse depth-first search, obtained by following predecessors.
Applications of depth first search/forest
4 declarationsTopological sorting, i.e. a list of Nodes so that if there's an edge between a source and a target node, the source appears earlier in the result.
topsort, returning only the labels of the nodes.
Collection of strongly connected components
Collection of nodes reachable from a starting point.
Applications of undirected depth first search/forest
4 declarationsCollection of connected components
Number of connected components
Is the graph connected?
The condensation of the given graph, i.e., the graph of its strongly connected components.