SOLVING THE PROBLEM OF VEHICLE ROUTING BY EVOLUTIONARY ALGORITHM

In the presented work the vehicle routing problem is formulated, which concerns planning the collection of wastes by one garbage truck from a certain number of collection points. The garbage truck begins its route in the base point, collects the load in subsequent collection points, then drives the wastes to the disposal site (landfill or sorting plant) and returns to the another visited collection points. The filled garbage truck each time goes to the disposal site. It returns to the base after driving wastes from all collection points. Optimization model is based on genetic algorithm where individual is the whole garbage collection plan. Permutation is proposed as the code of the individual.


INTRODUCTION
Many companies in manufacturing, trading and providing various services faces the problem of the proper organisation of the distribution of their products or access their customers' network .The most often undertaken issue of this type in literature is the problem of one salesman, also known as the travelling salesman problem (TSP).The essence of this issue can be exemplified by the work of a commercial agent as follows.The sales representative of a company goes out of his office to visit a set number of customers.He must visit all his customers and do this precisely once, and then return to the office.The order of visits to individual customers is optional, however, the goal of the sales representative is to select the shortest road.If the road of the travelling salesman is presented in a form of a graph, the solution of the salesman's task is the Hamilton cycle, that is the cycle in the graph, in which each vertex of the graph is visited only once (apart from the first vertex, which is the beginning and the end of the journey) (Figure 1).Finding the Hamilton cycle with the minimal sum of the edge weights is equivalent to the solution of TSP.
TSP is of a combinational nature and belongs to the NP-complete problems [16], what means that despite a very simple definition, in case of a large number of vertices, it is practically insoluble in a reasonable period of time.If we assume that the distance between the customer A and customer B is different than the one between the customer B and customer A, the sales representative visiting only 10 customers can choose one of over 3.6 million routes.For the set number N of the visited customers, the number of routes possible to perform is (N-1)!.
As the interest grows and in the light of the progress in solving problems of the salesman, the attempts to use this group of models were undertaken more often to solve more complicated problems.The fact that the salesman problem has many applications is undisputed, however, in the implementation of the distribution process we often use more than one means of transport.In this case this problem consists of determining the routes for more than one salesman.If the problem applies to m salesmen, the solution of the msalesmen problem is not a single Hamilton cycle, but m cycles, where each one begins and ends in the determined city, thus for all salesmen (Figure 1).In addition, it is assumed that no salesman can visit cities served by other travellers.
In the operational researches, the problem of one salesman can thus be treated as a specific case of the problem of many salesmen, also called the vehicle routing problem (VRP), which definition establishes that m vehicles initially placed in the depot has to deliver in the specified area separate amounts of goods to n customers.Determining the optimal route for the group of vehicles with the service of the group of users is the VRP problem.Fisher [10] describes VRP as the task of finding "the efficient use of a fleet of vehicles that must make a number of stops to pick up and/or deliver passengers or products".The aim for solving such a task is to minimise the total transport costs.The solution of the classical VRP problem is a set of routes, which begin and end in the depot, and this meets the limitation that all customers are serviced only once.Transportation costs can be improved by reducing the total distance travelled by vehicles and reduction of the required number of vehicles.Since VRP belongs to the NP-difficult problems, it is usually solved using heuristic methods, which do not provide the best solutions, but enable finding satisfactory solutions in the accepted period of time.Accurate algorithms can be effective only in case of problems with a relatively small number of customers and vehicles.
The VRP class of tasks can be defined in terms of optimisation involving the appointment of the solution of the m-salesmen problem taking into account additional conditions depending on the specific task.The first ones to formulate the issue from this class under the name of truck dispatching problem were Dantzig and Ramser [7] modelling it in a form of the fleet of identical trucks used to supply several gas stations with liquid fuels with the minimal travelling distance in terms of the central base.They formulated the mathematical approach to the problem and published the algorithm of this solution.Another pioneering work is the article published by Balinski and Quandt [4], in which the authors generalised the VRP task to the form of linear optimisation, which is commonly encountered in the area of transport means management: i.e., how to serve a set of customers geographically scattered around the centrally located based using the fleet of trucks of different capacities.
VRPs are all around us, in the sense that many consumer products, such as soft drinks, beer, bread, gourmet food, fuel and medicines are delivered to retail outlets by a fleet of trucks, whose work is organised according to the prescribed plan of the vehicle movement.Public services can also use these systems in order to improve their logistic chain.The export of waste or cleaning the town take up an increasingly bigger part of the budget of local authorities.VRPs are also related to the effective use of resources of the company rendering transport services, and thus they are an important factor in reducing the costs of its operation and increasing the economic effectiveness of business operations.Such a wide use in practice makes VRPs be recognised as one of the most important problems in the field of transport, distribution and logistics.For example, Laporte [14] presents a classic definition of VRP, "the problem of designing optimal delivery or collection routes from one or several depots to a number of geographically scattered cities or customers, subject to side constraints" and discusses some approximated algorithms for solution of these tasks.
The above presented basic task of VRP is the starting point for formulating other problems, which are the modification of the basic task.This is why the majority of real tasks of planning ve-  In case of the task with the limited capacity of vehicles it is assumed that each of the m vehicles has a limited capacity (most often the same).When travelling, vehicles take loads in the next points, however, it is unacceptable to take a greater amount than it results from the adopted capacity constraints.In case of CVRP the task of the company is thus to provide all customers with the desired amount of goods in such a way as to meet all of the following conditions (Figure 1): • each customer can be visited only by one vehicle, which will provide the whole desired amount of goods; • the capacity of each used vehicle cannot be exceeded; • the sum of costs (or lengths) of routes covered by all vehicles used for this purpose must be as small as possible.
In such formulated CVRP issue there may be a few optimisation problems, e.g.: • division of all recipients of goods into subsets (set partitioning models), from which each one will be assigned to one vehicle, which is owned by the company; • determining the order of deliveries within the subset, assigned to each vehicle used by the company, that is determining the vehicle flow (vehicle flow models).
From the statement published by De Jaegere et al. [8] it results that the tasks of the CVRP type in recent years were the most often studied problems in the area of VRP problems.It is rarely assumed that vehicles are incapacitated, except in cases where it is considered that one vehicle has insignificant sizes, e.g.[9].The latest studies were published in: [2,3,6,12,18,19,20,26,21].
The recently published works indicating the new variant of CVRP; instead of minimising the whole distance (or travel time) treated as the goal, the sum of times of arrivals at the customers is minimized, e.g.[13,22,23].According to [8] this subject, cumulative capacitated vehicle routing problem (CCVRP), was devoted with 2% of publications.
In the open VRP (OVRP) it is not required for the vehicles to return to the main base/storage after the visit to the last customer (Figure 1).If they do not return, they have to visit the same customers in the reverse order.In addition, OVRP often has two optimisation goals: minimisation of the used vehicles and (with this optimum number of vehicles) the minimisation of the total distance (or time) of travel.In practice, an additional problem appears when the fleet of vehicles is not the property of the mere company rendering services or when the available fleet of vehicles is not able to satisfy the demand of its customers, so that (a part) of the activity related to distribution is ordered to the supplier of logistics of third parties (third party logistics, 3PL) [24].The OVRP solution indicates then the number of vehicles, which are needed to perform the service/order.Moreover, OVRP can be used in case of the pickup and delivery, when after delivery of goods to the given customers, vehicles receive the goods from the same customers, but in the reverse order [25].In real life, OVRP occurs, for example, in the case of delivery to home of packages and magazines [24], school bus [25], route of output in coal mines [27] or transport of hazardous materials [17].
According to the statement published by De Jaegere et al. [8] 6,25% of all publications on VRP contain OVRP as the main subject.Generally speaking, all articles contain limitations of capacity for vehicles; in addition, more than half of articles includes limitations of the distance or time.All works, except for one [15], assume a uniform fleet of vehicles and all except for [5] adopt deterministic requirements.All proposed methods of the solution are meta-heuristics, except for one [15] assume a uniform fleet of vehicles, and all except for one [27] were tested on the benchmark, the one adopted from literature or developed by authors.
Besides the fact that problems of the VRP type are among the most important problems of operational researches, in practice VRPs are also ones of the most difficult problems to be solved.
They are very close to one of the most known combinational optimisation problems, the travelling salesperson problem (TSP), where only one person must visit all customers.Because TSP is a NP-difficult task, some researches formulate an opinion that we will never find the computational technique, which will ensure the optimal solutions of such tasks, especially in case of large dimensions of the formulated tasks.VRP is even more complicated.Even for small fleets and the moderate number of visited points, the planning task is very complex.Therefore, it is not surprising that people involved in planning often turn to simple, local rules of vehicle routing.
Attempts to formulate the VRP tasks possibly close to real conditions usually lead to nonlinear tasks of combinatorial optimisation with many limitations, and most of the solution methods proposed so far cannot be effectively used for real tasks.Generally, meta-heuristics ensure much better solutions in real cases of large scale tasks.Gendreau et al. [11] discuss the use of meta-heuristics for VRP.
A characteristic feature of vehicle routing problems is the ease of formulation of a specific problem, as opposed to its solution.Hence, these issues interest many researchers, what results in a significant number of proposed algorithms for searching the best solutions.An interesting alternative for the most popular methods of solving tasks of vehicle routing are evolutionary algorithms.These are methods intended primarily for solving the optimisation tasks, however, they appear to be particularly useful in case of issues of the combinatorial nature.VRP solutions usually assessed by means of such dimensions as: the total cost, distance, time of travel, number of used vehicles.Such a task should be treated as a multicriteria optimisation task.In the paper we will confine ourselves to solving a one-criterion task of minimising the distance.The multi-criteria optimisation task will be solved in the next publications.The authors also plan to undertake studies to search for an optimal solution of the task using many vehicles.
VRP is the NP−difficult task of the combinatorial optimisation, which can be solved exactly only in the case of small-sized task.Although the heuristic approach does not guarantee optimality, it gives satisfactory results in practice.In the last twenty years, meta-heuristics appeared as the most promising direction of studies for the family of VRP tasks.

