Modulefgl-5.8.3.1Haskell98
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.
Contents
Synopsis
- type CFun
- value dfs
- value dfs'
- value dff
- value dff'
- value dfsWith
- value dfsWith'
- value dffWith
- value dffWith'
- value xdfsWith
- value xdfWith
- value xdffWith
- value udfs
- value udfs'
- value udff
- value udff'
- value udffWith
- value udffWith'
- value rdff
- value rdff'
- value rdfs
- value rdfs'
- value rdffWith
- value rdffWith'
- value topsort
- value topsort'
- value scc
- value reachable
- value components
- value noComponents
- value isConnected
- value condensation
- Packagefgl-5.8.3.1
- Exports32
- LanguageHaskell98
- LicenceBSD-3-Clause
- SourceDFS.hs
Standard
Depth-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
Undirected depth-first search, obtained by following edges regardless of their direction.
Undirected depth-first forest, obtained by following edges regardless of their direction.
Reversed
Reverse depth-first forest, obtained by following predecessors.
Reverse depth-first search, obtained by following predecessors.
Applications of depth first search/forest
Topological 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
Collection 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.