TopologicalSort Class

Class performing a topological sort of a directed acyclic graph.

A topological sort is a linear ordering of the vertices such that if the graph contains and edge from u to v (v "depends on" u), then u appears before v in the ordering.

If the graph is cyclic, the sort procedure fails with an GraphException.

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 TopologicalSort
Inheritance
Object    TopologicalSort

Constructors

TopologicalSort Create a new Topological sort class performing its sort on the provided graph

Properties

FirstCircularReferenceVertex First vertex which was found to have a circular reference.
NumberOfCycles Returns the number of cycles identified in the graph.

NumberOfCycles > 0 means that topological sort failed.

Order Vertices sorted in topological order. The vector contains vertex indices.

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)
Sort Perform the topological sort.
ToStringReturns a string that represents the current object.
(Inherited from Object)

See Also