GENETIC ALGORITHM FOR OPTIMIZING DISTRIBUTION WITH ROUTE RESTRICTION CONSTRAINT DUE TO TRAFFIC JAMS

The Travelling Salesman Problem (TSP) is a classical problem in combinatorial optimization that consists of finding the shortest tour through all cities such that the salesman visits each city only one time and returns to the starting city. Genetic algorithm is one of the powerful ways to solve problems of traveling salesman problem TSP. The current genetic algorithm aims to take in consideration the constraints happening during the execution of genetic algorithm, such as traffic jams when solving TSP. This program has two important contributions. First one is proposing simple method into taking in consideration an inconvenient route linked to traffic jams. The second one is the use of closeness strategy during the initialization step, which can accelerate the execution time of the algorithm. The results of the experiments show that the improved algorithm works better than some other algorithms. The conclusion ends the analysis with recommendations and future works.


I. INTRODUCTION
Genetic algorithms (GA) are famous for their performances and their effectiveness to solve combinatorial optimization problems. Thanks to their efficiency, GAs have been applied to a wide range of fields such as medicine [1], software testing [2], industry [3,4], construction [5] or transport [6,7]. In all optimization problems, GA compete with other metaheuristics techniques such as particle swarm optimization, simulated annealing, evolutionary programming, tabu search, and ant colony optimization ACO. in their research work, researchers opt for the combination between different techniques or to do improvement inside one technique.
In the TSP problems, several heuristic and metaheuristic have been introduced since its definition. The first researcher to apply genetic algorithm to the TSP was Brady (1985) [8]. He was followed by Grefenstette et al. (1985) [9];   [10];   [11] and many others. Plenty of researches provided responses to many defined problems but none to our knowledge has treated the restriction constraint due to traffic jams. In this work, we have developed an optimization algorithm for finding the shortest possible trip by taking in consider traffic jam. This paper is structured as follow: chapter 2 synthesizes the state of the art and the principles in use in genetic algorithms, chapter 3 describes our approach, chapter 4 presents the experimentations and the results, and the final chapter gives a conclusion to this work.

II. STATE OF THE ARTS
GA reproduce natural evolution mechanisms expressed by Darwin's principal of survival of the fittest. The figure 1 summarizes the mechanisms used to generate new candidates from an existing population until the finding of optimal solutions.

Encoding and Decoding of TSP
Genetic Algorithm works on two types of spaces at the same times, coding space (genotype) and solution space (phenotype). The phenotype describes the external appearance of an individual. The relation between phenotype and genotype is expressed as presented below: In TSP, the most used type of encoding is Permutation Encoding [12] where the string of number represents the sequence of cities visited by the salesman. This encoding is also used for others ordering problem such as scheduling.

Initialization
Random initialization is the most used method to encode genetic algorithm for TSP application [9,10]. Consequently, the fitness function of the initial population has random results which will affect the performance of the next steps and therefore the whole algorithm performance [13,14].
Other methods were proposed to set the first generation, for examples: a-The first individual is generated randomly. This individual will be mutated N-1 times. b-The first individual is generated by using a heuristic mechanism such as the nearest neighbor. This individual will be mutated N-1 times. c-All first generation is generated by the same heuristic mechanism.

Fitness Function:
In TSP, each chromosome is a solution for the problem. The fitness of the chromosome is the sum of the distance between two consecutive cities. This distance is evaluated by the Euclidean Distance formula where the distance between two cities A(x1, y2) and B(x2,y2) is calculated as bellow:

Management of constraints:
Genetic algorithms (GAs) are usually applied to unconstrained optimizations. When they are designed to deal with constraints many techniques have been developed. A simple technique is to attribute a constant penalty to the chromosomes that violate these constraints.
Other methods have been produced to allow GA's to manage constraints [15,16,17]: a-Infeasible solutions are rejected after generation. b-An invalid solution is approximated by its nearest valid one, or repaired to become a valid one c-Special operators are designed in order to produce only feasible solutions. d-The search space is restricted, and infeasible solutions are eliminated before chromosomes generations All these techniques are time consuming and are difficult to build.

