**1. Introduction**

The improvement of the waste collection process can be considered aligned with the 11th Sustainable Development Goal (SDG) "Sustainable cities and communities" [1]. Nevertheless, this process is still far from being in an optimal status. As experts state [2], inadequate vehicle routes are among the problems the process should tackle. The optimization of the routes for waste collection vehicles with time window is known as the Waste Collection Vehicle Routing Problem (WCVRP).

As indicated by Caria, Todde, and Pazzona [3], the WCVRP is a specific case of the whole class of problems, known as the Vehicle Routing Problem (VRP). The oldest VRP type problem in the transport history is the Travelling Salesman Problem (TSP), solved for the first time by Lin [4], where the aim is to find the shortest route visiting each member of a collection of locations and returning to the starting point. The TSP has evolved towards solving similar problems with different and additional restrictions and objectives, including the WCVRP presented herein.

The WCVRP needs to organize routes, vehicles, and customers, while respecting the constraints that are imposed by the system. VRP allows for reaching the goals that are referred to as transport logistics, as well as the minimization of costs and carbon dioxide (CO2) emissions [3]. On top of the overall VRP considerations, WCVRP is concerned with finding cost optimal routes for garbage trucks such that all garbage bins are emptied and the waste is driven to disposal sites while respecting customer time windows and ensuring that drivers are given the breaks that the law requires. The first waste collection problem was probably presented by Beltrami and Bodin [5]. Since then, the problem has evolved into the herein presented WCVRP. Many relevant references have studied this problem so far, offering different approaches for solving the same challenge (or similar ones). Concerning the most relevant and recent ones, Buhrkal, Larsen, and Ropke [6] propose an adaptive large neighborhood search algorithm for solving the problem. Babaee Tirkolaee, Mahdavi, and Seyyed Esfahani [7] apply an improved hybrid simulated annealing algorithm (SA) for optimizing the mathematical model developed. Hannan et al. [8] propose a particle swarm optimization algorithm to optimize a model that considers not only typical distance, total waste, collection efficiency, etc. parameters but also Threshold Waste Level (TWL) tightness factors. De Bruecker et al. [9] present an enhanced model for the WCVRP that models distinct labor cost types and collecting speeds; thus, they differentiate between cheaper regular shifts during traffic peak hours, against higher collection speeds but with expensive, non-regular shift-rates. Rodrigues Pereira Ramos, Soares de Moraisa, and Barbosa-Póvoa [10] study three operational management approaches to define dynamic optimal routes based on sensoring, Radio Frequency Identification (RFID), and considering the access to real-time information on the bins' fill-levels. Benjamin and Beasley [11] develop a model for the waste collection vehicle routing problem with time windows, driver rest period, and multiple disposal facilities as a differential aspect.

It is worth mentioning that the sometimes explicit, but always present idea of this optimization problem is the reduction of CO2 emissions, as the current logistic methods used in this routing problems depend strongly on fossils fuels [12].

The fact of not having generalized optimized routes for the WCVRP is striking, as many solutions for this process can be found in the literature. When analyzing the potential causes of this breach between the practitioners and the academia, it could be stated that generic routing tools are considered incomplete for this variant of the traveling salesman problem [13], whereas more specific tools (such as [14,15]) have a related cost that often entities are not willing to afford. Additionally, many researchers developed their solutions to the problem, but normally they are more focused on publishing them than in offering them to entities that manage the waste collection. Thus, even though the problem has been deeply studied from a theoretical point of view, its application to real-world problems is scarce.

Within this context, the aim of this work has been to show the development and implementation of a procedure for the optimization for a local commonwealth for tackling the WCVRP of a region.

In the final solutions, Genetic Algorithms (GAs) have been applied. GAs belong to the more general classification of evolutionary optimization techniques or evolutionary programs and they are surely the most widely known type of Evolutionary Algorithms. They are based on selection, crossover, and mutation principles of Darwin's theory of evolution. In the last few years, there has been a growing effort to apply GAs to general constrained optimization problems as most of engineering optimization problems often see their solution constrained by a number of restrictions imposed on the decision variables [16].

