Description Usage Arguments Value Examples
Runs the MTSP solver
1 2 3 4 5 6 7 8 9 10 | mdmtspv_ga2(
xy,
dmat,
nSalesmen,
CostType,
popSize,
numIter,
Epsilon = 1e-10,
return_all = FALSE
)
|
xy |
A |
dmat |
A |
nSalesmen |
An integer giving the number of salespersons (must be >= 2). |
CostType |
Possible values are the integers 1 or 2; 1 minimises the total distance travelled and 2 minimises the maximum distance travelled across the salepersons. |
popSize |
The population size / search space of the GA (should be divisible by 8 but this is corrected within program). |
numIter |
is the number of desired iterations for the algorithm to run after a new best solution is found. |
Epsilon |
A double giving a multiplier on blancing the costs beteen total distance and minmax (only used for |
return_all |
Logical on whether ro return full ouput. Defaults to |
Returns the solution to the MTSP. Depending on return_all
may return the inputs and best_tour
:
a matrix where each row gives the sites visited by each salesperson, minDist
: is the best cost found by the algorithm,
and generation
: is the number of generations required by the algorithm to find the solution.
1 2 3 4 5 6 |
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.