Show / Hide Table of Contents

Class GeneralLocal2Opt<TProblem, TObjective>

A local 2-Opt* search.

Inheritance
System.Object
GeneralLocal2Opt<TProblem, TObjective>
Namespace: System.Dynamic.ExpandoObject
Assembly: cs.temp.dll.dll
Syntax
public sealed class GeneralLocal2Opt<TProblem, TObjective> : IOperator<float, TProblem, TObjective, Tour, float>
Type Parameters
TProblem

TObjective

Remarks
  • 2-Opt: Removes two edges and reconnects the two resulting paths in a different way to obtain a new tour.

Constructors

GeneralLocal2Opt(Func<TProblem, Single[][]>)

Creates a new local 2-Opt* search.

Declaration
public GeneralLocal2Opt(Func<TProblem, float[][]> getWeights)
Parameters
Func<TProblem, System.Single[][]> getWeights

Properties

Name

Returns the name of the operator.

Declaration
public string Name { get; }
Property Value
System.String

Methods

Apply(TProblem, TObjective, Tour, out Single)

Returns true if there was an improvement, false otherwise.

Declaration
public bool Apply(TProblem problem, TObjective objective, Tour tour, out float delta)
Parameters
TProblem problem

TObjective objective

Tour tour

System.Single delta

Returns
System.Boolean

Supports(TObjective)

Returns true if the given objective is supported.

Declaration
public bool Supports(TObjective objective)
Parameters
TObjective objective

Returns
System.Boolean

Back to top Built by Itinero, MIT licensed.