Vehicle Routing Problem with time windows Using Hybrid Encoding Genetic Algorithm

The vehicle routing problem is to determine K vehicle routes, where a route is a tour that begins at the depot, traverses a subset of the customers in a specified sequence and returns to the depot. Each customer must be assigned to exactly one of the K vehicle routes and total size of deliveries for customers assigned to each vehicle must not exceed the vehicle capacity. The routes should be chosen to minimize total travel cost. This paper gives a solution to find an optimum route for vehicle routing problem using H yb r i d E n c o d i n g Genetic Algorithm (HEGA) technique tested on c++ programming. The objective is to find routes for the vehicles to service all the customers at a minimal cost and time without violating the capacity, travel time constraints and time window constraints


INTRODUCTION I.1 HYBRID ENCODING GENETIC ALGORITHM
A S the standard GA is not suitable to implement Vehicle Routing Problem with Time Windows (VRPTW) in this study, new GA, called "Hybrid Encoding Genetic Algorithm (HEGA)" is developed for the problem of VRPTW.
The HEGA merges binary encoding that represent streets and integer encoding that represent customers. The creation of a new generation of chromosomes involves primarily four major steps: selection, crossover, mutation and reproduction. In the selection step, the roulette wheel selection was employed. In crossover step, only the one-point crossover for binary encoding was used. In mutation step, only the exchange mutation for integer encoding was performed and in reproduction step, the best chromosome is copied from the previous generation to the next one. The HEGA can be modified easily to handle VRPTW problem. The general structure of the HEGA can be described as in Fig  (1.1)

VEHICLE ROUTING PROBLEM
The Vehicle Routing Problem with Time Windows (VRPTW) which is an extension of Vehicle Routing Problems (VRPs) arises in a wide array of practical decision making problems. Instances of the VRPTW occur in rail distribution, airline distribution, school bus routing, mail and newspaper delivery and railway fleet routing and etc.
In general the VRPTW is defined as follows: V = {1, 2,…, K} , where V represents identical vehicles, a central depot node as D, a set of customer nodes C = {0,1, 2,…, N}and a directed network connecting the depot and customers. Each arc in the network represents a connection between two nodes and also indicates the direction it travels. The depot is denoted as customer 0, which uses K independent delivery vehicles, with delivery capacity q k , k = 1,2,…,K, to service demands m i from n customers, i = 1,2,…,N. time, if vehicles arrive earlier than the earliest arrival time, waiting occurs. Each customer also imposes a service time s i , taking consideration of the loading/unloading time of goods. A non-negative cost (distance or travel time) matrix C = (c ij ) between customers i and j is defined on the network. A solution for the VRPTW would be a partition R 1 , R 2 ,…, R K , representing the routes of the vehicles, each route R k is a permutation of the customers in C specifying the order of visiting them, starting and ending at the depot. The cost of the problem solution is the sum of the costs of its routes R k , defined as follows The VRPTW consists in determining a set of a maximum of K routes (i) of minimum total cost (Eq. 1); (ii) starting and ending at the depot denoted with customer 0 and such that (iii) each customer is visited exactly once by exactly one vehicle subject to the restrictions (iv) the total demand of any route R k does not exceed q k ; (v) each route R k must be completed within a total route time, which is essentially the time window of the depot; (vi) the vehicles must visit the customers within predefined time windows.
In this study, we consider the VRPTW and propose an HEGA for this problem.

DECODING USING HEGA
The representation of a solution we use here is a integer strength of length "N", where "N" is the number of customers. Each gene in the integer node number assigned to that customer originally. The sequence of the genes in the string is the order of visiting these customers.

FIG (2.1) Network without overlapping
In the above Fig (2.1) the representation is unique and one string can be decoded to one-one solution. It is a oneone relation. Form number of sub networks without overlapping for the problem to get an optimum solution. One such sub network is considered for example. The last customer visited in route "I" is linked with the depot. One string representing one cycle starts and ends in the depot. Each cycle have minimum of two possible routes say one in forward and in one in backward. To decode the string into route configurations the gene values are inserted in binary code format.

SELECTION OF PARENTS FROM POPULATION
The objective value is further calculated by using the objective function relating to each of the problem. In VRPTW low objective value is required for example the objective value matrix can be taken as  1 1 0 1 1 3 1 1 0 2 1 1 1 D  M a r c h 1 8 , 2 0 1 4 value to the chromosome that survive for the next generation and lowest fitness value to the one which is not be survived and remove it from the population. So only best fits will move to the next generation.

CROSS-OVER
From two selected parents cross-over is done and two off-springs are produced. As we have only binary codes to be crossed one point cross over is applied as defined in HEGA. Consider the following for example with parents and offspring"s as follows :

MUTATION
To perform mutation for the binary codes we used Exchange mutation as defined in HEGA between parents and offspring as shown.

REPRODUCTION
All offspring generated are sent to population and process repeated again copying the best chromosome under the following conditions:Travelling cost and time should be minimized on visiting each customer only once.


Travelling time should not be greater than the latest arrival time  The depot uses "K" independent delivery vehicles with capacity qk, qk >k is not allowed.

COMPUTATIONAL RESULTS:
We have implemented the above algorithm in C programming and got the following results

DISCUSSION
From the above output it is observed that the time required in calculating the shortest path is much lesser (milliseconds) by using HEGA. On comparing the result obtained with the previous results of the same problem by using various best algorithms such as in [2], [9] and [14]. The computational results show minimum time in HEGA algorithm to find the shortest path.
We got the above result on taking a sample input of population size (10), Number of generations (5),and variables (10) with binary coded integer, fitness value, cross-over probability and mutation probability as input vales. For selection of population size the program uses Rolutte wheel selection method and One point cross over and exchange mutation are applied to get the best shortest path in minimum time. The sample size (Population) can also be increased to have maximum possible runs with more generations.
In future the size of the chromosomes taken (binary coded) can be increased to get still best fit paths.

CONCLUSIONS
In this paper we have discussed the Vehicle Routing problem using Hybrid Encoding Genetic Algorithm. Various techniques of HEGA have been discussed in this paper to study Vehicle routing problem which is a permutation problem in which goal is to find the shortest path between customers visiting each customer at least once. This paper gives a solution to find an optimum route for VRPTW using HEGA technique, by selecting randomly the initial population. The new generations are then created repeatedly until the proper path is reached upon reaching the stopping criteria.