Inexact TSP solvers based the Lin-Kernigham heuristic.

# S3 method for lkh
run(solver, instance, seed = as.integer(ceiling(runif(1L) *
  2^15)), cutoff.time = NULL, opt.tour.length = NULL,
  max.trials = NULL, with.restarts = FALSE, full.matrix = FALSE,
  verbose = FALSE, log.trajectory = TRUE, work.dir = NULL,
  output.files.prefix = NULL, keep.output.files = FALSE,
  more.args = list(), ...)

Arguments

solver

[TSPSolver]
TSPSolver object.

instance

[character(1) | Network]
Path to TSP instance in TSPlib format or Network object.

seed

[integer(1)]
Seed for the random numbers generator. Defaults to a random integer between 1 and \(2^15\).

cutoff.time

[integer(1)]
Maximal running time in seconds. Default is NULL, i.e., no cutoff time.

opt.tour.length

[integer(1) | NULL]
Length of an optimal TSP tour. This is only relevant for benchmarking. Keep in mind, that in case of a given optimal tour length most internal stopping criteria of EAX are deacitvated. The algorithm stops if an optimal tour is found or the cutoff time is reached.

max.trials

[integer(1)]
Maximal number of iterations. Default is the number of nodes of the instance.

with.restarts

[logical(1)]
Should LKH restart if a plateau is reached? Default is FALSE.

full.matrix

[logical(1)]
Only relevant if instance is a Network. If TRUE, the network is exported to TSPlib format with explicit edge weight definition. Default is FALSE.

verbose

[logical(1)]
Should the output of the solver be printed? Default is FALSE.

log.trajectory

[logical(1)]
Should the optimization progress be logged? Default is FALSE.

work.dir

[character(1)]
Path to working directory of the solver. Defaults to temporary directory via tempfile().

output.files.prefix

[character(1)]
Prefix for file names used by solver for storing output. Default is a randomly generated temporary prefix.

keep.output.files

[logical(1)]
Flag indicating whether output files shall be kept or deleted. Default is FALSE, i.e., output files are processed and output is loaded into R object. Afterwards the output files are deleted. This flag is particularly useful in large benchmark studies if work.dir and output.files.prefix is set.

more.args

[list]
Named list of parameter which shall be written to the LKH parameter file. Note that 1) the names should be all uppercase and 2) there is no argument check. Default ist the empty list.

...

[any]
Not used at the moment.

Value

[TSPSolverResult]

Note

This solver requires integer inter-city distances.

References

Helsgaun, K. (2000). An effective implementation of the lin-kernighan traveling salesman heuristic. European Journal of Operational Research, 126:106-130.

Helsgaun, K. (2009). General k-opt submoves for the Lin-Kernighan TSP heuristic. Mathematical Programming Computation, 1(2-3):119-163.