Research Article  Open Access
A Matheuristic Approach Combining Local Search and Mathematical Programming
Abstract
A novel matheuristic approach is presented and tested on a wellknown optimisation problem, namely, capacitated facility location problem (CFLP). The algorithm combines local search and mathematical programming. While the local search algorithm is used to select a subset of promising facilities, mathematical programming strategies are used to solve the subproblem to optimality. Proposed local search is influenced by instancespecific information such as installation cost and the distance between customers and facilities. The algorithm is tested on large instances of the CFLP, where neither local search nor mathematical programming is able to find good quality solutions within acceptable computational times. Our approach is shown to be a very competitive alternative to solve largescale instances for the CFLP.
1. Introduction
The capacitated facility location problem (CFLP) is one of the most important problems for companies which distribute products to their customers. The problem consists of selecting specific sites at which to install plants, warehouses, and distribution centres while assigning customers to service facilities and interconnecting facilities using flow assignment decisions. This paper considers a twolevel supply chain in which a single plant serves a set of warehouses, which in turn serve a set of end customers or retailers. Figure 1 shows the basic configuration of our supply chain. Therefore, we aim to solve this problem by finding a set of locations that allows us to serve the entire set of customers in an optimal way. As Figure 1 shows, each customer (or cluster) is served only by one warehouse.
The CFLP in this work contains a set of warehouses that supply a set of customers that are uniformly distributed in a limited area. The model considers the installation cost (i.e., the cost associated with opening a specific warehouse) and transportation or allocation cost (i.e., the cost related to transportation of a specific amount of products from a warehouse to a customer). The mathematical model for the CFLP is presented as follows:
Equation (1) is the total system cost. The first term is the fixed setup and operating cost when opening warehouses. The second term is the daily transport cost between warehouse and customers which depends on the customer demand and distance between warehouse and customer . Inequality (2) ensures that total demand of warehouse will never be greater than its capacity . Equation (4) ensures that customers are served by only one warehouse. Finally, (5) states (01) condition for the binary variables and .
While both heuristics and mathematical programming methods have been used to solve the CFLP, in this work we present a matheuristic method [1] that combines two wellknown algorithms: mixedinteger programming and local search. During the last decade, the idea of combining the power of mathematical programming with flexibility of heuristics has gained attention within researchers community. We can find matheuristics attempting to solve problems arising in the field of logistics [2–4], health care systems [5–7], and pure mathematics [8, 9], among others. Matheuristics have been demonstrated to be a promising research field in order to solve complex optimisation problems. Some interesting surveys on matheuristics are found in [10, 11].
The remainder of the paper is organised as follows. First, a literature review on the techniques for solving the CFLP is presented in Section 2. Then, in Section 3, we describe the matheuristic approach used in this work. Section 4 starts explaining the procedure used to generate the set of instances presented in this paper. In Section 4.1, the obtained results are presented. Finally, in Section 5, some conclusions based on the numerical results are outlined.
2. Literature Review
The CFLP is a wellknown problem in operations research. Heuristic methods, such as evolutionary algorithms [12–14] and local search [15, 16], as well as mathematical programming [17–19] have been used to address this problem. Several surveys have been dedicated to cover this problem and its variations [20, 21]. In spite of that, only little attention has been paid to matheuristics attempting to solve the CFLP problem. In [22], the authors develop a Lagrangianbased heuristic (LH) that provides lower bounds to the problem, and a Tabu Search (TS) algorithm is subsequently used to find the upper bound of the problem. In this case, the TS is initialised using the primary information provided by LH. Additionally, in [23], the authors combine Lagrangian Relaxation with Ant Colony Optimisation to solve the discrete CFLP problem. Other authors have presented matheuristic approaches applied to CFLP variations such as the ()centroid problem [24] and median problem [25]. None of the approaches mentioned before is applied to largescale CFLP problems. In [26], authors propose hybrid algorithm that combines artificial bee algorithms and mixedinteger programming (MIP) to solve largescale CFLP problems ranging from 300 to 1000 warehouses and 1000 customers. They found that their hybrid approach outperformed each technique separately. This is particularly true for largest instance in their study.
3. Proposed Approach
Heuristic methods are a common approach to solve hard combinatorial optimisation problems such as the CFLP. Despite the fact that heuristics do not guarantee optimality, the solutions provided by them can be considered good suboptimal ones. In contrast exact methods guarantee optimality; however, they usually fail when dealing with medium and largesized problems. In this paper, a local search algorithm, which is a variation of the wellknown Tabu Search (TS) algorithm, has been developed.
3.1. Local Search Framework
As we mentioned above, the proposed matheuristic algorithm is based on a local search strategy which in turn is a variation of the wellknown TS algorithm. As in TS we make use of an adaptive memory structure, namely, tabu list. Moreover, our algorithm, as in any local search algorithm, needs to “exchange information” with its neighbours. To do that, first, the neighbourhood must be defined. Our algorithm has only one neighbourhood move that defines a set of possible candidate solutions. This move is used across all executions of the algorithm. Moving from one solution to one of its neighbours implies that we need to close of the open facilities and, at the same time, open of the previously closed one. That means the size of the neighbourhood is , where is the number of open facilities in the current solution and is the number of closed facilities. The number of facilities that are open at each iteration remains constant. Different rules could be used in order to decide what facilities should be opened/closed at each iteration. In this paper such a decision is made randomly, taking into account the fact that the total installed capacity, that is, the sum of the individual capacities over the set of opened facilities, must be larger than the total demand of the system +10%. Thus, we ensure that feasible allocations can be found for the new set of open facilities and that the capacity constraint shall not be violated.
Clearly, other neighbourhood definitions might be considered. For instance, using neighbourhood definitions that lead to smaller neighbourhoods could be considered, as it would allow us to explore the entire neighbourhood enhancing the exploitation ability of our algorithm. However, smaller neighbourhood definition might impair the exploration ability of the algorithm. Thus, although the proposed algorithm supports different neighbourhood definitions, changing it might provoke a big impact in the algorithm behaviour.
Moreover, since we want to solve large instances of the CFLP problem, visiting the entire neighbourhood for the current solution is impractical in terms of computational time. Thus, we need to select a subset of the neighbourhood of the current solution. After an extensive trial and error process, we end up with the size of the neighbourhood set equal to 10. We need to stress that this number largely depends on the available computational resources. Thus, it might not be the best one for other researchers using different infrastructure.
Our algorithm also shared with TS a diversification mechanism that allows it to get out of lowquality neighbourhoods and “jump” to explore new neighbourhoods. The diversification mechanism implemented here is a restart method, which reinitialises a current solution without losing the best solution found by the algorithm.
One distinctive difference between our LS algorithm and TS is that in our approach we do not start with a (completely) random solution but instead we try to find a “warm start” solution by (partially) solving a subproblem that includes a large portion of the available facilities (columns). We use MIP solver to solve the subproblem described above and set a very short timeout (15 secs). After the solver finishes because of the timeout we keep those facilities that are open and discard the closed ones. It is important to note that the number of columns considered in the first iteration is large enough to provide a warm start solution and, at the same time, small enough so the solver can converge within the timeout. Discarded facilities are discarded only regarding the initial solution. Thus, after we found the warm start, all the possible facilities are considered for next iterations.
3.2. Proposed Matheuristic Approach
In this work we propose a matheuristic approach which combines a local search (LS) algorithm and a mixedinteger programming solver. The LS algorithm starts by obtaining a warm start solution as described above. Once the algorithm has set open warehouses, the MIP solver is called to solve the subproblem that considers only the open warehouses as candidates. That means that becomes in (1), (2), (3), (4), and (5), where . This allows us to fairly compare different sets of possible warehouses as we obtain the optimal solution for each subproblem. We need to state at this point that the number of open warehouses at each iteration is very important and, consequently, we need to choose it carefully. On one hand, setting too large would lead to a subproblem that is not possible to solve to optimality within an appropriate time. On the other hand, setting too small would provoke the subproblem to become infeasible as there is no enough installed capacity to serve the total demand from customers. Algorithm 1 shows the main steps of our approach.

