Uses tsp to find the best hamiltonian on the complete graph on 1..n
order_tsp.Rd
Returns shortest cycle or path via tsp solver from package TSP
Arguments
- d
A
dist
, used to provide edge weights.- method
Options are
nearest_insertion
,farthest_insertion
,cheapest_insertion
,arbitrary_insertion
,nn
,repetitive_nn
,2-opt
and if concorde package is loaded,concorde
. Seesolve_TSP
for details.- improve
if
TRUE
, attempts to improve the solution using "2-opt".- cycle
If
TRUE
, finds the shortest cycle, otherwise the shortest open path.- path_dir
If a function is provided, used to re-orient the cycle/path. Default function is
path_cor
.- ...
passed to
solve_tsp
Details
Requires package TSP.
When path_dir
is non NULL, the returned hamiltonian is also optimally oriented using best_orientation
, which compares orientations via path_dir
.
See also
order_best
, solve_TSP
in TSP.