bdtsp_ga_basic(popSize, numIter, xy, alpha, range )
% FUNCTION: mclust_ga_basic calculates the minimum of the sum of the max
% distances for several clusters. In essence, it is a clustering tool
% that minimizes the max distances between each cluster and the farthest
% member of that cluster. Genetic algorithm minimizes the sum of the max
% distance of each of the centroid (cluster centers) then calculates the
% TSP distance from each centroid to each centroid.
% Inputs:
% population size and iterations
% xy coordinates
% speed of drone as a factor of blimp speed
% range of drone
% Outputs:
% number of centroids
% assignement of xy coordinates to centroids
% (note that one or more coordinates will become centroids)
% GA uses uses a tournament approach mutation type genetic algorithm.
% Initialize:
% (1) Calculate the distance from each xy coordinate to every other xy
% coordinate as distance matrix dmat.
% Body:
% (1) Randomly generate populations
% (2) Find min-cost of all pop (trials); keep best pop member and plot.
% (3) Shuffle (reshuffle) pop for a new tournament
% (4) Sub-group pop into groups of 4.
% Find the best of the 4; Overwrite worst of 4 from sub-group pop
% (5) Mutate the best of 4 (winner) in each sub-group
% (6) Insert best of 4 (winner) and all mutations back into population
% (7) If iteration budget remains, go to step 2, else terminate.
% Termination: based on iteration budget.
%
% Example of inputs:
% nStops=30; % Number of delivery stops for blimp-drone
% popSize = 500; % Size of the population of trials.
% numIter = 2500; % Number of iterations of GA; iteration budget.
% alpha = 2; % Speed of drone as a factor of blimp
% range = 10; % Range of drone (i.e. 10 km)
% xy=50*rand([nStops,2]);
% bdtsp_ga_basic(popSize, numIter, xy, alpha, range )
Cite As
Robert Rich (2024). bdtsp_ga_basic(popSize, numIter, xy, alpha, range ) (https://www.mathworks.com/matlabcentral/fileexchange/64658-bdtsp_ga_basic-popsize-numiter-xy-alpha-range), MATLAB Central File Exchange. Retrieved .
MATLAB Release Compatibility
Platform Compatibility
Windows macOS LinuxCategories
- Mathematics and Optimization > Optimization Toolbox > Linear Programming and Mixed-Integer Linear Programming > Solver-Based Linear Programming >
Tags
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!Discover Live Editor
Create scripts with code, output, and formatted text in a single executable document.