Class HillClimbing3OptSolver
A 3-opt solver.
Inheritance
System.Object
HillClimbing3OptSolver
Namespace: System.Dynamic.ExpandoObject
Assembly: cs.temp.dll.dll
Syntax
public sealed class HillClimbing3OptSolver : SolverBase<float, TSProblem, TSPObjective, Tour, float>, IOperator<float, TSProblem, TSPObjective, Tour, float>
Constructors
HillClimbing3OptSolver()
Creates a new solver.
Declaration
public HillClimbing3OptSolver()
HillClimbing3OptSolver(ISolver<Single, TSProblem, TSPObjective, Tour, Single>, Boolean, Boolean)
Creates a new solver.
Declaration
public HillClimbing3OptSolver(ISolver<float, TSProblem, TSPObjective, Tour, float> generator, bool nearestNeighbours, bool dontLook)
Parameters
|
ISolver<System.Single, TSProblem, TSPObjective, Tour, System.Single>
generator
|
|
System.Boolean
nearestNeighbours
|
|
System.Boolean
dontLook
|
Properties
Name
Retuns the name of this solver.
Declaration
public override string Name { get; }
Property Value
|
System.String
|
Methods
Apply(TSProblem, TSPObjective, Tour, out Single)
Returns true if there was an improvement, false otherwise.
Declaration
public bool Apply(TSProblem problem, TSPObjective objective, Tour solution, out float delta)
Parameters
|
TSProblem
problem
|
|
TSPObjective
objective
|
|
Tour
solution
|
|
System.Single
delta
|
Returns
|
System.Boolean
|
Solve(TSProblem, TSPObjective, out Single)
Solves the given problem.
Declaration
public override Tour Solve(TSProblem problem, TSPObjective objective, out float fitness)
Parameters
|
TSProblem
problem
|
|
TSPObjective
objective
|
|
System.Single
fitness
|
Returns
|
Tour
|
Supports(TSPObjective)
Returns true if the given objective is supported.
Declaration
public bool Supports(TSPObjective objective)
Parameters
|
TSPObjective
objective
|
Returns
|
System.Boolean
|
Try3OptMoves(TSProblem, Single[][], Tour, Int32, Int32, Int32, Single[], Int32, Single, Single, out Single)
Tries all 3Opt Moves for the neighbourhood of v_1 containing v_3.
Declaration
public bool Try3OptMoves(TSProblem problem, float[][] weights, Tour tour, int v1, int v2, int v3, float[] weightsV3, int v4, float weightV1V2PlusV3V4, float weightV1V4, out float delta)
Parameters
|
TSProblem
problem
|
|
System.Single[][]
weights
|
|
Tour
tour
|
|
System.Int32
v1
|
|
System.Int32
v2
|
|
System.Int32
v3
|
|
System.Single[]
weightsV3
|
|
System.Int32
v4
|
|
System.Single
weightV1V2PlusV3V4
|
|
System.Single
weightV1V4
|
|
System.Single
delta
|
Returns
|
System.Boolean
|
Try3OptMoves(TSProblem, Single[][], Tour, Int32, Int32, Single, Int32, out Single)
Tries all 3Opt Moves for the neighbourhood of v_1 containing v_3.
Declaration
public bool Try3OptMoves(TSProblem problem, float[][] weights, Tour tour, int v1, int v2, float weightV1V2, int v3, out float delta)
Parameters
|
TSProblem
problem
|
|
System.Single[][]
weights
|
|
Tour
tour
|
|
System.Int32
v1
|
|
System.Int32
v2
|
|
System.Single
weightV1V2
|
|
System.Int32
v3
|
|
System.Single
delta
|
Returns
|
System.Boolean
|
Try3OptMoves(TSProblem, Single[][], Tour, Int32, out Single)
Tries all 3Opt Moves for the neighbourhood of v1.
Declaration
public bool Try3OptMoves(TSProblem problem, float[][] weights, Tour tour, int v1, out float delta)
Parameters
|
TSProblem
problem
|
|
System.Single[][]
weights
|
|
Tour
tour
|
|
System.Int32
v1
|
|
System.Single
delta
|
Returns
|
System.Boolean
|