The research method had three major steps: first, we performed a literature review of optimization algorithms applied to this case that is detailed in Section 1. The aim of this study was to analyze how this problem was modeled in the past, and to pre-select which types of algorithms could fit best to the end user requirements in terms of user friendliness, cost, and quality of results. Second, the characteristics of this specific optimization case (detailed in Section 2) were analyzed to offer the company a selection of the algorithm fitting best to its requirements. Finally, the designed solution was successfully implemented and tested with the pre-selected types of algorithms, to choose the one performing best, as it is detailed in Section 3 Methodology, Section 4 Algorithm, and Section 5 Results, remarking that the obtained results raised the interest of the surrounding communities.

### **2. Optimization Problems**

Combinatorial optimization problems can be written mathematically as:

$$\text{minimize } f(\mathbf{x}), \tag{1}$$

$$\text{subject to} \quad h\_i(\mathbf{x}) \ge a\_{i\prime} \quad i = 1, \ldots, m,\tag{2}$$

$$f\_j(\mathbf{x}) = b\_{j\prime} \quad j = 1, \ldots, s\_\prime \tag{3}$$

where *<sup>f</sup>* : <sup>R</sup>*<sup>n</sup>* <sup>→</sup> <sup>R</sup> is the objective function, and *hi* : <sup>R</sup>*<sup>n</sup>* <sup>→</sup> <sup>R</sup>, *<sup>i</sup>* <sup>=</sup> 1, ... , *<sup>m</sup>* and *fj* : <sup>R</sup>*<sup>n</sup>* <sup>→</sup> <sup>R</sup>, *<sup>j</sup>* <sup>=</sup> 1, ... ,*<sup>s</sup>* are the constraints.

The optimization problem has been written as a minimization problem, but after some modifications it can be written as a maximization problem:

$$\min \mathbf{g}(\mathbf{x}) = \max -\mathbf{g}(\mathbf{x}).\tag{4}$$

In the same way, the equality constraints *fj*(*x*) = *bj* can be written as inequalities:

$$f\_j(\mathbf{x}) \ge b\_j \text{ and } f\_j(\mathbf{x}) \le b\_j. \tag{5}$$

The simplest constrained optimization problem arises when the objective function *f*(*x*) and the restrictions are linear functions. This type of problem is a linear programming problem, and it can be solved quite efficiently by the simplex algorithm. However, in the majority of the optimization problems, neither the objective function nor the restrictions are linear functions. The vast majority of these problems are NP-complete problems, which means that there is no any solving algorithm that can be executed in polynomial time in relation to the size of the problem. In complexity theory, NP-complete denotes the set of problems that are not solvable by a deterministic polynomial time algorithm. The feasible solutions' space is so large that the computation of the exact solution requires a lot of time. NP-complete problems can be solved by a restricted class of brute force search algorithms and they can be used to simulate any other problem with a similar algorithm. Genetic algorithms are also a good and efficient choice to find an approximate solution of these problems [17]. A classical NP-complete problem is the Travelling Salesman Problem (TSP), in which the shortest route for a traveling salesman starting and finishing in the same point and visiting every city once has to be found.

An efficient way to solve these types of problems is using genetic algorithms. The basic principles of genetic algorithms were established by Holland [18], and they are well described in several texts [19–23]. Owing to their simplicity, flexibility, ease of implementation, minimal requirements, fast convergence towards close-to-optimal solutions, and global perspective, GAs are successfully used in a wide variety of problems [16]. As these characteristics are essential for practitioners to have a utilizable solution, and as the performed literature review did not bring better solutions, the chosen option was to implement the simple GA (SGA) presented herein.

### *Traveling Salesman Problem*

In the TSP problem, a collection of *n* cities are given. The objective is to determine the shortest route that a salesman has to follow, in which each city is visited once and then the salesman returns to the starting point of the route. This problem can be defined mathematically as follows:

Given an integer *n* and an *n* × *n* matrix *D* = (*dij*) in which each *dij* is the distance between two cities, the cyclic permutation *π* of the integers *i* = 1, 2, ..., *n* that minimizes the distances has to be determined. As a first approximation, the feasible search space is formed by all cyclic permutations of the numbers {1, 2, . . . , *n*}:

$$F = \left\{ (\pi\_1 \pi\_2 \dots \pi\_n) \, | \, \pi\_i \in \{1, 2, \dots, n\} \text{ and } \pi\_i \neq \pi\_j \forall i \neq j \right\}. \tag{6}$$

The number of elements of this space is *n*!, being *n* the number of cities. In this way, the length of a permutation *π* = (*π*1, *π*2,..., *πn*) can be expressed as:

