Click or drag to resize

DepthFirstSearch Class

Class for performing a depth first search on a graph.

It returns a number of properties of the graph

Inheritance Hierarchy
SystemObject
  DHI.Mike1D.Generic.GraphDepthFirstSearch

Namespace:  DHI.Mike1D.Generic.Graph
Assembly:  DHI.Mike1D.Generic (in DHI.Mike1D.Generic.dll) Version: 19.0.0.0 (11.1.1.1111)
Syntax
public class DepthFirstSearch

The DepthFirstSearch type exposes the following members.

Constructors
  NameDescription
Public methodDepthFirstSearch
Default constructor
Top
Properties
  NameDescription
Public propertyAllowCyclicGraph
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.
Public propertyDiscovered
An integer describing the step in the depth first search tree where each vertex was discovered.
Public propertyFinished
An integer describing the step in the depth first search tree where each vertex was finished.
Public propertyNumberOfCrossTreeConnections
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.

Public propertyNumberOfCycles
Returns the number of cycles identified in the graph.

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

Public propertyNumberOfIndependentSubgraphs
Returns the number of independent subgraphs in the graph, i.e. graphs that does not connect to each other in any way
Public propertyNumberOfPredecessorTrees
Returns the number predecessor trees in the predecessor forest, i.e. the number of -1's found in the Predecessors
Public propertyNumberOfSplitJoins
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.

Public propertyPredecessors
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.

Top
Methods
  NameDescription
Public methodEquals
Determines whether the specified object is equal to the current object.
(Inherited from Object.)
Protected methodFinalize
Allows an object to try to free resources and perform other cleanup operations before it is reclaimed by garbage collection.
(Inherited from Object.)
Public methodGetHashCode
Serves as the default hash function.
(Inherited from Object.)
Public methodGetType
Gets the Type of the current instance.
(Inherited from Object.)
Protected methodMemberwiseClone
Creates a shallow copy of the current Object.
(Inherited from Object.)
Public methodStart
Start performing the depth first search
Public methodToString
Returns a string that represents the current object.
(Inherited from Object.)
Top
Events
  NameDescription
Public eventDiscoveredEvent
Event fired when a vertex is discovered
Public eventFinishedEvent
Event fired when a vertex is finished
Top
See Also