Inexact TSP solvers based on a genetic approach.

# S3 method for eaxw
run(solver, instance, max.trials = 1L, pop.size = 100L,
  off.size = 30L, cutoff.time = 10L, opt.tour.length = NULL,
  seed = as.integer(ceiling(runif(1L) * 2^15)), with.restarts = FALSE,
  with.GPX = FALSE, fitness.type = "classic", snapshot.step = 0L,
  full.matrix = FALSE, verbose = FALSE, log.trajectory = TRUE,
  work.dir = NULL, output.files.prefix = NULL,
  keep.output.files = FALSE, init.pop = NULL, ...)

Arguments

solver

[TSPSolver]
TSPSolver object.

instance

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

max.trials

[integer(1)]
Number of independent runs. At the moment this is fixed to 1.

pop.size

[integer(1)]
Population size. Default is 100.

off.size

[integer(1)]
Number of offspring generated in each generation. Default is 30.

cutoff.time

[integer(1)]
Maximal running time in seconds. Default is 10.

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.

seed

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

with.restarts

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

with.GPX

[logical(1)]
Activate GPX2 crossover? Default is FALSE.

fitness.type

[character(1)]
Type of fitness function, either “classic” or “weighted”. Default is

snapshot.step

[integer(1)]
Possibility to log the entire population each snapshot.step times. Default is 0, i.e., do not log at all.

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.

init.pop

[list]
List of lists. Each sublist needs to contains three components:

n [integer(1)]

Number of nodes of the TSP problem.

tour [integer(n)]

The actual tour.

tour.length [integer(1)]

Length of the tour.

Default is NULL, i.e., the initial population is generated randomly and 2-Opt is applied to each solution before the evolutionary loop starts.

...

[any]
Not used at the moment.

Value

[TSPSolverResult]

Note

This solver requires integer inter-city distances.

References

Nagata, Y. and Kobayashi, S. (2013). A powerful genetic algorithm using edge assembly crossover for the travelling salesman problem. INFORMS Journal on Computing, 25(2):346-363.

Nagata, Y. and Kobayashi, S. (1997). Edge assembly crossover: A high-power genetic algorithm for the travelling salesman problem. In Baeck, T., editor, Proceedings of the Seventh International Conference on Genetic Algorithms (ICGA97), pages 450-457, San Francisco, CA. Morgan Kaufmann.