Performs a customizable depth-first search (DFS).
More...
Inherited by Satsuma.Bipartition.MyDfs, Satsuma.ConnectedComponents.MyDfs, Satsuma.FindPathExtensions.PathDfs, Satsuma.LowpointDfs, Satsuma.NetworkSimplex.RecalculatePotentialDfs, Satsuma.NetworkSimplex.UpdatePotentialDfs, Satsuma.StrongComponents.BackwardDfs, Satsuma.StrongComponents.ForwardDfs, and Satsuma.TopologicalOrder.MyDfs.
Performs a customizable depth-first search (DFS).
Definition at line 32 of file Dfs.cs.
Enumerator |
---|
Undirected |
The Dfs treats each arc as bidirectional.
|
Forward |
The Dfs respects the orientation of each arc.
|
Backward |
The Dfs runs on the reverse graph.
|
Definition at line 34 of file Dfs.cs.
virtual bool Satsuma.Dfs.BackArc |
( |
Node |
node, |
|
|
Arc |
arc |
|
) |
| |
|
protectedvirtual |
Called when encountering a non-forest arc pointing to an already visited node (this includes loop arcs).
- Parameters
-
node | The node being processed by the Dfs. |
arc | The non-forest arc encountered. |
- Returns
true
if the traversal should continue.
Definition at line 127 of file Dfs.cs.
virtual bool Satsuma.Dfs.NodeEnter |
( |
Node |
node, |
|
|
Arc |
arc |
|
) |
| |
|
protectedvirtual |
Called when entering a node through an arc.
- Parameters
-
node | The node being entered. |
arc | The arc connecting the node to its parent in the Dfs forest, or Arc.Invalid if the node is a root. |
- Returns
true
if the traversal should continue.
Definition at line 113 of file Dfs.cs.
virtual bool Satsuma.Dfs.NodeExit |
( |
Node |
node, |
|
|
Arc |
arc |
|
) |
| |
|
protectedvirtual |
Called when exiting a node and going back through an arc.
- Parameters
-
node | The node being exited. |
arc | The arc connecting the node to its parent in the Dfs forest, or Arc.Invalid if the node is a root. |
- Returns
true
if the traversal should continue.
Definition at line 120 of file Dfs.cs.
void Satsuma.Dfs.Run |
( |
IGraph |
graph, |
|
|
IEnumerable< Node > |
roots = null |
|
) |
| |
Runs the depth-first search.
Can be called an arbitrary number of times.
- Parameters
-
graph | The input graph. |
roots | The roots where the search should start, or null if all the graph nodes should be considered. |
Definition at line 55 of file Dfs.cs.
abstract void Satsuma.Dfs.Start |
( |
out Direction |
direction | ) |
|
|
protectedpure virtual |
Called before starting the search.
virtual void Satsuma.Dfs.StopSearch |
( |
| ) |
|
|
protectedvirtual |
Called after finishing the search.
Definition at line 130 of file Dfs.cs.
The level of the current node (starting from zero).
Definition at line 49 of file Dfs.cs.
The documentation for this class was generated from the following file: