optim2Opt {CEGO} | R Documentation |
Two-Opt
Description
Implementation of a Two-Opt local search.
Usage
optim2Opt(x = NULL, fun, control = list())
Arguments
x |
start solution of the local search |
fun |
function that determines cost or length of a route/permutation |
control |
(list), with the options:
|
Value
a list with:
xbest
best solution found
ybest
fitness of the best solution
count
number of performed target function evaluations
References
Wikipedia contributors. "2-opt." Wikipedia, The Free Encyclopedia. Wikipedia, The Free Encyclopedia, 13 Jun. 2014. Web. 21 Oct. 2014.
See Also
optimCEGO
, optimEA
, optimRS
, optimMaxMinDist
Examples
seed=0
#distance
dF <- distancePermutationHamming
#creation
cF <- function()sample(5)
#objective function
lF <- landscapeGeneratorUNI(1:5,dF)
#start optimization
set.seed(seed)
res <- optim2Opt(,lF,list(creationFunction=cF,budget=100,
vectorized=TRUE)) ##target function is "vectorized", expects list of solutions as input
res