Class YenShortestPathsAlgorithm<TVertex>
A single-source K-shortest loopless paths algorithm for graphs with non negative edge cost.
Inheritance
System.Object
YenShortestPathsAlgorithm<TVertex>
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.ShortestPath
Assembly: QuikGraph.dll
Syntax
public class YenShortestPathsAlgorithm<TVertex>
Type Parameters
Name | Description |
---|---|
TVertex | Vertex type. |
Constructors
| Improve this Doc View SourceYenShortestPathsAlgorithm(AdjacencyGraph<TVertex, EquatableTaggedEdge<TVertex, Double>>, TVertex, TVertex, Int32, Func<EquatableTaggedEdge<TVertex, Double>, Double>, Func<IEnumerable<YenShortestPathsAlgorithm<TVertex>.SortedPath>, IEnumerable<YenShortestPathsAlgorithm<TVertex>.SortedPath>>)
Initializes a new instance of the YenShortestPathsAlgorithm<TVertex> class.
Declaration
public YenShortestPathsAlgorithm(AdjacencyGraph<TVertex, EquatableTaggedEdge<TVertex, double>> graph, TVertex source, TVertex target, int k, Func<EquatableTaggedEdge<TVertex, double>, double> edgeWeights = null, Func<IEnumerable<YenShortestPathsAlgorithm<TVertex>.SortedPath>, IEnumerable<YenShortestPathsAlgorithm<TVertex>.SortedPath>> filter = null)
Parameters
Type | Name | Description |
---|---|---|
AdjacencyGraph<TVertex, EquatableTaggedEdge<TVertex, System.Double>> | graph | Graph to visit. |
TVertex | source | Source vertex. |
TVertex | target | Target vertex. |
System.Int32 | k | Maximum number of path to search. |
System.Func<EquatableTaggedEdge<TVertex, System.Double>, System.Double> | edgeWeights | Optional function that computes the weight for a given edge. |
System.Func<System.Collections.Generic.IEnumerable<YenShortestPathsAlgorithm.SortedPath<>>, System.Collections.Generic.IEnumerable<YenShortestPathsAlgorithm.SortedPath<>>> | filter | Optional filter of found paths. |
Remarks
System.Double for tag type (edge) which comes from Dijkstra’s algorithm, which is used to get one shortest path.
Exceptions
Type | Condition |
---|---|
System.ArgumentNullException |
|
System.ArgumentNullException |
|
System.ArgumentNullException |
|
System.ArgumentException |
|
System.ArgumentException |
|
System.ArgumentOutOfRangeException |
|
Methods
| Improve this Doc View SourceExecute()
Runs the algorithm.
Declaration
public IEnumerable<YenShortestPathsAlgorithm<TVertex>.SortedPath> Execute()
Returns
Type | Description |
---|---|
System.Collections.Generic.IEnumerable<YenShortestPathsAlgorithm.SortedPath<>> | Found paths. |
Exceptions
Type | Condition |
---|---|
NoPathFoundException | No shortest path was found. |