Class TopologicalSortAlgorithm<TVertex, TEdge>
Topological sort algorithm (can be performed on an acyclic graph).
Inheritance
System.Object
AlgorithmBase<IVertexListGraph<TVertex, TEdge>>
TopologicalSortAlgorithm<TVertex, TEdge>
Inherited Members
System.Object.Equals(System.Object)
System.Object.Equals(System.Object, System.Object)
System.Object.GetHashCode()
System.Object.GetType()
System.Object.MemberwiseClone()
System.Object.ReferenceEquals(System.Object, System.Object)
System.Object.ToString()
Namespace: QuikGraph.Algorithms.TopologicalSort
Assembly: QuikGraph.dll
Syntax
public sealed class TopologicalSortAlgorithm<TVertex, TEdge> : AlgorithmBase<IVertexListGraph<TVertex, TEdge>>, IAlgorithm<IVertexListGraph<TVertex, TEdge>>, IComputation, IAlgorithmComponent, IVertexTimeStamperAlgorithm<TVertex> where TEdge : IEdge<TVertex>
Type Parameters
Name | Description |
---|---|
TVertex | Vertex type. |
TEdge | Edge type. |
Constructors
| Improve this Doc View SourceTopologicalSortAlgorithm(IVertexListGraph<TVertex, TEdge>, Int32)
Initializes a new instance of the TopologicalSortAlgorithm<TVertex, TEdge> class.
Declaration
public TopologicalSortAlgorithm(IVertexListGraph<TVertex, TEdge> visitedGraph, int capacity = -1)
Parameters
Type | Name | Description |
---|---|---|
IVertexListGraph<TVertex, TEdge> | visitedGraph | Graph to visit. |
System.Int32 | capacity | Sorted vertices capacity. |
Exceptions
Type | Condition |
---|---|
System.ArgumentNullException |
|
Properties
| Improve this Doc View SourceSortedVertices
Sorted vertices.
Declaration
public TVertex[] SortedVertices { get; }
Property Value
Type | Description |
---|---|
TVertex[] |
Remarks
It is null if the algorithm has not been run yet.
Methods
| Improve this Doc View SourceInitialize()
Called on algorithm initialization step.
Declaration
protected override void Initialize()
Overrides
QuikGraph.Algorithms.AlgorithmBase<QuikGraph.IVertexListGraph<TVertex, TEdge>>.Initialize()
|
Improve this Doc
View Source
InternalCompute()
Algorithm compute step.
Declaration
protected override void InternalCompute()
Overrides
QuikGraph.Algorithms.AlgorithmBase<QuikGraph.IVertexListGraph<TVertex, TEdge>>.InternalCompute()
Events
| Improve this Doc View SourceDiscoverVertex
Fired when a vertex is discovered.
Declaration
public event VertexAction<TVertex> DiscoverVertex
Event Type
Type | Description |
---|---|
VertexAction<TVertex> |
FinishVertex
Fired when a vertex is fully treated.
Declaration
public event VertexAction<TVertex> FinishVertex
Event Type
Type | Description |
---|---|
VertexAction<TVertex> |