Genetic Algorithm
Genetic Algorithm
Research Article
Department of Mathematics, National Institute of Technology, Chaltlang, Aizawl Mizoram, 796012, India
2
3
Department of Mathematics, Faculty of Science, Indira Gandhi National Tribal University, Lalpur, Amarkantak, Anuppur,
Madhya Pradesh 484887,India
ARTICLE INFO
ABSTRACT
Article history
Received: 11 July 2023 In this study, Genetic Algorithm (GA), a sort of randomized direct, iterative search methodol-
Revised: 19 September 2023 ogy built around natural selection, is employ in computers to discover approximations of solu-
Accepted: 11 October 2023 tions to optimisation and search issues. GA employs operators including selection, crossover,
and mutation to tackle. In case of NP-hard issues, particularly for travelling salesman problem
Keywords: (TSP), the GAs is beneficial. To reduce the overall distance, we propose a novel crossover
Crossover Operator, Genetic operator with its python code for the TSP. Along with the Python pseudo coding, we addi-
Algorithm, Muation Operator, tionally introduced a mutation operator to enhance the consummation of GA in determining
Python Coding, Travelling the shortest distance in the TSP. To emphasize the proposed crossover and mutation operator,
Salesman Problem we also illustrate different steps using examples. We integrated path representation with our
developed crossover and mutation operator as it is apparent method to represent a tour.
Cite this article as: Sharma MK, Chaudhary S, Rathour L, Mishra VN. Modified genetic al-
gorithm with novel crossover and mutation operator for travelling salesman problem. Sigma
J Eng Nat Sci 2024;42(6):1876−1883.
*Corresponding author.
*E-mail address: vnm@[Link]; vishnunarayanmishra@[Link]
This paper was recommended for publication in revised form by
Regional Editor Ahmet Selim Dalkilic
Ordinal Representation
In ordinal representation, ith member in set is a integer
between 1 to n - i + 1 and an ordered set consisting of vari-
ous destinations act as guide also exists.
Example: Let n = 8 and O = (1 2 3 4 5 6 7 8) be a refer-
ence list, then the tour 1-5-3-2-8-4-7-6 is represented by T
= (1 4 1 2 1 4 1 2 1)
The DFJ formulation of TSP is as follows:
Matrix Representation
In matrix representation, member ith row and jth col-
umn is 1 iff city i is visited before the city j
Example: The matrix representation of tour 2-3-1-4 is
Partially Mapped (PMX) for the 5th, 6th, and 7th components of offspring because they
Partially Mapped Crossover operator (PMX) was intro- make up another cycle. As a result, we discover the follow-
duced by Goldberg and Lingle [3] for path representation of ing offspring:
chromosomes in path representation. In PMX, after choos- O1 = (1 2 6 4 7 5 3 8)
ing two random cut locations on the parents to produce off-
spring, one parent’s string is mapped onto the other parent’s Cycle Crossover Operator (CX) 2
string. Thereafter, a remaining bit are filled with the help of Hussain et al. [38] proposed cycle crossover operator 2
mapping with the constraint that no bit is repeated in the (CX2) for TSP to optimize distance travelled.
offspring. Step 1. Let us consider two parents for mating. Choose
Example:Let us consider two parents P1 and P2 with the 1st bit of the 1st offspring using 2nd parent string.
two random cut points Step 2. The bit selected in Step 1 is present in the 1st par-
P1 = (1 2 | 3 4 5 6 | 7 8) ent, followed by the same similar location bit selected in the
P2 = (2 7 | 5 8 4 1 | 6 3) 2nd parent, which is present in the 1st parent, and the similar
Then, the mapping segment between the cut points rep- location bit selected in the 2nd parent, which is then selected
licated with each other in order to build offspring, the map- for the first bit of the 2nd offspring.
↔ ↔ ↔
ping is 2 1,7 6,1 8. Step 3. The 1st parent will have the chosen bit from Step
3, and the 1st offspring would contain the following bit in
O1 = ( × × | 1 4 5 8 | × ×)
O2 = (× × | 3 4 5 6 | × ×) the 2nd parent’s identical place.
Step 4. Continue Steps 2 and 3 until the 1st bit of the 1st
Cycle Crossover Operator (CX) parent does not appear in the 2nd offspring, at which point
Cycle crossover (CX) operator was first introduced by the procedure may be stopped.
Oliver et al. [37]. Any bit in this operator is obtained via Step 5. If any bits remain, they will be similar in the 1st
any of the parents to determine its position. Let P1 and P2 parent and the 2nd offspring up to this point, and vice versa
be two parent string to illustrate the operator for both parents.
P1 = (1 2 3 4 5 6 7 8) Example:
P2 = (2 4 6 8 7 5 3 1) Let us consider two parent chromosomes for mating
Now, select 1st element of offspring from first element P1 = (3 4 8 2 7 1 6 5 )
of either of P1 or P2. Here from two options (1or 2), we will P2 = (4 2 5 1 6 8 3 7)
choose 1. For last element of O1, we must consider 8, as if 1 By employing above steps, the two offspring initiated
is taken then it would not result as a legal tour. are as follows:
O1 = (1 × × × × × × 8) O1 = (4 8 6 2 5 3 1 7)
Similarly, for 2nd and 4th element, we have 2 and 4 O2 = ( 1 7 4 8 6 2 5 3)
respectively.
O1 = (1 2 × 4 × × × 8)
PROPOSED CROSSOVER OPERATOR
The relative positions of the elements selected up until
this point are considered to form a tour. Think about the 3rd In this section we will propose the Increasing partially
element of the O1. Any of the parents can be the source for mapped crossover operator (IPMX) and the python coding
this component. Let’s say we choose it to come from parent of the proposed operator is given in Figure 2. The proposed
2. This indicates that the second parent must also be picked operator is defined by the following steps.
problems other than TSP such as transportation problem, [9] Syswerda G. Schedule optimization using genetic
vehicle routing problem, neural networks, and so on. algorithms. In L. Davis (Ed.), Handbook of genetic
algorithms. USA: Van Nostrand Reinhold; 1991. p.
AUTHORSHIP CONTRIBUTIONS 332–349.
[10] Grefenstette JJ. Incorporating Problem Specific
Authors equally contributed to this work. Knowledge into Genetic Algorithms. In Davis, L.
(ed.) Genetic Algorithms and Simulated Annealing,
DATA AVAILABILITY STATEMENT Los Altos, CA: Morgan Kaufmann; 1987. p. 42–60.
The authors confirm that the data that supports the [11] Larranaga P, Inza I, Kuijpers CMH, Grana M, Lozano
findings of this study are available within the article. Raw JA. Algoritmos Geneticos en el Problema del Viajante
data that support the finding of this study are available from de Comercio. ‘ Informatica y Automatica (submit-
the corresponding author, upon reasonable request. ted). 1966.
[12] Grefenstette J, Gopal R, Rosmaita B, Van Gucht D.
Genetic Algorithms for the TSP. In Grefenstette,
CONFLICT OF INTEREST J. J. (ed.) Proceedings of the First International
The author declared no potential conflicts of interest Conference on Genetic Algorithms and Their
with respect to the research, authorship, and/or publication Applications, Hillsdale, New Jersey: Lawrence
of this article. Erlbaum; 1986. p. 160–165.
[13] Abu Arqub O, Abo-Hammour Z, Momani S,
ETHICS Shawagfeh N. Solving singular two-point boundary
value problems using continuous genetic algorithm.
There are no ethical issues with the publication of this Abstr Appl Anal 2012;2012:205391. [CrossRef]
manuscript. [14] Arqub OA, Abo-Hammour Z. Numerical solution
of systems of second-order boundary value prob-
REFERENCES lems using continuous genetic algorithm. Inf Sci
2014;279:396–415. [CrossRef]
[1] Holland J. Adaption in Natural and Artificial Systems.
[15] Abo-Hammour ZE, Alsmadi O, Momani S, Abu
Ann Arbor: University of Michigen Press; 1975. Arqub O. A genetic algorithm approach for predic-
[2] Lidd ML. The travelling Salesman Problem Domain tion of linear dynamical systems. Math Probl Eng
Application of a Fundamentally New Approach to 2013;2013:1–12. [CrossRef]
Utilizing Genetic Algorithms. Technical Report, [16] Abo-Hammour Z, Abu Arqub O, Momani S,
MITRE Corporation, 1991. Shawagfeh N. Optimization solution of Troesch’s
[3] Goldberg DE, Lingle Jr. R. Alleles, Loci and the TSP. and Bratu’s problems of ordinary type using novel
In Grefenstette, J. J. (Ed.). Proceedings of the First continuous genetic algorithm. Discrete Dyn Nat Soc
International Conference on Genetic Algorithms 2014;2014:401696. [CrossRef]
and Their Applications,Hillsdale, New Jersey: [17] Raiz M, Kumar A, Mishra VN, Rao N. Dunkl ana-
Lawrence Erlbaum; 1985. p. 154–159. logue of Sz $\acute {a} $ sz-Schurer-Beta operators
[4] Davis L. Applying Adaptive Algorithms to Epistatic and their approximation behaviour. Math Found
Domains. Proceedings of the International Joint Comput 2022;5:315–330. [CrossRef]
Conference on Artificial Intelligence. New York, [18] Mishra VN, Raiz M, Rao N. Dunkl analouge of Sz $\
USA: ACM Digital Library; 1985. p. 162–164. acute {a} $ sz Schurer Beta bivariate operators. Math
[5] Brady RM. Optimization strategies gleaned from bio- Found Comput 2023;6:651–669. [CrossRef]
logical evolution. Nature 1985;317:804–806. [CrossRef] [19] Dantzig G, Fulkerson R, Johnson S. Solution of a
[6] Grefenstette JJ. Incorporating Problem Specific large-scale traveling-salesman problem. J Oper Res
Knowledge into Genetic Algorithms. In Davis, Soc Am 1954;2:393–410. [CrossRef]
L. (ed.) Genetic Algorithms and Simulated [20] Petberg MW, Homg S. On the symmetric traveling
AnnealingLos Altos, CA: Morgan Kaufmann; 1987. salesman problems: a computational study. Math
p. 42–60. Prog Stud 1980;12:61–77. [CrossRef]
[7] Muhlenbein H, Gorges-Schleuter M, Kramer O. [21] Fleischmann B. A cutting plane procedure for the
Evolution algorithms in combinatorial optimiza- travelling salesman problem on road networks. Eur
tion. Paral Comput 1988;7:65–85. [CrossRef] J Oper Res 1985;21:307–317. [CrossRef]
[8] Muhlenbein H. Parallel Genetic Algorithms, [22] Padberg M, Rinaldi G. Optimization of a 532-city
Population Genetics and Combinatorial ¨ symmetric traveling salesman problem by branch
Optimization. In Schaffer, J. (ed.) Proceedings on and cut. Oper Res Lett 1987;6:1–7. [CrossRef]
the Third International Conference on Genetic [23] Bhide S, John N, Kabuka MR. A Boolean neural net-
Algorithms, Los Altos, CA: Morgan Kaufmann work approach for the traveling salesman problem.
Publishers; 1988. p. 416–421. IEEE Trans Comput 1993;42:1271–1278. [CrossRef]
Sigma J Eng Nat Sci, Vol. 42, No. 6, pp. 1876−1883, December, 2024 1883
[24] Dorigo M, Gambardella LM. Ant colony system: a salesman problem under fuzziness. Swarm Evol
cooperative learning approach to the traveling sales- Comput 2014;15:27–37. [CrossRef]
man problem. IEEE Trans Evol Comput 1997;1:53– [34] Maity S, Roy A, Maiti M. A modified genetic algo-
66. [CrossRef] rithm for solving uncertain constrained solid
[25] Knox JE. The application of tabu search to the travelling salesman problems. Comput Ind Eng
symmetric traveling salesman problem. Colarado: 2012;83:273–296. [CrossRef]
University of Colorado at Boulder; 1989. [35] Dantzig GB. Linear programming and extensions.
[26] Chiang WC, Russell RA. Simulated annealing meta- Princeton, NJ: Princeton University Press; 1993.
heuristics for the vehicle routing problem with time [36] Velednitsky M. Short combinatorial proof that the
windows. Ann Oper Res 1996;63:3–27. [CrossRef] DFJ polytope is contained in the MTZ polytope for
[27] Focacci F, Lodi A, Milano M. A hybrid exact the Asymmetric Traveling Salesman Problem. arXiv
algorithm for the TSPTW. Informs J Comput preprint arXiv 2018:1805.06997.
2013;14:403–417. [CrossRef] [37] Oliver IM, Smith D, Holland JR. A study of permu-
[28] Ibaraki T, Imahori S, Kubo M, Masuda T, Uno T, tation crossover operators on the traveling salesman
Yagiura M. Effective local search algorithms for problem. In Oliver IM, Smith DJ, Holland JRC (Ed.).
routing and scheduling problems with general Genetic Algorithms and their Applications. Sussex,
time-window constraints. Transp Sci 2007;39:206– London: Psychology Press; 2013. p. 224–230.
232. [CrossRef] [38] Hussain A, Muhammad YS, Nauman Sajid M,
[29] Nguyen HD, Yoshihara I, Yamamori K, Yasunaga M. Hussain I, Mohamd Shoukry A, Gani S. Genetic
Implementation of an effective hybrid GA for large- algorithm for traveling salesman problem with
scale traveling salesman problems. IEEE Trans Syst modified cycle crossover operator. Comput Intell
Man Cybern Part B (Cybernetics) 2007;37:92–99. Neurosci 2017;2017:430125. [CrossRef]
[CrossRef] [39] Fogel DB. An evolutionary approach to the traveling
[30] Ghadle KP, Muley YM. Travelling salesman problem salesman problems. Biol Cybrn 1988;60:139–144.
with MATLAB programming. Int J Adv Appl Math [CrossRef]
Mech 2015;2:258–266. [40] Banzhaf W. The ‘molecular’ traveling salesman. Biol
[31] Kumar A, Gupta A. Assignment and travelling sales- Cybrn 1990;64;7–14. [CrossRef]
man problems with coefficients as LR fuzzy parame- [41] Michalewicz Z. Genetic Algorithms + Data
ters. Int J Appl Sci 2015;10:155–170. Structures = Evolution Programs. Berlin Heidelberg:
[32] Majumdar J, Bhunia AK. Genetic algorithm for Springer Verlag; 1992. [CrossRef]
asymmetric traveling salesman problem with [42] Fogel DB. Empirical estimation of the computation
imprecise travel times. J Comput Appl Math required to discovery approximate solutions to the
2011;235:3063–3078. [CrossRef] traveling salesman problem using evolutionary pro-
[33] Changdar C, Mahapatra GS, Pal RK. An efficient gramming. Proceedings of 2nd Annual Conference
genetic algorithm for multi-objective solid travelling on Evolutionary Programming. 1993. p. 56–61.