$$\sum\_{i=2}^{n} d\_{\mathcal{A}\_{i-1}, \mathcal{T}\_i} + d\_{\mathcal{A}\_n, \mathcal{T}\_1}.\tag{7}$$

For each permutation *π*, there are (*n* − 1) permutations that starting in a different city are similar to the given one. That is to say, the distance of these *n* permutations is the same. Taking into account this consideration, the size of the feasible space is *n*!/*n* = (*n* − 1)!. Moreover, if the distance matrix *D* is symmetric, the distance of each permutation in both directions is the same, and the size of the feasible space is reduced to (*n* − 1)!/2. As it can be observed, the main difficulty of this problem is the huge number of possible tours.

### **3. Methodology**

The objective of this work is to find an optimal itinerary for the waste collection. This methodology will be applied to the data of Sopelana, a municipality in the province of Biscay, autonomous community of the Basque Country (Spain). Sopelana is located in the region of Plencia-Munguia or Uribe, and it is part of the Commonwealth of Services of Uribe Coast. It has an extension of 8.40 km<sup>2</sup> and a population of 13,510 inhabitants, a figure that in summer is usually multiplied by four due to summer visitors.

It is the responsibility of the commonwealth everything related to waste management. There are various trash cans to collect waste:


Other types of waste such as big volume wastes are collected once per week following the same route as for the restwaste; there are eight points to collect lamps and fluorescent lightings and they are collected when the container is full; there are some locations in which CDs are collected when the containers are full. All the aforementioned data were given by the local government.

In this work, three problems of different sizes will be analyzed. In the three cases, the aim is to improve the waste collection itinerary in the sense of obtaining a shorter route than the one followed nowadays. A small problem of reusable waste with seven trash cans, a medium problem of organic waste consisting of 29 trash cans, and a big problem consisting of the first route of restwaste with a total of 186 trash cans will be considered. In the case of restwaste, there are several trash cans in the same location. Specifically, the 186 trash cans are distributed in 147 different locations; thus, these locations will be considered in the problem. The data of these problems can be seen in Table 1.


**Table 1.** Three problems analyzed.

According to the data given by the enterprise in charge of restwaste collection, between 8000 kg and 13,000 kg of restwaste are collected everyday in Sopelana. A truck is enough to carry out this collection. The truck used has a load of 13 tons, and it has a compaction mechanism. Each container has 1.1 m3, which is reduced to 0.183 m3 after compaction. This means that the volume of 125 trash cans that are full can fit in the truck (125 × 0.183 m<sup>3</sup> = 22.875 m3). In the event that the truck was filled during the collection of the 186 containers (147 location points), it would be emptied in the dump intended for it and, after that, it would continue with the route. However, this event is not very probable as it means that 125 trash cans out of 186 are full up (which is the 67.20%).

### **4. Algorithms**

For the three problems, the coordinates of the locations and the distance matrices have been calculated using Google Maps (https://www.google.com/maps, data from October and November 2019). The coordinates of all locations and the distance matrices can be found in Appendix A. The smallest distance between two locations has been considered in the distance matrices. The distance matrices are not symmetric, as the way back and forth from a location to another may be different.

The three problems have been solved using a VNS and a GA. The smallest problem (reusable waste, seven locations) has also been solved using the brute force algorithm. These two algorithms were chosen among all the set of alternatives for developing the final solution for maintainability reasons. The developers of the solutions are academic institutions, so we cannot provide maintenance services. As both literature [24] and the news [25] state, there is a lack of availability of computer science technicians. Because of this fact, the final user of the solution wanted a competitive but mainly easy to maintain algorithm. These algorithms being two of the most frequently applied when developing the syllabuses of subjects related to programming, the research team decided to compare them and offer the most effective possible solution. The distances that correspond to all the permutations of *n* = 7 elements have been calculated that is 7! = 5040. The process has been implemented as it is explained in Algorithm 1.


We have started by trying the VNS algorithm [26] for all the problems. The VNS consists of applying a local search method repeatedly in the neighborhood N*<sup>k</sup>* of the actual solution. When a local optimal is reached, the algorithm changes the system of neighborhood with the aim of escaping from local optima and reaching a better one. For this reason, it can be said that the VNS performs well both when searching local and global optima. In Algorithm 2, the process followed is explained. We have implemented two systems of neighborhoods: the 2-opt neighborhood and a swap-based neighborhood. The neighborhood structure 2-opt consists of changing a pair of edges between cities [27]. The swap-based neighborhood that we have created swaps the first element of the permutation with all the rest.


Additionally, for all the problems *n* = 7, *n* = 129, and *n* = 147, another two algorithms have been implemented. In Algorithm 3, an initial population of *m* different individuals (permutations) has been created. The evaluation function (distance of the route) of each individual has been calculated. In each generation, the process of selecting two parents randomly, the crossover operator, the posterior correction of the individual in order to be a permutation, and the mutation process have been performed *m*/2 times. If the new descendants are different from the individuals of the population and if their evaluation function (fitness function) is smaller than the worst (the largest) of the population, the worst individuals are replaced by these new descendants. The fourth algorithm implemented only differs from the third in the fact that the routes followed nowadays in the trash collection (one route in each problem) are inserted as a seed in the initial population.


