Show / Hide Table of Contents

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, TSPTWProblem, TSPTWObjective, Tour, float>, IOperator<float, TSPTWProblem, TSPTWObjective, Tour, float>

Constructors

HillClimbing3OptSolver()

Creates a new solver.

Declaration
public HillClimbing3OptSolver()

HillClimbing3OptSolver(ISolver<Single, TSPTWProblem, TSPTWObjective, Tour, Single>, Boolean, Boolean)

Creates a new solver.

Declaration
public HillClimbing3OptSolver(ISolver<float, TSPTWProblem, TSPTWObjective, Tour, float> generator, bool nearestNeighbours, bool dontLook)
Parameters
ISolver<System.Single, TSPTWProblem, TSPTWObjective, 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(TSPTWProblem, TSPTWObjective, Tour, out Single)

Returns true if there was an improvement, false otherwise.

Declaration
public bool Apply(TSPTWProblem problem, TSPTWObjective objective, Tour solution, out float delta)
Parameters
TSPTWProblem problem

TSPTWObjective objective

Tour solution

System.Single delta

Returns
System.Boolean

Solve(TSPTWProblem, TSPTWObjective, out Single)

Solves the given problem.

Declaration
public override Tour Solve(TSPTWProblem problem, TSPTWObjective objective, out float fitness)
Parameters
TSPTWProblem problem

TSPTWObjective objective

System.Single fitness

Returns
Tour

Supports(TSPTWObjective)

Returns true if the given objective is supported.

Declaration
public bool Supports(TSPTWObjective objective)
Parameters
TSPTWObjective objective

Returns
System.Boolean

Try3OptMoves(TSPTWProblem, 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(TSPTWProblem problem, float[][] weights, Tour tour, int v1, int v2, int v3, float[] weightsV3, int v4, float weightV1V2PlusV3V4, float weightV1V4, out float delta)
Parameters
TSPTWProblem 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(TSPTWProblem, Single[][], Tour, Int32, out Single)

Tries all 3Opt Moves for the neighbourhood of v1.

Declaration
public bool Try3OptMoves(TSPTWProblem problem, float[][] weights, Tour tour, int v1, out float delta)
Parameters
TSPTWProblem problem

System.Single[][] weights

Tour tour

System.Int32 v1

System.Single delta

Returns
System.Boolean

Back to top Built by Itinero, MIT licensed.