Click or drag to resize

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.

Inheritance Hierarchy
SystemObject
  DHI.Mike1D.Generic.GraphTopologicalSort

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 TopologicalSort

The TopologicalSort type exposes the following members.

Constructors
  NameDescription
Public methodTopologicalSort
Create a new Topological sort class performing its sort on the provided graph
Top
Properties
  NameDescription
Public propertyFirstCircularReferenceVertex
First vertex which was found to have a circular reference.
Public propertyNumberOfCycles
Returns the number of cycles identified in the graph.

NumberOfCycles > 0 means that topological sort failed.

Public propertyOrder
Vertices sorted in topological order. The vector contains vertex indices.
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 methodSort
Perform the topological sort.
Public methodToString
Returns a string that represents the current object.
(Inherited from Object.)
Top
See Also