PROBLEM FORMULATION
It is assumed that the research subject will involve the company, which provides services related to the collection and management of municipal waste, construction and industrial wastes, electrical and electronic equipment waste, recyclables, bulky waste.The presented work formulated the problem of the collection of waste from containers located in a certain number of collection points located in different places of the adopted area by one specialised vehicle/garbage truck.It was assumed that in the adopted spatial area a perpendicular net was placed, whose sections represent the potential sections of vehicle routes.In the selected grid nodes there are containers, where the determined volume of waste is located.It was assumed that the garbage truck, with the adopted capacity of the trailer, collects the load while driving through next (according to the movement plan) collection points.After filling the trailer in a degree preventing the service of the next point, the vehicle stops its waste collection and drives the waste through the shortest path to the disposal side or garbage utilisation location to dispose the trailer.The empty vehicle returns to the adopted area and begins the next working cycle visiting other collection points and collecting waste in them.After each filling of the trailer, the full garbage truck drives to the place of storage of disposal.The garbage truck returns to the base point after collecting and driving to the storage or disposal place waste collected in all reception points.Such a formulated task is a VRP task and in particular it has features of two VRP types: capacitated vehicle routing problem (CVRP) and open vehicle routing problem (OVRP).Doubts can be raised by the fact of classifying the formulated task to the VRP class, if only one vehicle participates in the movement, as it happens in case of the travelling salesman problem (TSP).However, it will be demonstrated that the solution of the formulated problem is the plan of the garbage truck operation with the nature of the cycle collection, which can be successfully serviced by several vehicles in parallel.

