DepthFirstSearch Class

Class for performing a depth first search on a graph.

It returns a number of properties of the graph

Definition

Namespace: DHI.Mike1D.Generic.Graph
Assembly: DHI.Mike1D.Generic (in DHI.Mike1D.Generic.dll) Version: 24.0.0.0 (11.1.1.1111)
C#
public class DepthFirstSearch
Inheritance
Object    DepthFirstSearch

Constructors

DepthFirstSearch Default constructor

Properties

AllowCyclicGraph Flag specifying whether cyclic graphs are allowed. Default is true. If set to false, and the graph is cyclic, an exception will be thrown during the search.
Discovered An integer describing the step in the depth first search tree where each vertex was discovered.
Finished An integer describing the step in the depth first search tree where each vertex was finished.
NumberOfCrossTreeConnections Returns the number of cross-tree connections, i.e. connections between different predecessor trees.

The number of cross tree connections equals the number of "cross edges" in the graph.

NumberOfCycles Returns the number of cycles identified in the graph.

The number of cycles equals the number of "back edges" in the graph.

NumberOfIndependentSubgraphs Returns the number of independent subgraphs in the graph, i.e. graphs that does not connect to each other in any way
NumberOfPredecessorTrees Returns the number predecessor trees in the predecessor forest, i.e. the number of -1's found in the Predecessors
NumberOfSplitJoins Returns the number of split-join cycles identified in the graph.

The number of split-join cycles equals the number of "forward edges" in the graph.

Predecessors Main output of the depth first search is the predecessor tree forest.

Each root vertex in a predecessor tree returns -1. The remaining vertices return the index of its predecessor in the tree, i.e. Predecessors[4] = 2 means that the index-4 vertex has the index-2 vertex as its predecessor.

Methods

EqualsDetermines whether the specified object is equal to the current object.
(Inherited from Object)
FinalizeAllows an object to try to free resources and perform other cleanup operations before it is reclaimed by garbage collection.
(Inherited from Object)
GetHashCodeServes as the default hash function.
(Inherited from Object)
GetTypeGets the Type of the current instance.
(Inherited from Object)
MemberwiseCloneCreates a shallow copy of the current Object.
(Inherited from Object)
Start Start performing the depth first search
ToStringReturns a string that represents the current object.
(Inherited from Object)

Events

DiscoveredEvent Event fired when a vertex is discovered
FinishedEvent Event fired when a vertex is finished

See Also