Class DagShortestPathAlgorithm<TVertex, TEdge>
A single source shortest path algorithm for directed acyclic graphs.
Inheritance
Implements
Inherited Members
Namespace: QuikGraph.Algorithms.ShortestPath
Assembly: QuikGraph.dll
Syntax
public sealed class DagShortestPathAlgorithm<TVertex, TEdge> : ShortestPathAlgorithmBase<TVertex, TEdge, IVertexListGraph<TVertex, TEdge>>, IAlgorithm<IVertexListGraph<TVertex, TEdge>>, IComputation, IAlgorithmComponent, IVertexColorizerAlgorithm<TVertex>, IDistancesCollection<TVertex>, IDistanceRecorderAlgorithm<TVertex>, IVertexPredecessorRecorderAlgorithm<TVertex, TEdge>, ITreeBuilderAlgorithm<TVertex, TEdge> where TEdge : IEdge<TVertex>
Type Parameters
Name | Description |
---|---|
TVertex | Vertex type. |
TEdge | Edge type. |
Constructors
| Improve this Doc View SourceDagShortestPathAlgorithm(IAlgorithmComponent, IVertexListGraph<TVertex, TEdge>, Func<TEdge, Double>, IDistanceRelaxer)
Initializes a new instance of the DagShortestPathAlgorithm<TVertex, TEdge> class.
Declaration
public DagShortestPathAlgorithm(IAlgorithmComponent host, IVertexListGraph<TVertex, TEdge> visitedGraph, Func<TEdge, double> edgeWeights, IDistanceRelaxer distanceRelaxer)
Parameters
Type | Name | Description |
---|---|---|
IAlgorithmComponent | host | Host to use if set, otherwise use this reference. |
IVertexListGraph<TVertex, TEdge> | visitedGraph | Graph to visit. |
System.Func<TEdge, System.Double> | edgeWeights | Function that computes the weight for a given edge. |
IDistanceRelaxer | distanceRelaxer | Distance relaxer. |
Exceptions
Type | Condition |
---|---|
System.ArgumentNullException |
|
System.ArgumentNullException |
|
System.ArgumentNullException |
|
DagShortestPathAlgorithm(IVertexListGraph<TVertex, TEdge>, Func<TEdge, Double>)
Initializes a new instance of the DagShortestPathAlgorithm<TVertex, TEdge> class.
Declaration
public DagShortestPathAlgorithm(IVertexListGraph<TVertex, TEdge> visitedGraph, Func<TEdge, double> edgeWeights)
Parameters
Type | Name | Description |
---|---|---|
IVertexListGraph<TVertex, TEdge> | visitedGraph | Graph to visit. |
System.Func<TEdge, System.Double> | edgeWeights | Function that computes the weight for a given edge. |
Exceptions
Type | Condition |
---|---|
System.ArgumentNullException |
|
System.ArgumentNullException |
|
DagShortestPathAlgorithm(IVertexListGraph<TVertex, TEdge>, Func<TEdge, Double>, IDistanceRelaxer)
Initializes a new instance of the DagShortestPathAlgorithm<TVertex, TEdge> class.
Declaration
public DagShortestPathAlgorithm(IVertexListGraph<TVertex, TEdge> visitedGraph, Func<TEdge, double> edgeWeights, IDistanceRelaxer distanceRelaxer)
Parameters
Type | Name | Description |
---|---|---|
IVertexListGraph<TVertex, TEdge> | visitedGraph | Graph to visit. |
System.Func<TEdge, System.Double> | edgeWeights | Function that computes the weight for a given edge. |
IDistanceRelaxer | distanceRelaxer | Distance relaxer. |
Exceptions
Type | Condition |
---|---|
System.ArgumentNullException |
|
System.ArgumentNullException |
|
System.ArgumentNullException |
|
Methods
| Improve this Doc View SourceInitialize()
Called on algorithm initialization step.
Declaration
protected override void Initialize()
Overrides
InternalCompute()
Algorithm compute step.
Declaration
protected override void InternalCompute()
Overrides
Events
| Improve this Doc View SourceDiscoverVertex
Fired when a vertex is discovered.
Declaration
public event VertexAction<TVertex> DiscoverVertex
Event Type
Type | Description |
---|---|
VertexAction<TVertex> |
EdgeNotRelaxed
Fired when relax of an edge does not decrease distance.
Declaration
public event EdgeAction<TVertex, TEdge> EdgeNotRelaxed
Event Type
Type | Description |
---|---|
EdgeAction<TVertex, TEdge> |
ExamineEdge
Fired when an edge is going to be analyzed.
Declaration
public event EdgeAction<TVertex, TEdge> ExamineEdge
Event Type
Type | Description |
---|---|
EdgeAction<TVertex, TEdge> |
ExamineVertex
Fired when a vertex is going to be analyzed.
Declaration
public event VertexAction<TVertex> ExamineVertex
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> |
InitializeVertex
Fired when a vertex is initialized.
Declaration
public event VertexAction<TVertex> InitializeVertex
Event Type
Type | Description |
---|---|
VertexAction<TVertex> |
StartVertex
Fired on a starting vertex once before the start of the search from it.
Declaration
public event VertexAction<TVertex> StartVertex
Event Type
Type | Description |
---|---|
VertexAction<TVertex> |