Selection Operator
The objective of this step is to select the suitable individual for matting [18,19,20]. Selection algorithm describes the methodology to choose parents for a meeting pool. These parents will create children for the next generation. Four strategies are resumed here: roulette, rank, elite and tour. a-In roulette selection, chromosomes are represented in the roulette wheel proportionally to their fitness functions. b-In Rank selection, chromosomes are ranked in ascending order which is based on their fitness. c-In elite strategy, best members are selected from the current population. d-And in tournament selection, members are chosen, from the current generation, to compete and the best ones are selected to be a parent from the pool. This practice is continued until all members have been a part of competition.

Crossover Operator
Crossover operators play an important role in GA. Crossover technique is inspired from biology: children by inheriting their parents' genes can be more capable and may have better fitness than their parent. This concept was used in schema theory by Holland under the concept of building blocks. Several crossover techniques [21] are created to reach in minimum iterations the optimum solution. In this paragraph, three crossovers are described: Partially mapped crossover (PMX), Cycle Crossover (CX) and Order Crossover Operator (OX).

Cycle Crossover Operator (CX)
CX was introduced by Oliver and al. [22]. This method identifies several cycles: Child 1 will be formed following cycles: cycle one is copied from the first parent, cycle two from the second parent, cycle three from the first parent, and so forth.
Child 2 will follow the same cycles, but the start will be from parent 2. This example illustrates the process. The first position is chosen randomly from the first parent. In this case, it's the third position.
We start with 3 and drop down to 1. 1 is found in the first position in Parent 1 and we drop down to 7. 7 drops down to 3 -The first cycle is finished. As a result, the child inherits theses values and their positions form parent 1 with the remnants called from parent2 as seen in fig.
We start with 2 and drop down to 4. 4 is found in the fourth position in Parent 1 and we drop down to 5. 5 Drops down to 6 and 6 drops down to 2 -The cycle is finished.
Partially mapped Crossover Operator (PMX). PMX was introduced by Goldberg et al. [23]. This operator follows these steps: a -Select randomly a subgroup from each parent: The International Archives of the Photogrammetry, Remote Sensing and Spatial Information Sciences, Volume XLIV-4/W3-2020, 2020 5th International Conference on Smart City Applications, 7-8 October 2020, Virtual Safranbolu, Turkey (online)

Order Crossover Operator (OX). OX was proposed by
Davis [24]. This process follows these steps: a. Choice randomly a subgroup from a parent b. Create a proto child by inserting the subgroup into the corresponding position of it. c. Delete the cities which are already in the subgroup from the 2nd parent. The remained cities will be used to fulfill the emptied cases in the child. d. Place the cities into the emptied positions of the proto child from left to right following the the same order.

Mutation Operator:
The main role of mutation step is to maintain diversity inside the population. Mutation operators [25] change the order inside one individual which helps to explore a new space and to avoid local minima's issue. In this paragraph, many mutation operators are described:

Insertion Operator:
The elite of the last generation are kept in the pool and will be inserted in the next generation without having undergone through the previous step.

Termination Operator:
Termination is a major part for the determination of an appropriate point in time to terminate the search. There are three popular termination strategies: -Termination after a fixed number of generations -Termination until solution meets the pre-set minimum requirement termination after reaching a plateau with no better results can be produced [26].

III. OUR APPROACH
In this chapter, we describe the main steps used in this algorithm to deal with traffic jam constraints.

Constraints:
Traffic jam is considered through the integration of constraints during fitness calculation. In this step, penalty is added to the cost of the distance between cities where traffic jam happened. The value of the penalty is important in order that this path will be eliminated during evaluation and future selection. This choice is done to simplify the algorithm and to reduce the execution time. In fact, penalty is easily applied to all genetic operators without any change to do.

Encoding and Decoding of TSP
A real integer coding method is used to encode chromosomes. Each chromosome consists of two parts: the first part describes cities path and the second part is dedicated to containing chromosome information's. These information's are used for statistical uses.

