run_solver: Runs a solver on a TSP instance.

Description Usage Arguments Value Examples

Description

Currently the following solvers are supported: nearest_insertion: See solve_TSP. farthest_insertion : See solve_TSP. cheapest_insertion : See solve_TSP. arbitrary_insertion: See solve_TSP. nn: See solve_TSP. repetitive_nn: See solve_TSP. concorde: See solve_TSP.

Usage

1
run_solver(x, method, ...)

Arguments

x

[tsp_instance]
TSP instance.

method

[character(1)]
Solver to use on TSP instance. To use concorde and/or linkern it is necessary to specify the path to the concorde/linkern executable with concorde_path.

...

[any]
Control parameters for solver.

Value

[TOUR] TOUR object from package TSP, containing order of cities, tour length and method name that generated this solution.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
x = random_instance(10)
tours = sapply(c("nn", "cheapest_insertion", "arbitrary_insertion"), function(solver) {
  list(solver = run_solver(x, method = solver))
})
## Not run: 
  concorde_path(path = "/absolute/path/to/concorde/executable")
  concorde_tour = run_solver(x, method = "concorde")
  concorde_tour = run_solver(x, method = "linkern")

## End(Not run)

berndbischl/tspmeta documentation built on May 12, 2019, 7:24 p.m.