Once the initial solution is calculated, the neighbourhood is generated. The corresponding MIP subproblem is solved for each neighbour. We then select the neighbour with the lowest cost and check whether it is in the tabu list or not. In case it is in the tabu list, we check whether it is better than the best solution found so far. If so, the new solution (aspiration criterion in TS) is set. Otherwise, the second best neighbour is checked.
Once a neighbour is selected from the neighbourhood list we check whether the new best neighbour is better than the best solution so far. If so, we reset the diversification counter. Otherwise, the diversification counter increases in one. If the diversification counter reaches its threshold, the restart method is called and a new solution is generated as in the first iteration. We perform some few experiments to find a good value for the threshold. As expected, we found that threshold value depends on the size of the problem. For small cases, threshold is set between 8 and 12 iterations without improvement. For larger instances, threshold is set to 30. The algorithm proceeds in the same way until the time limit is reached. In our case, time limit was set at 2000 secs for all our experiments.
4. Computational Experiments
In this section, we present the benchmark applied for performance comparison and a summary of the computational results obtained for our matheuristic approach. Computational experiments were performed on an Intel Core Duo processor CPU T2700, 2.33 GHz, with 6 GB of RAM. Linux 14.02 was the operating system. The matheuristic algorithm was coded in JAVA 8 language using NetBeans IDE. The MIP subproblem was modelled using AMPL and solved with GUROBI 6.0 solver.
To validate the algorithm and measure its convergence, we chose a set of mediumsized instances that have known optimal solutions, namely, capa, capb, and capc. These instances were obtained from Beasley’s ORLibrary (http://people.brunel.ac.uk/~mastjjb/jeb/info.html). Optimal solutions for these instances can be found in [17]. Our algorithm found the optimal solution for all these instances within acceptable times. We then create a set of large instances with 500 to 1000 warehouses (step size of 100) and 500 clients using the strategy provided in [27]. This strategy was also used in [26]. The set of customers and the set of warehouses are uniformly distributed over a plane of distance units. The Euclidean distance between a customer and a warehouse corresponds to the transportation cost . The demand is calculated using a uniform distribution . is calculated using . We amplify the capacity of the warehouses to obtain harder instances. Finally, the fixed cost of warehouse is . We generate 6 different classes of problems: (warehouses customers). To avoid any instancedependent effects, we generate 10 different instances for each class. In order to compare our algorithm with previously proposed algorithms in the literature, we apply our algorithm to three sets of instances proposed by Avella and Boccia [28] and also used by Guastaroba and Speranza [29]. We call these three sets of instances AB1, AB2, and AB3, where AB1 consists of 20 test instances with 300 potential warehouses and 300 clients. AB2 also consists of 20 instances with 500 potential warehouses and 500 clients. Finally, AB3 consists of 20 instances with 700 potential warehouses and 700 clients. We execute our algorithm 30 times for each instance to assess and avoid outlier performance. Results we present later in this section correspond to the average values obtained for each class of problems. The MIP algorithm was executed only once per instance due to its deterministic behaviour.
4.1. Results
In this subsection we present a summary of the obtained results. Table 1 shows all the obtained results.

First column denotes the instance name. Second column corresponds to the algorithm by which the results were obtained. Here means the mathematical programming approach using the MIP solver from GUROBI, , corresponds to our baseline algorithm which allocates customers randomly. corresponds to our matheuristic approach. Column corresponds to the average total cost obtained by each approach. Column corresponds to average time the algorithm takes to find the best solution, while column shows the iteration where the best solution was found by each algorithm (in average). Column shows the difference between the result obtained by the corresponding algorithm and the best solution known for each instance.
As we can see in Table 1, as the number of decision variables increases our approach obtains better results with respect to the ones obtained by the LS and MIP separately. The MIP solver obtains better results than our matheuristic approach only for the smallest class (). For all the other problems, our matheuristic approach improves results obtained by the MIP algorithm and performs faster. We need to point out that, because of the time limit we impose, the MIP solver is not always able to find the optimal solution within the allowed time. Figure 2 shows convergence of both MIP and matheuristic algorithms. Crosses correspond to the matheuristic algorithm. Circles correspond to the MIP algorithm and triangles correspond to the lower bound obtained by the MIP algorithm.
As we can see in Figure 2, our algorithm converges much faster than MIP does. Moreover, Figure 2 suggests that diversification methods other than the random one used in this work could be very useful to avoid that the matheuristic algorithm which gets trapped into poor locally optimal solutions.
Regarding AB instances, Table 2 shows a summary of the obtained results for such instances. Column is the corresponding instance number. Columns and show the average GAP after 10 runs and the best GAP obtained, respectively. Time () is shown in seconds. As we can see, our algorithm is able to obtain the optimal solution (GAP = 0) for most of the instances. Moreover, the average GAP equal or close to the best obtained GAP is a good indicator of the reliability of the algorithm. Although results are good in terms of the obtained GAP values, other algorithms in the literature, such as the Kernel Search in Guastaroba and Speranza [29], exhibit a better convergence rate. Thus, it is worth to further study the behaviour of our algorithm in order to find alternative ways to speed it up.

5. Conclusions and Future Work
In this paper, we have presented a matheuristic approach that is able to find good solutions within acceptable time. Our algorithm combines the flexibility of a local search framework based on the wellknown Tabu Search metaheuristic and the calculation efficiency of the exact algorithm embedded within the MIP solver. Our algorithm solves many subproblems by opening and closing, in turns, available warehouse locations. Once a new set of candidates locations is set, the MIP solver solves to optimality the associated allocation subproblem. In average, our algorithm is able to find solutions that are below the upper bound found by the MIP algorithm and, therefore, is able to minimize the gap between the best solution found and the corresponding lower bound found by the exact method. Furthermore, our algorithm converges faster than the associated MIP solver.
As a future work, new heuristic methods can be used to seek good combinations of possible warehouse locations. Moreover, other exact methods such as Lagrangian Relaxation can be tested in order to speed up subproblem solving process. Also new diversification strategies as well as guided search should be studied.
Conflict of Interests
The authors declare that there is no conflict of interests regarding the publication of this paper.
Acknowledgment
Fernando Paredes is supported by FONDECYTChile (Grant no. 1130455).
References
 V. Maniezzo, T. Stützle, and S. Voß, Eds., Matheuristics—Hybridizing Metaheuristics and Mathematical Programming, vol. 10 of Annals of Information Systems, Springer, New York, NY, USA, 2010.
 M. Caserta and S. Voss, “A mathheuristic DantzigWolfe algorithm for capacitated lot sizing,” Annals of Mathematics and Artificial Intelligence, vol. 69, no. 2, pp. 207–224, 2013. View at: Publisher Site  Google Scholar  MathSciNet
 L. C. Coelho, J.F. Cordeau, and G. Laporte, “Heuristics for dynamic and stochastic inventoryrouting,” Computers & Operations Research, vol. 52, part A, pp. 55–67, 2014. View at: Publisher Site  Google Scholar  MathSciNet
 B. Raa, W. Dullaert, and E.H. Aghezzaf, “A matheuristic for aggregate productiondistribution planning with mould sharing,” International Journal of Production Economics, vol. 145, no. 1, pp. 29–37, 2013. View at: Publisher Site  Google Scholar
 H. Allaoua, S. Borne, L. L'etocart, and R. Calvo, “A matheuristic approach for solving a home health care problem,” Electronic Notes in Discrete Mathematics, vol. 41, pp. 471–478, 2013. View at: Google Scholar
 Y. Li, D. Yao, W. Chen, J. Zheng, and J. Yao, “Ant colony system for the beam angle optimization problem in radiotherapy planning: a preliminary study,” in Proceedings of the IEEE Congress on Evolutionary Computation, vol. 2, pp. 1532–1538, Edinburgh, Scotland, September 2005. View at: Publisher Site  Google Scholar
 Y. Li, D. Yao, J. Zheng, and J. Yao, “A modified genetic algorithm for the beam angle optimization problem in intensitymodulated radiotherapy planning,” in Artificial Evolution, E.G. Talbi, P. Liardet, P. Collet, E. Lutton, and M. Schoenauer, Eds., vol. 3871 of Lecture Notes in Computer Science, pp. 97–106, Springer, Berlin, Germany, 2006. View at: Publisher Site  Google Scholar
 S. Hanafi, J. Lazić, N. Mladenović, C. Wilbaut, and I. Crévits, “New hybrid matheuristics for solving the multidimensional knapsack problem,” in Hybrid Metaheuristics, M. Blesa, C. Blum, G. Raidl, A. Roli, and M. Sampels, Eds., vol. 6373 of Lecture Notes in Computer Science, pp. 118–132, Springer, Berlin, Germany, 2010. View at: Google Scholar
 E.G. Talbi, “Combining metaheuristics with mathematical programming, constraint programming and machine learning,” 4OR, vol. 11, no. 2, pp. 101–150, 2013. View at: Publisher Site  Google Scholar  Zentralblatt MATH
 C. Archetti and M. G. Speranza, “A survey on matheuristics for routing problems,” EURO Journal on Computational Optimization, vol. 2, no. 4, pp. 223–246, 2014. View at: Publisher Site  Google Scholar
 M. A. Boschetti, V. Maniezzo, M. Roffilli, and A. Bolufé Röhler, “Matheuristics: optimization, simulation and control,” in Hybrid Metaheuristics, M. J. Blesa, C. Blum, L. Di Gaspero, A. Roli, M. Sampels, and A. Schaerf, Eds., vol. 5818 of Lecture Notes in Computer Science, pp. 171–177, Springer, Berlin, Germany, 2009. View at: Google Scholar
 D. R. M. Fernandes, C. Rocha, D. Aloise, G. M. Ribeiro, E. M. Santos, and A. Silva, “A simple and effective genetic algorithm for the twostage capacitated facility location problem,” Computers and Industrial Engineering, vol. 75, no. 1, pp. 200–208, 2014. View at: Publisher Site  Google Scholar
 A. Rahmani and S. A. MirHassani, “A hybrid fireflygenetic algorithm for the capacitated facility location problem,” Information Sciences, vol. 283, pp. 70–78, 2014. View at: Publisher Site  Google Scholar  MathSciNet
 M. J. Cortinhal and M. E. Captivo, “Genetic algorithms for the single source capacitated location problem,” in Metaheuristics: Computer DecisionMaking, vol. 86 of Applied Optimization, pp. 187–216, Springer, New York, NY, USA, 2004. View at: Publisher Site  Google Scholar
 I. A. Contreras and J. A. Díaz, “Scatter search for the single source capacitated facility location problem,” Annals of Operations Research, vol. 157, no. 1, pp. 73–89, 2008. View at: Publisher Site  Google Scholar  MathSciNet
 C. Valenzuela, B. Crawford, R. Soto, E. Monfroy, and F. Paredes, “A 2level metaheuristic for the set covering problem,” International Journal of Computers, Communications and Control, vol. 7, no. 2, pp. 377–387, 2012. View at: Google Scholar
 J. E. Beasley, “An algorithm for solving large capacitated warehouse location problems,” European Journal of Operational Research, vol. 33, no. 3, pp. 314–325, 1988. View at: Publisher Site  Google Scholar  MathSciNet
 J. A. Diaz and E. Fernández, “A branchandprice algorithm for the single source capacitated plant location problem,” Journal of the Operational Research Society, vol. 53, no. 7, pp. 728–740, 2002. View at: Publisher Site  Google Scholar  Zentralblatt MATH
 Z. Yang, F. Chu, and H. Chen, “A cutandsolve based algorithm for the singlesource capacitated facility location problem,” European Journal of Operational Research, vol. 221, no. 3, pp. 521–532, 2012. View at: Publisher Site  Google Scholar  MathSciNet
 J. R. Current, M. Daskin, and D. Schilling, Discrete Network Location Models, chapter 3, Springer, 2002.
 Z. Drezner, Facility Location: A Survey of Applications and Methods, Springer, New York, NY, USA, 2011.
 M. Cortinhal and M. Captivo, “Upper and lower bounds for the single source capacitated location problem,” European Journal of Operational Research, vol. 151, no. 2, pp. 333–351, 2003. View at: Google Scholar
 C.H. Chen and C.J. Ting, “Combining lagrangian heuristic and ant colony system to solve the single source capacitated facility location problem,” Transportation Research Part E: Logistics and Transportation Review, vol. 44, no. 6, pp. 1099–1122, 2008. View at: Publisher Site  Google Scholar
 E. Alekseeva and Y. Kochetov, “Matheuristics and exact methods for the discrete $\left(rp\right)$centroid problem,” in Metaheuristics for Bilevel Optimization, E.G. Talbi, Ed., vol. 482 of Studies in Computational Intelligence, pp. 189–219, Springer, Berlin, Germany, 2013. View at: Publisher Site  Google Scholar
 M. Yaghini, M. Karimi, and M. Rahbar, “A hybrid metaheuristic approach for the capacitated pmedian problem,” Applied Soft Computing, vol. 13, no. 9, pp. 3922–3930, 2013. View at: Publisher Site  Google Scholar
 G. Cabrera, E. Cabrera, R. Soto, L. J. M. Rubio, B. Crawford, and F. Paredes, “A hybrid approach using an artificial bee algorithm with mixed integer programming applied to a largescale capacitated facility location problem,” Mathematical Problems in Engineering, vol. 2012, Article ID 954249, 14 pages, 2012. View at: Publisher Site  Google Scholar
 F. Barahona and F. A. Chudak, “Nearoptimal solutions to largescale facility location problems,” Discrete Optimization, vol. 2, no. 1, pp. 35–50, 2005. View at: Publisher Site  Google Scholar  MathSciNet
 P. Avella and M. Boccia, “A cutting plane algorithm for the capacitated facility location problem,” Computational Optimization and Applications, vol. 43, no. 1, pp. 39–65, 2009. View at: Publisher Site  Google Scholar  MathSciNet
 G. Guastaroba and M. G. Speranza, “Kernel search for the capacitated facility location problem,” Journal of Heuristics, vol. 18, no. 6, pp. 877–917, 2012. View at: Publisher Site  Google Scholar
Copyright
Copyright © 2016 Carolina Lagos et al. This is an open access article distributed under the Creative Commons Attribution License, which permits unrestricted use, distribution, and reproduction in any medium, provided the original work is properly cited.