Class TSP<TVertex, TEdge, TGraph>
Algorithm to answer the TSP (Travelling Salesman Problem), meaning finding a path that best link every vertices.
Inheritance
System.Object
AlgorithmBase<TGraph>
RootedAlgorithmBase<TVertex, TGraph>
ShortestPathAlgorithmBase<TVertex, TEdge, TGraph>
TSP<TVertex, TEdge, TGraph>
Implements
IAlgorithm<TGraph>
IVertexColorizerAlgorithm<TVertex>
ITreeBuilderAlgorithm<TVertex, TEdge>
IDistancesCollection<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.TSP
Assembly: QuikGraph.dll
Syntax
public class TSP<TVertex, TEdge, TGraph> : ShortestPathAlgorithmBase<TVertex, TEdge, TGraph>, IAlgorithm<TGraph>, IComputation, IAlgorithmComponent, IVertexColorizerAlgorithm<TVertex>, ITreeBuilderAlgorithm<TVertex, TEdge>, IDistancesCollection<TVertex> where TEdge : EquatableEdge<TVertex> where TGraph : BidirectionalGraph<TVertex, TEdge>
Type Parameters
Name | Description |
---|---|
TVertex | Vertex type. |
TEdge | Edge type. |
TGraph | Graph type. |
Constructors
| Improve this Doc View SourceTSP(TGraph, Func<TEdge, Double>)
Initializes a new instance of the TSP<TVertex, TEdge, TGraph> class.
Declaration
public TSP(TGraph visitedGraph, Func<TEdge, double> edgeWeights)
Parameters
Type | Name | Description |
---|---|---|
TGraph | 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 |
|
Properties
| Improve this Doc View SourceBestCost
Best cost found to answer the problem.
Declaration
public double BestCost { get; }
Property Value
Type | Description |
---|---|
System.Double |
ResultPath
Shortest path found, otherwise null.
Declaration
public BidirectionalGraph<TVertex, TEdge> ResultPath { get; }
Property Value
Type | Description |
---|---|
BidirectionalGraph<TVertex, TEdge> |
Methods
| Improve this Doc View SourceInitialize()
Called on algorithm initialization step.
Declaration
protected override void Initialize()
Overrides
QuikGraph.Algorithms.ShortestPath.ShortestPathAlgorithmBase<TVertex, TEdge, TGraph>.Initialize()
|
Improve this Doc
View Source
InternalCompute()
Algorithm compute step.
Declaration
protected override void InternalCompute()
Overrides
QuikGraph.Algorithms.AlgorithmBase<TGraph>.InternalCompute()