Professional Documents
Culture Documents
Genetic Algorithm For Finding Shortest Paths Problem: June 2018
Genetic Algorithm For Finding Shortest Paths Problem: June 2018
Genetic Algorithm For Finding Shortest Paths Problem: June 2018
net/publication/326918062
CITATION READS
1 702
3 authors, including:
Some of the authors of this publication are also working on these related projects:
All content following this page was uploaded by Shaymaa Alhayali on 16 May 2021.
ABSTRACT
Genetic algorithm is used for analyzing business problems mostly
applied to find solution for business challenges. Genetic algorithm
1. INTRODUCTION
generates many solutions to a single problem each one with In supermarkets the travel manager mostly travels around different
different performance some are better than other in performance. supermarkets. The manager wants to visit the supermarket on time
and use shortest path for this problem I use genetic algorithm to
Finding shortest path has many applications in different fields. The provide the manager with shortest path. First get all the location
purpose of this paper is to find the business problem related to data of supermarkets where the manager visits in working hours
supermarkets and give the solution to this problem using genetic and then apply genetic algorithm on these values to provide the
algorithm. In this paper we chose supermarkets in different location solution [1].
and we want to find the shortest path for the manager to visit among
these supermarkets with shortest distance, therefore in genetic This research paper is about providing the efficient method for path
algorithm the evaluation function finds all the relevant variables of finding in Business problems. Genetic algorithm processes the
Geno type and then evaluates fitness function on these Geno existing data and generates the new result which is more accurate
variables using crossover and mutation techniques for sorting out than the previous one.
relevant values. In GA the fitness function is the total time elapsed Genetic Algorithms focus on processing data and find all the
for the target to achieve their goal. We use the fitness function on possible combination and path between them which provide more
population data with respect to crossover and mutation function for efficient solution to complete the task in low cost. Genetic
training datasets. The main problems in Business, science and algorithm provides multiple solutions for a single problem.
engineering are to find the short path in different activities like
visiting different places or transferring some data in minimum time.
The genetic algorithm provides efficient method to provide
optimizations of these problems. To solve the supermarket manger
traveling problem we encode the datasets of our problem using GA
and initialize all the variables. The estimation values of the
locations are set as a parameter to genetic algorithm and find the
best method by using the MDL technique (Minimum Description
length). Genetic algorithms are very efficient for selection and
genetics of natural values.
CCS Concepts
• Theory of computation Evolutionary algorithms • Software
and its engineering Genetic programming • Mathematics of Figure 1 Genetic Algorithm reproduction cycle
computing~Paths and connectivity problems
Figure 1 shows the genetic algorithm reproduction cycle process.
Keywords Parents are selected at random with selection chances biased in
Genetic algorithm, MDL, data processing, evolutionary algorithm, relation to chromosome evaluations. In genetic algorithm parent’s
management system. classes are selected in random bases and use mutation and cross
over operator for the values. Mutation is the modification of data
sets which restore the missing information in the population data.
Permission to make digital or hard copies of all or part of this work for
personal or classroom use is granted without fee provided that copies are
not made or distributed for profit or commercial advantage and that copies 2. DATA COLLECTION
bear this notice and the full citation on the first page. To copy otherwise, We collect the location data of supermarkets and store these
or republish, to post on servers or to redistribute to lists, requires prior locations in a set of arrays. In figure 2 the data is shown in the form
specific permission and/or a fee. of latitude and longitude in the form of blue dots which are the
ICEMIS’18, June 19–21, 2018, Istanbul, Turkey. locations of supermarkets [1].
Copyright 2018 ACM ISBN 978-1-4503-6392-1/18/04…$15.00.
DOI: https://doi.org/10.1145/3234698.3234725 All of the locations data are stored in the form of an array
respectively in array variable X and Y. In figure 2 below the blue
dotes shows the manager location which he need to visit by using
the short path for this purpose we calculate the values by genetic 4 EMTE HEUV 5741JJ BEEKE 51. 5.63
algorithm. BEEK EN ELPL N 529 23
DONK N 73 DONK 3
5 EMTE MER 5258A BERLI 51. 5.39
BERLICU CURI X CUM 679 886
M USPL NB 52
N 30
6 EMTE MAR 4112JS BEUSI 51. 5.29
BEUSICH KT 20 CHEM 948 276
EM FR 99
7 EMTE LICH 7271A BORC 52. 6.52
BORCUL TENH E ULO 117 536
O ORST 63
Figure 2 supermarket locations
7
The location data is random the path between these locations are 8 EMTE VERK 5831E BOXM 51. 5.94
too long which takes time to traverse all the points. The data in BOXMEE UYLS H EER 646 985
figure 2 shown in form of blue dots are all the super market in R TR 11 01
9 EMTE MOL 5306V BRAK 51. 5.10
different places which can be sort out using genetic algorithm.
BRAKEL ENKA N EL 810 761
FR MPS 23
3. GENETIC ALGORITHM WG 3
Genetic algorithms are a very important tool for business problems 1 EMTE MOE 4826H BRED 51. 4.79
and optimizations. This algorithm improves the performance of 0 BREDA RWY N A 608 059
task by finding Business intelligence solution from the exiting MOERWIJ K 23 53
datasets in our case we will get the locations of supermarkets as our K
datasets [2]. The solution generate from Genetic algorithm are 1 EMTE HEKS 4823JT BRED 51. 4.74
mostly better than existing one. These solutions are possible by 1 BREDA ENW A 622 434
genetic algorithm which gets the data and process it to find HEKSEN AAG 9
improved results. In table1.1 we have the data of supermarkets WAAG 37
locations like name, address, city, postal code lat. and long which 1 EMTE ST 5266A CROM 51. 5.23
we used in genetic algorithm [8]. 2 CROMVO LAM D VOIRT 660 157
We use permutation and Cross over technique of Genetic algorithm IRT BERT 52
for the supermarket population data. In Mutation the population USST
data is modified and regenerate the missing values. If we have the R 55
following populating data (1.38 -69.4 326.44 0.1) after applying 1 EMTE VIAN 4101X CULE 51. 5.22
the permutation operator the data is optimized (1.38 -67.5 326.44 3 CULEMB ENSE A MBOR 952 259
0.1). ORG STR 3 G 83
1 EMTE MAA 5431B CUYK 51. 5.88
Cross over is the technique for recombination of population data. 4 CUIJK SBUR R 729 003
This method effectively searches the important variables in G 24 51
processing of a population data. 1 EMTE L 7591G DENE 52. 7.00
5 DENEKA VOO E KAMP 374 273
1.1 Table 1 location data of EMET stores. MP R 10 29
1 EMTE DIDE 6951C DIERE 52. 6.10
6 DIEREN RNA W N 051 018
N Name Addre Postal City Lat Lon 44 33
o ss Code g 1 EMTE JULIA 5087B DIESS 51. 5.17
7 DIESSEN NAST B EN 478 801
0 HEADQU CORR 5466R VEGH 51. 5.52
FR R 42 68
ARTERS IDOR B EL 606 709
1 EMTE Looier 5104G DONG 51. 4.94
VEGHEL 11
8 Dongen splein N EN 625 229
1 EMTE 4241B ARKE 51. 4.99
25 651 1
ARKEL VRIE W L 864 304
1 EMTE KRIS 3314K DORD 51. 4.66
SPLN
9 DORDRE PYNS L RECH 801 547
14
CHT EWG T 11
2 EMTE CLAS 4341E ARNE 51. 3.67
KRISPIJN 68
ARNEMU INAS R MUID 500 728
SEWEG
IDEN FR TR 5 EN 01
2 EMTE AALB 5151E DRUN 51. 5.13
3 EMTE LARE 7437B BATH 52. 6.28
0 DRUNEN ERSE E EN 685 236
BATHME NSE M MEN 249 999
STR 5 25
N FR WG 06
18
The table above shows the existing location data of manager and
using this data we get the shortest paths between these super
markets. There are also old paths between these locations but after
using Genetic algorithm the newly discovered paths are far more Similarly, we can call the same function and pass the number of
better than existing one [9]. generation parameter in X instead of population. Figure 4 below
shows the performance overview of genetic algorithm.
4. PROCEDURE
In this study we use the genetic algorithm to find the shortest path
TSP30 - Overview of Performance
for the Manager of supermarket using genetic algorithm. The
algorithm gets the values of all the locations and generate the 1600
possible paths through which manager visit the supermarkets [4]. 1400
1200
We collect all the locations and using MATLAB with respect to lat.
1000
and long values from locations get all the possible paths between
Distance
800
them. Figure 3 show the basic Genetic algorithm process which
600
used crossover and mutation method for sorting and cleaning the
400
data variables to get the accurate result [12]. In first step we have
200
the population data which is passed to fitness function which
0
evaluates the data and forward to next step for collecting final 1 3 5 7 9 11 13 15 17 19 21 23 25 27 29 31
Best
Worst
results. [16] Generations (1000) Average
smLocations(n,1) = x; options=optimoptions(options,'CreationFcn',@create_permutation
s,'CrossoverFcn' ,
smLocations(n,2) = y; @crossover_permutation,'MutationFcn',@mutate_permutation,'Pl
otFcn',
n = n+1; plot_manager_map,'MaxGenerations',500,PopulationSize',60,'Ma
xStallGenerations',200, 'UseVectorized',true);
end
At the end to call the genetic algorithm with problem information.
Plotting all super market location according to Lat and Long where
'bo' value will mark the location with blue circle numberOfVariables = supermarkets;
plot(smLocations(:,1),smLocations(:,2),'bo'); [x,fval,reason,output]=ga(FitnessFcn,numberOfVariables,options)
Blue circles represent the locations of each supermarket where the ;
manager
6. RESULT
has to visit. Manager has to start visiting from location 0 which will Using Genetic algorithm, we read the F and G columns from the
be first location [5]. table 1 (column „lat and long‟) which are the locations for the
supermarkets. - Declaring an array to store the all the X and Y
Defining array distances which will store the distance value values. The Genetic algorithm created Distances matrix by using
between two supermarkets which will be the distance matrix fitness function for all the supermarkets [15]. We will be creating
distances = zeros(supermarkets); required functions for travelling manager. These functions will
distinguish the manager path parameter like population size and
for count=1: supermarkets, number of generations [12]. Individual functions are used to
for count1=1: count, generate the results based on parameters and to calculate the
minimal traveling distances [14]. The best route we found is store
x1 = smLocations(count,1); in variable in serial number from 1 -134.
y1 = smLocations(count,2); (Number of supermarkets) x = cell [1×40 double]
x2 = smLocations(count1,1); The distance of the best route is shown in the figure 6 below
y2 = smLocations(count1,2);
distances (count, count1) =sqrt((x1-x2) ^2+(y1-y2) ^2);
distances (count1, count) =distances (count, count1);
end;
We will be creating required function for travelling manager. These
functions will distinguish the Manager path parameter like
population size and number of generations [17]. Individual
functions are used to generate the results based on parameters and
to calculate the minimal traveling distances [6].
Figure 6 shortest distance to the largest location
typecreate_permutations.m The plot shows in Figure 6 (Genetic Algorithm) the location of the
typecrossover_permutation.m supermarkets in dots as well as the path found by the genetic
algorithm after evaluating all the values from which the manager
typemutate_permutation.m will travel. The manager can start his travel from headquarter
typetraveling_manager_fitness.m VEGHEL which is the first place the starting point of city and end
on the same point in minimum time with low cost [10].
FitnessFcn=@(x)traveling_manager_fitness(x,distances);
typetraveling_manager_plot.m%smLocationsplot_manager_map
= @(options,supermarket,flag)
traveling_manager_plot(options,supermarket,flag,smLocations);