MATHEMATICAL MODEL
Formulation of the mathematical model of the waste collection by the garbage truck prob-lem was initiated from adopting the following assumptions: • unsorted household waste will be collected in the collection points, • waste will be collected within one working day, • for the collection of waste one specialised vehicle will be used, a garbage truck, with the fixed capacity of the container V, • the number of waste collection points N is fixed, • the volume of waste v 1 , v 2 , ..., v N , which should be collected from the collection points on the given day are random variables, and after the adoption these values are established and constitute the model parameters, • each collection point can be served by the garbage truck with the assumed capacity of the trailer: 1, 2,..., : • during the whole process, the garbage truck visits each collection point only once, in order to collect the whole volume of waste accumulated at a given point, • the base point and collection points are located on the plane, and their location is given by the Euclidean coordinates (the beginning of the Cartesian coordinate system is located at the base point with Euclidian coordinates (x 0 , y 0 ), collection points in the points with coordinates (x 1 , y 1 ), (x 2 , y 2 ), ..., (x i , y i ), ..., (x N , y N ) and the disposal site in the point with coordinates (x N+1 , y N+1 ); coordinates of points are determined in the task and constitute the parameters of the optimisation task, • the need to refuel and the occurrence of other interference of the garbage truck operation during the whole process of waste collection are omitted, • the occurrence of potential traffic problems is omitted: congestion, repairs, breakdowns, detours.
It is assumed that the road infrastructure, which will be used by the vehicle, is fixed and known.So you can determine the distance between points with the empirical or theoretical method.Mutual distances between the base point and the collection points, between the collection points and the disposal site, and the collection points are known and they can be written down in a form of the distance matrix.The general distance matrix takes the form of: known.So you can determine the distance between points with the empirical or theoretical method.Mutual distances between the base point and the collection points, between the collection points and the disposal site, and the collection points are known and they can be written down in the form of the distance matrix.The general distance matrix takes the form of: Distances determined empirically are of course more accurate, as they take into account the real course of routes.For the purposes of the undertaken studies we used distances determined Distances determined empirically are of course more accurate, as they take into account the real course of routes.For the purposes of the undertaken studies we used distances determined theoretically based on Cartesian coordinates of the points.Depending on the adopted metrics, these distances can have various values.The commonly used distance measure in the Euclidean space is the Minkowski metrics in a form of: ..., , 1 : Adopting the Minkowski metrics, it is assumed that the distance between the points is symmetrical (d i,j = d j,i ).It is a general metric, where r constitutes the parameter.For r = 1 the Minkowski metrics takes the form of the taxicab distance, while for r = 2 the form of the Euclidean measure.In case of waste collection within the city, it is advisable to adopt the taxicab distance (also called Manhattan).The distance of two points in this metrics is the sum of absolute values of differences of their coordinates: ..., , 1 : ..., , 1 : The characteristic feature of the taxicab distance is the fact that for the determined pair of points (i, j) there may be many different paths with the length of d i,j .These are the shortest roads (i.e.minimal) and it does not matter which will be chosen by the driver (Figure 2).
The formulated optimisation task should include: decision variables, optimisation criterion, limitations, parameters.

Decision variables
VRP formulated in the paper is brought down to the selection of permutation of the collection point numbers.The number order vector of these (2) points is determined as follows: 1, 2,... , ,.
, : 1, 2, .. ., .., , The interpretation of the decision variant represented by vector p requires consideration of the garbage truck capacity V and the capacity of waste in the collection points: v 1 , v 2 , ..., v N .In general, the whole waste collection process is divided into three cycles (Fig. ...
, and then goes through the minimal route from the point numbered 1 I p to the disposal site.
• Cycle c ∈ {2, 3, ..., C}: starting from the disposal site, the garbage truck visits the collection points numbered In each cycle the garbage truck visits as many collection points, so the total capacity of waste does not exceed truck capacity.At the same time, it seeks the maximal fill of the working space of the garbage truck.As a result, for the fixed cycle c and index I c-1 in vector p of the last number of the point visited in the previous cycle (this is number This is the index satisfying the condition: The C cycle differs from the previous ones in that the waste amount collected by the garbage truck is the residue remaining in the collection points and can fill only a small part of the cargo space.The string of indices is written in a form of a vector: I = (I 1 , I 2 , ..., I C ).
The algorithm performing the decoding operation of the decision variables vector p on the real plan of collection and export of waste can adopt the form presented in Figure 4.
During next iterations i = 1, 2, ..., N the state of the garbage truck load z is controlled.If it exceeds the volume V, then the cycle end index is determined, as well as the number of the next cycle and the new load state.Reaching the last iteration (i = N) allows to determine the number of all operation cycles of the garbage truck C.

Optimisation criterion
The optimisation criterion is the minimisation of the whole route covered by the garbage truck during the process of waste collection from all points and their delivery to the disposal site.The base point is the starting and ending point of the path.For the determined vector of permutation of collection points numbers p, using the decoding algorithm (Figure 4) and the given distance matrix D (formula 2) it is possible to calculate the total length of the route travelled by the garbage truck: ...  The above sum was written in a way that facilitates the identification of subsequent work cycles (rows 1, 2, ..., C of the equation) and the route back to the base (the last row).The first component of the sum (8) is the distance from the base to the first collection point.Further components in the first column represent distances from the landfill to the first collection point in the cycle or to the base (the last component).In the last column there are distances from the last collection point visited during the cycle to the landfill.
The optimisation criterion in the selection process of the permutation vector p is the minimisation of the route length L(p).The adoption of this criterion enables writing the function of goal in a form of: ( ) The implementation of the above criterion ensures integration of planning of individual work cycles.The unfavourable phenomenon of not filling the garbage truck capacity in the cycles is punished by the adopted criterion by the increased number of cycles and as a result the prolongation of the total route.

Constraints
The set of feasible solutions is the set of all permutations of the set of collection point numbers {1, 2, ..., N}.Each permutation is allowed.As a result, the space of searching includes n! of decision variants.So, here we can see the effect of explosion of the search space with the increase of the number of collection points.
The standard capacity of the garbage truck is in the range between 18 and 22 m 3 .The waste container has the volume of 1.5 m 3 .In the single collection point there are most often two containers.This means that in each collection point there are at most 3.0 m 3 of waste.

OPTIMISATION METHOD
The problem is combinatorial in nature.For this reason, it is advisable to use the evolutionary algorithm, as the search method for the optimal solution.In this case this solution involves the permutation of collection points numbers arranging them in the order of garbage truck visits.
The permutation coding of the travelling salesman problem is the standard approach [1].The subject is represented by the string of N numbers, which is a permutation of the set {1, 2, ..., N}.The proposed evolutionary algorithm contains the following genetic operators: • generating the first population by drawing a random even number G of random N-element permutations, • assessment of the adaptation of individuals based on the objective function (9).The determined even number E of the best adapted individuals in the population is treated as an elite, • the selection of parents from the population with the proportional method (roulette).There are GE pairs of parents drawn.Each pair of parents generates one child, • crossing chromosomes of parents with the "order crossover" method.The chromosome of the child is generated according to the scheme: -drawing the crossing point, -the part of the parent chromosome 1 to the left (or right) from the crossing point remains unchanged, -the second part of the chromosome is sorted according to the order of occurrence in the parent chromosome 2. • the mutation of child chromosome involves drawing the pair of genes (numbers of collection points) and changing their places in the permutation vector p.The mutation takes place with a certain probability, • the recording of the next population as the sum of the set of elite individuals and the set of offspring subjected to the mutation operator.
After filling the set of offspring with elite individuals, the new population has G individuals.

EXAMPLE STUDY
Using the previously formulated optimisation model of the VRP task, the calculation example was used assuming 72 collection points distributed with the base point and the disposal site on the grid measuring 20 to 35 units.The randomly adopted coordinates of the collection points and the waste volume in these points are presented in Table 1.
The base point has coordinates (0, 0) and the disposal site (20,35).Based on points coordinates it is possible to determine the distance matrix D. The Manhattan measure was adopted.
After conducting test calculations for different values of parameters controlling the algorithm it was assumed that the satisfactory convergence was achieved by the evolutionary algorithm for the following parameters: • number of the populations: G = 40; • number of elite units: E = 6; • probability of mutation: 0.2; • roulette scaling exponent: 2.
In Figure 5 the history of adaptation function evolution is presented.
It can be seen that in the course of the simulation, the function achieved saturation.The whole time of simulation was used to improve the adaptation function, what means the ongoing improvement of the best solutions searched by the algorithm.The lowest function value was obtained in the 4132 generation.The variant with such a function value was adopted as the searched optimal variant.The objective function value (route length) for the above solution is: L = 612 m.The best found solution is the following order of the visited collection points with the division into 6 cycles (B -base point, D -disposal site): The algorithm was implemented in the form of the computer program developed in the en-vironment of the Matlab program.The PC class computer (3 GHz, 4 GB RAM) performed calculations of one simulation for about 10 seconds.
The optimal route of the garbage truck was shown in Figure 6.Each cycle is marked with different colour.After ending the sixth cycle, the garbage truck returns to the base point.
The garbage truck loading condition in each cycle changes with the visit of next collection points.After ending the cycle, the garbage truck unloads waste in the disposal site and its loading condition returns to the level 0. In Figure 7 the dynamics of the loading condition was presented for the optimal solution.As it can be seen, in each cycle the garbage truck gets the level of loading close to maximal V = 18 m 3 .
It can be noticed that the order of execution of the starting and ending cycles in the disposal site does not matter.In the considered example there are 5 such cycles, so the agreed optimal plan can

CONCLUSIONS
The article presented the concept of the planning model for the order of waste collection by the garbage truck from the pre-set collection points.The model is based on the mechanism of searching the space of points numbers permutation.The evolutionary algorithm was used for random searching of the focus.It was shown in the example that it is convergent with the optimal solution and that the criterion of the minimisation of the garbage truck route distance simultaneously leads to the fullest loading of the vehicle in The proposed model is based on the assumption that we know the amounts of waste waiting in collection points.In practice, it is problematic to forecast these amounts.On the one hand, these are random variables and the forecast of their value can be performed only with a certain probability.On the other hand, one should consider the fact that waste is crushed by the garbage truck, so their volume is changed.The degree of compressing waste is also a random variable, which depends on the type of waste.
The problem of forecasting the amount of waste in the collection points can be partially solved by using the monitoring system of the container content mass.Sensors can be placed, for example, in the elements of the drive chassis.However, it is an expensive solution.Such sensors would have to have the opportunity to send information remotely.The degree of waste compression is a variable, whose forecast can take place only based on historical data and the developed statistical distributions.
An alternative approach for solving the above problems can be the use of the dynamic algorithm updating the garbage truck path after visiting each collection point and verifying the real condition of the waste loading.Such an algorithm will be the subject of considerations and next publications of authors.
The presented model is the result of preliminary considerations of the authors.It does not include a number of complications occurring in practice, for example: the limited work time of the garbage truck staff, the need to refuel, the occurrence of other interference of the garbage truck work during the whole waste collection process, the potential traffic problems (e.g.congestion, repairs, break-downs, detours).The one-criteria optimisation task was formed and solved, while the undertaken decision problem in reality is the multi-criteria problem (e.g. the minimisation of the number of used vehicles and the minimisation of the working time of one vehicle).
It is planned to establish contact with companies involved in waste management in order to identify conditions of the implementation of the optimisation model in practice.In addition to the analytical capabilities of the system, it will be necessary to take into account the issues of users' interfaces, the way of data recording and communication between the disposition centre and vehicles.

Fig. 1 .
Fig. 1.Graphic illustration of feasible solutions for tasks (from the left): travelling salesman problem (TSP), vehicle routing problem (VRP), open vehicle routing problem (OVRP); circles mean bases, squares mean customers 3.):• Cycle c = 1.: the garbage truck starts from the base point, visits I 1 collection points with filling of the trailer it goes to the disposal site.Numbers I 1 , I 2 , ..., I C are the border indices of elements of vector p.After receiving waste from the the disposal site.
possible to determine the index I c of the number c I p of the last visited point in the cycle c.
indices I c are determined recursively starting from c = 1.The number of cycles is determined dynamically during calculations of subsequent indices.The number of the last cycle is calculated when for some cycle numbered c waste collected in all other collection points fit into the garbage truck: 1 1,2,...:

Fig. 3 .
Fig. 3.The idea of the waste collection process divided into cycles adopted in the paper

Fig. 2 .
Fig. 2.An example of four different minimal routes with the taxi length equal 6 between the same points

Fig. 4 .
Fig. 4. The algorithm used in the paper generating the border indices of connection points numbers ending the garbage truck operation cycles

Fig. 5 .
Fig. 5.The adaptation function evolution history during the simulation running in accordance with the developed algorithm

Fig. 6 .Fig. 7 .
Fig.6.The optimal route of the garbage truck found in the paper, which collects waste in agreed collection points (collection points are marked with red squares in grid nodes and numbered: 1., 2., 3., etc.)

Table 1 .
The list of adopted collection points, their coordinates and waste volume Coll.point Coordinates Waste volume Coll.point Coordinates Waste volume Coll.point Coordinates Waste volume