Fig4. The process of Order Crossover Operator
The International Archives of the Photogrammetry, Remote Sensing and Spatial Information Sciences, Volume XLIV-4/W3-2020, 2020 5th International Conference on Smart City Applications, 7-8 October 2020, Virtual Safranbolu, Turkey (online)

Initialization
This work implements a simple method to generate individuals with better quality in the initial population: diversity and possible solution. It consists of adding constraints during the random choice: The choice of the first city to visit is made randomly among all cities. On the other hand, the choice of the next city to visit will be made randomly among the closest remaining cities to the current cities rather than all remaining cities. This option will be fixed through proximity parameter, which is defined before the execution of the algorithm, thus making it possible to adapt it to each treated case.

Selection Operator
In this work, individuals' selection is based on their fitness value. If an individual has lowest fitness value, he has more chance to be selected into the matting pool. The selection process combines different methods: Population classification and a random choice through each class. During classification individuals are distributed: Winners, Elites, and the rest of the team. The winners are the three individuals with 3 best fitness value, the elites are the individual with top 10% value, the first league individuals are the one who has fitness value between 10 and 50%. The second league are the one remaining in the bottom. The elite of the last generation are kept in the pool and will be inserted in the next generation without having to undergo the previous steps.

Crossover Operator
During crossover, pairs of parents are selected from the mating population. These parents will exchange their gene according to crossover rules: The crossover happens with a defined probability Pc. If it is applied, genes will be exchanged between the two parents to create new children who inherit their properties. If it is not applied the two parents are transferred to next step without any change.

Mutation Operator:
Reverse section mutation operator will be applied to the chromosomes. The chromosome will be chosen with probability Pm. If it's applied, genes will be reorganized as described in RSM operator above.

Insertion Operator:
The elite of the last generation are kept in the pool and will be inserted in the next generation without having undergone through the previous step.

IV. RESULTS AND DISCUSSION
MATLAB is used for programming. The program is tested in two times.
Here are the details from the implementation: (1) Population size = 100.

Initialization
To test initialization step, the executions were applied, with iteration max equal to zero, to three benchmarking instances: A280, Eil 76 and Berlin52. They were also applied to a realworld problem.

Case: A280
The choice for A280 was done for its 280 cities and its complexity. Figure9 presents an example of finding just after the first iteration. The results show that the closeness gives better results in the first instance. In the table1, the value with closeness option is better than with random initialization.

Restriction constraints
Restriction constraints were tested on the same benchmark instances. During the execution, we have changed the restricted paths 20 times to see if the restricted path were proposed as a best chromosome in any iteration.

Case: A280
The best value obtained is 3001.39. During the execution in any case the restricted path was confused with the best tour proposed. Also, the execution was similar to the case without restriction proving that penalty technique keeps the algorithm performance stable.

Case: EiL76
EiL76 is well-known for its instance. Figure 13 presents an example of finding. During the execution, the restricted paths were separated from the current tour.

Case: Berlin52
Berlin52 optimal tour is 7544. The algorithm maintains the same results as with other instances. Fig 14 shows an example of results obtained. The restricted route is colored in red and the path found is in blue. The restricted has never been confused with the path proposed during all the execution.

Case: Casa52
The algorithm was also tested on real case in Casablanca. Fifty-two distribution points were chosen in many areas in the cities. The algorithms were tested to check the possibility to respect the restricted paths.

V. CONCLUSION:
In this paper, we studied the effect of three techniques in the performance of genetic algorithms. The considered techniques were the nearest neighbor through the closeness option during the initialization, the elitism during the selection and the constrains when a path is restricted due to traffic jam.
We noticed that the closeness option improved the quality of the first generation which impacted the execution of the algorithm. We also noticed that the use of penalties simplifies the programming. In fact, penalty make the program independent from the genetic algorithm operators. For future research, our algorithm can be improved to produce more strong solutions, which means that the restriction can take in consideration other constraints such as time window, the footprint or salesman capacity. The International Archives of the Photogrammetry, Remote Sensing and Spatial Information Sciences, Volume XLIV-4/W3-2020, 2020 5th International Conference on Smart City Applications, 7-8 October 2020, Virtual Safranbolu, Turkey (online)