Class TSProblem
The default TSP profile definition.
Inheritance
System.Object
TSProblem
Inherited Members
System.Object.ToString()
System.Object.Equals(System.Object)
System.Object.Equals(System.Object, System.Object)
System.Object.ReferenceEquals(System.Object, System.Object)
System.Object.GetHashCode()
System.Object.GetType()
System.Object.MemberwiseClone()
Namespace: System.Dynamic.ExpandoObject
Assembly: cs.temp.dll.dll
Syntax
public sealed class TSProblem
Constructors
TSProblem(Int32, Int32, Single[][])
Creates a new TSP, 'closed' when first equals last.
Declaration
public TSProblem(int first, int last, float[][] weights)
Parameters
|
System.Int32
first
|
|
System.Int32
last
|
|
System.Single[][]
weights
|
TSProblem(Int32, Single[][])
Creates a new TSP 'open' TSP with only a start customer.
Declaration
public TSProblem(int first, float[][] weights)
Parameters
|
System.Int32
first
|
|
System.Single[][]
weights
|
Properties
First
Gets the first customer.
Declaration
public int First { get; set; }
Property Value
|
System.Int32
|
Last
Gets the last customer if the problem is closed.
Declaration
public int ? Last { get; set; }
Property Value
|
System.Nullable<System.Int32>
|
Weights
Gets the weights.
Declaration
public float[][] Weights { get; set; }
Property Value
|
System.Single[][]
|
Methods
GetNearestNeighboursBackward(Single, Int32)
Generate the nearest neighbour list.
Declaration
public SortedNearestNeighbours GetNearestNeighboursBackward(float weight, int customer)
Parameters
|
System.Single
weight
|
|
System.Int32
customer
|
Returns
|
SortedNearestNeighbours
|
GetNearestNeighboursForward(Single, Int32)
Generate the nearest neighbour list.
Declaration
public SortedNearestNeighbours GetNearestNeighboursForward(float weight, int customer)
Parameters
|
System.Single
weight
|
|
System.Int32
customer
|
Returns
|
SortedNearestNeighbours
|
GetNNearestNeighboursBackward(Int32, Int32)
Generate the nearest neighbour list.
Declaration
public NearestNeighbours GetNNearestNeighboursBackward(int n, int customer)
Parameters
|
System.Int32
n
|
|
System.Int32
customer
|
Returns
|
NearestNeighbours
|
GetNNearestNeighboursForward(Int32, Int32)
Generate the nearest neighbour list.
Declaration
public NearestNeighbours GetNNearestNeighboursForward(int n, int customer)
Parameters
|
System.Int32
n
|
|
System.Int32
customer
|
Returns
|
NearestNeighbours
|
Solve()
Solves this TSP using a default solver.
Declaration
public Tour Solve()
Returns
|
Tour
|
Solve(ISolver<Single, TSProblem, TSPObjective, Tour, Single>)
Solvers this problem using the given solver.
Declaration
public Tour Solve(ISolver<float, TSProblem, TSPObjective, Tour, float> solver)
Parameters
|
ISolver<System.Single, TSProblem, TSPObjective, Tour, System.Single>
solver
|
Returns
|
Tour
|
ToClosed()
Converts this problem to it's closed equivalent.
Declaration
public TSProblem ToClosed()
Returns
|
TSProblem
|