Uses brute-force enumeration to find the best hamiltonian on the complete graph on 1..n.
order_best.RdReturns the best hamiltonian
Arguments
- d
A
dist, used to provide edge weights.- maxexact
If the sequence length is
<= maxexact, find the overall best hamiltonian, otherwise comparesnsamplesrandomly generated permutations.- nsamples
If the sequence length is
<= maxexact, finds the best ofnsamplesrandomly generated permutations .- cycle
If
TRUE, finds the shortest cycle, otherwise the shortest open path.- path_weight
Combines edge weights into a single path/cycle weight.
- path_dir
If a function is provided, used to re-orient the cycle/path. Default function is
path_cor.- ...
Ignored.
Details
Requires package gtools.
Currently it is possible to find the best hamiltonian by complete enumeration for up to 10 nodes.
When path_dir is non NULL, the returned hamiltonian is also optimally oriented using best_orientation, which compares orientations via path_dir.
References
see overview