The crossover operator used is the classical one [18]. A crossover point is selected randomly from which the two strings of the parents are broken into separate parts. The new descendants are formed by recombination of these parts. For example, consider *n* = 7 and the routes:

$$(1\ 2\ 3\ 4\ 5\ 6\ 7)$$
 
$$(2\ 4\ 5\ 3\ 7\ 1\ 6)$$

Randomly, a crossover point in which the strings are broken into separate parts is selected. Suppose that the crossover point is chosen between the third and the fourth bit:

$$\begin{array}{c}(1\ 2\ 3\ \mid 4\ 5\ 6\ 7)\\(2\ 4\ 5\ \mid 3\ 7\ 1\ 6)\end{array}$$

Combining the head of the first route with the tail of the second route and vice versa, the result is the following:

$$\begin{array}{l}(1\ 2\ 3\ \mid 3\ 7\ 1\ 6)\\(2\ 4\ 5\ \mid 4\ 5\ 6\ 7)\end{array}$$

If the resulting descendants are not permutations, then a correction algorithm is applied in order to obtain two individuals that belong to the feasible space. Each resulting individual is repaired, by calculating the repeated values and their positions, and by inserting the missing values randomly on the positions where the repeated values are located.

The exchange mutation operator, also called the swap mutation operator, has been applied, in which two positions of the route are selected randomly and the cities on those positions are exchanged [28]—for example, if we consider the route:

$$(1\ 2\ 3\ 5\ 7\ 4\ 6),$$

and if we choose the fourth and seventh positions, the cities on those positions are interchanged:

$$(1\ 2\ 3\ 6\ 7\ 4\ 5)$$

### **5. Results**

In this section, the results obtained for each of the problems are presented.

For *n* = 7, the brute force algorithm has been applied first. The shortest itinerary has 7.67 km and the longest 13.2 km. In Figure 1, the distances of all permutations (7! = 5040) are shown. All the permutations are represented in the horizontal axis (that is, 7! = 5040), and the distance that corresponds to each of them is plotted in the vertical axis.

**Figure 1.** Brute force application, problem *n* = 7.

For the three problems, the VNS algorithm has been applied next. Ten executions have been done for each problem. The best, the worst, the mean, and the median distances of this executions are presented in Tables 2–4. In all the executions, an initial solution has been generated randomly.

**Table 2.** Results of 10 executions *n* = 7 problem, VNS.


**Table 3.** Results of 10 executions *n* = 29 problem, VNS.




In addition, finally, the SGA (without and with a seed) has been performed. For *n* = 7, taking into account that the average of the shortest and the longest route is 10.4350 km, the route (6, 7, 3, 4, 2, 5, 1) of 10.45 km has been chosen as seed. In the cases of *n* = 29 and *n* = 147, the actual itineraries have been chosen as seed. These data are available in Table 5. Notice that, if the VNS algorithm is started, taking the actual itinerary as initial solution, all the executions have the same performance. In this case, for *n* = 7, a route of 8.2500 km is obtained; for *n* = 29, a route of 18.7670 km; and, for *n* = 147, a route of 34.4280 km.


**Table 5.** Average distance route (*n* = 7) and actual routes (*n* = 29, *n* = 147).

An execution for each problem has been performed. Parameters have been chosen according to [29]: a relatively high crossover rate (≥ 0.6), small mutation rate (range [0.001, 0.1]) and a moderate population size. Data and results are presented in Tables 6–8. In all the cases, the execution in which the seed is considered obtains better solutions.

**Table 6.** Results of the *n* = 7 problem.






The longest, the shortest, and the average-distance itineraries for *n* = 7 can be seen in Figure 2. The limit of the municipality of Sopelana is marked using a thick red line.

**Figure 2.** Routes of problem *n* = 7, longest in red, shortest in green, "average" in purple.

Additionally, several executions have been performed for each of the problems (*n* = 7, 29, 147). The best, the worst, the mean, and the median distance of this performance are presented in Tables 9–11. The values of these tables are acquired after performing 10 executions for each version of each problem.


**Table 9.** Results of 10 executions *n* = 7 problem, SGA.

**Table 10.** Results of 10 executions *n* = 29 problem, SGA.


**Table 11.** Results of 10 executions *n* = 147 problem, SGA.


For the largest problems, *n* = 29 and *n* = 147, computation has been repeated choosing different parameters in order to obtain better results. The most important change is that a larger population size has been used, i.e., 4000 individuals. Execution data and results can be seen in Tables 12 and 13.





The actual itineraries are presented in Figures 3 and 4, and the improved itineraries of Tables 12 and 13 obtained with the new parameters in Figures 5 and 6. In the case of problem *n* = 147, Figures 4 and 6, the first and the last location of the route are marked in red.

**Figure 3.** Actual route of problem *n* = 29.

**Figure 5.** Smallest route obtained for problem *n* = 29.

**Figure 6.** Smallest route obtained for problem *n* = 147.

#### **6. Conclusions**

In this work, three waste collection itineraries have been improved in a municipality of Biscay (Spain). The average itinerary of the reusable waste (*n* = 7 problem) has had a reduction of 2.78 km; and the actual itineraries of organic waste (*n* = 29 problem) and restwaste (*n* = 147 problem) have been reduced 5.98 km and 19.194 km, respectively. Taking into account the collection frequencies of these three itineraries, this makes a total reduction of 7400 km per year, that is to say, a reduction of the 40% of the total actual itineraries.

The truck has a continent of 13 tons and it has a compaction mechanism. Considering the following average data for the truck: vehicle of 26 Tn, speed limit 30 km/h, with 270 CV minimum engine power (1 CV = 735.39, 875 W= 0.986 HP) and diesel fuel type and 29 L/100 km consumption [30]. This implies a reduction of 5.58 Tn of CO2 emissions, 0.43 Kg of CO, and 13.95 Kg of NOx per year. In addition to these improvements, a direct cost savings of 7294e was obtained (considering the direct cost per kilometer calculation model recommended by the Ministry of Transportation, Logistics and Urban Agenda of Spain [31]).

It is worth mentioning that the research team performed an additional validation for the developed model. Specifically, the actual consumptions versus the ones proposed by the model were analyzed at the two comparable routes (the ones the truck made before and after the optimization), obtaining negligible differences. This double check on the results and the easiness of the solution have raised the interest of other commonwealths, such as the one of Lea-Artibai. Thus, the short and midterm future steps would be oriented to the application of the same procedure to other local communities, incorporating other parameters such as the elevation information of the routes.

**Author Contributions:** E.A., writing, conceptualization, and investigation; L.U., conceptualization and investigation; A.G., investigation, writing and funding acquisition and A.O.-Z., writing and funding acquisition. All authors have read and agreed to the published version of the manuscript.

**Funding:** This research was funded by Fundación BBK, partner of the Deusto Digital Industry Chair.

**Acknowledgments:** We would like to thank the partners of the Deusto Digital Industry Chair (Etxe-Tar, General Electric, Idom, Accenture, Fundación Telefónica, Fundación BBK) the interest and support shown during this research. We would like also to thank the municipality of Sopelana and the commonwealth of the regions of Lea-Artibai for placing their trust and confidence in our organization.

**Conflicts of Interest:** The authors declare no conflict of interest.

### **Abbreviations**

The following abbreviations are used in this manuscript:


### **Appendix A. Data**

**Table A1.** Coordinates of the seven locations.


**Table A2.** Distances of the seven locations in kilometers.



**Table A3.** Coordinates of the 29 locations.



**Table A5.** Coordinates of the 147 locations.


**Table A5.** *Cont.*


**Table A5.** *Cont.*

The distances between the 147 locations can be found in [32].

### **References**


© 2020 by the authors. Licensee MDPI, Basel, Switzerland. This article is an open access article distributed under the terms and conditions of the Creative Commons Attribution (CC BY) license (http://creativecommons.org/licenses/by/4.0/).
