8
Metaheuristic methods for solving the Bilevel Uncapacitated Facility Location Problem with Clients’ Preferences Miroslav Mari´ c, Zorica Stanimirovi´ c, Nikola Milenkovi´ c 1,2 Faculty of Mathematics, University of Belgrade, Serbia Abstract In this study, we consider a variant of the Bilevel Uncapacitated Facility Location Problem (BLUFLP) in which the clients choose suppliers based on their own pref- erences. We propose three metaheuristic methods for solving this problem: Particle Swarm Optimization (PSO), Simulated Annealing (SA) and a combination of Re- duced and Basic Variable Neighborhood Search Method (RVNS-VNS). The solution encoding and constructive elements of all three proposed algorithms are adapted to the problem under consideration. The results of computational tests on problem instances with up to 2000 clients and 2000 potential facility locations show good per- formance of all three proposed methods, even on large problem dimensions. Finally, the obtained results indicate that the proposed RVNS-VNS method outperforms the PSO and SA methods in the sense of solutions’ quality and running times. Keywords: Location problems, Discrete Optimization, Particle Swarm Optimization, Simulated Annealing, Variable Neighborhood Search. 1 This research was supported by Serbian Ministry of Education and Science under the grants no. 174010 and 47017 2 Email: [email protected],[email protected],[email protected] Available online at www.sciencedirect.com Electronic Notes in Discrete Mathematics 39 (2012) 43–50 1571-0653/$ – see front matter © 2012 Elsevier B.V. All rights reserved. www.elsevier.com/locate/endm doi:10.1016/j.endm.2012.10.007

Metaheuristic methods for solving the Bilevel Uncapacitated Facility Location Problem with Clientsʼ Preferences

Embed Size (px)

Citation preview

Page 1: Metaheuristic methods for solving the Bilevel Uncapacitated Facility Location Problem with Clientsʼ Preferences

Metaheuristic methods for solving the BilevelUncapacitated Facility Location Problem with

Clients’ Preferences

Miroslav Maric, Zorica Stanimirovic, Nikola Milenkovic 1,2

Faculty of Mathematics, University of Belgrade, Serbia

Abstract

In this study, we consider a variant of the Bilevel Uncapacitated Facility LocationProblem (BLUFLP) in which the clients choose suppliers based on their own pref-erences. We propose three metaheuristic methods for solving this problem: ParticleSwarm Optimization (PSO), Simulated Annealing (SA) and a combination of Re-duced and Basic Variable Neighborhood Search Method (RVNS-VNS). The solutionencoding and constructive elements of all three proposed algorithms are adapted tothe problem under consideration. The results of computational tests on probleminstances with up to 2000 clients and 2000 potential facility locations show good per-formance of all three proposed methods, even on large problem dimensions. Finally,the obtained results indicate that the proposed RVNS-VNS method outperforms thePSO and SA methods in the sense of solutions’ quality and running times.

Keywords: Location problems, Discrete Optimization, Particle SwarmOptimization, Simulated Annealing, Variable Neighborhood Search.

1 This research was supported by Serbian Ministry of Education and Science under thegrants no. 174010 and 470172 Email: [email protected],[email protected],[email protected]

Available online at www.sciencedirect.com

Electronic Notes in Discrete Mathematics 39 (2012) 43–50

1571-0653/$ – see front matter © 2012 Elsevier B.V. All rights reserved.

www.elsevier.com/locate/endm

doi:10.1016/j.endm.2012.10.007

Page 2: Metaheuristic methods for solving the Bilevel Uncapacitated Facility Location Problem with Clientsʼ Preferences

1 Problem formulation

The bilevel uncapacitated facility location problem (BLUFLP) was introducedby Hanjoul and Peetersin [5]. A set I = {1, ...,M} of potential sites forlocating facilities and a set J = {1, ..., N} of clients are given. The costs ofassigning a client i ∈ I to a facility j ∈ J is defined by a cost matrix C = [cij ],where cij ≥ 0, i ∈ I, j ∈ J . Client’s preference to be served by each potentialfacility is given by matrix G = [gij ], gij ≥ 0, i ∈ I, j ∈ J . More precisely, ifgi1j < gi2j, then a client j prefers to be assigned to facility i1 then to facilityi2. Opening facility i ∈ I assumes certain additional costs fi ≥ 0.

The problem involves two stages of decision making: to choose which facil-ities are to be opened (at the upper level) and to assign the clients to openedfacilities (at the lower level), such that the sum of the fixed costs for openingfacilities and total cost of servicing the clients is minimized. Each client maybe served by exactly one, previously opened facility. Two sets of binary de-cision variables are used. Variable xij ∈ {0, 1}, i ∈ I, j ∈ J takes the valueof 1 if the client j is served by facility i, and 0 otherwise. Variable yi, i ∈ Iis equal to 1, if facility i is opened, and 0 otherwise. Using this notation, theproblem can be formulated as [4], [5]:

miny

i∈I

j∈Jcijx

∗ij(y) +

i∈Ifiyi(1)

subject to:

yi ∈ {0, 1} for every i ∈ I,(2)

where x∗ij(y) is the optimal solution of the client problem:

minx

i∈I

j∈Jgijxij(3)

subject to: ∑

i∈Ixij = 1 for every j ∈ J,(4)

xij ≤ yj for every i ∈ I, j ∈ J,(5)

xij ∈ {0, 1} for every i ∈ I, j ∈ J.(6)

Several reformulations of the BLUFLP as a single-level location problemwith some additional constraints are proposed in [2] and [4]. Canovas et al.[1]gave some valid inequalities for the BLUFLP to which help improve lowerbounds for the proposed branch-and-cut method. In the paper by Vasilyevand Klimentova [10], the authors present a new formulation of the BLUFLPand develop two versions of the branch and cut method for solving the problem

M. Maric et al. / Electronic Notes in Discrete Mathematics 39 (2012) 43–5044

Page 3: Metaheuristic methods for solving the Bilevel Uncapacitated Facility Location Problem with Clientsʼ Preferences

to optimality. A simulated annealing heuristic is used for obtaining the upperbounds of the optimal solution in the proposed exact methods [11]. TheBLUFLP is proved to be NP-hard problem in [8].

2 Proposed Metaheuristic Methods for solving the BLU-FLP

In this study, we have implemented three well-known metaheuristics that areadopted for solving the BLUFLP: Particle Swarm Optimization method [6],Simulated Annealing [7] and a combination of Reduced and Basic Variable-Neighborhood Search methods [3].

All three metaheuristic methods use a binary encoding. Each solution isrepresented by a binary string of the length M = |I|. Each bit in the codecorresponds to one potential facility in the network. If the bit on the i-thposition in the code takes the value of 1, it means that a facility is located atthe i-th node, 0 otherwise.

Indices of established facilities are easily obtained from the solution’s code.For each client j ∈ J , we sort the array of potential facilities according to pref-erences of the client j (most preferred at the beginning, least preferred at theend) and assign the sorted array to it. This information is stored in the matrixof sorted preferences, where each row corresponds to one client and containsits assigned array of sorted facilities. For each client j, we search throughthe j-th row of the matrix of sorted preferences, looking for the first estab-lished facility in the sorted array assigned to j. Corresponding transportationcosts are added to the objective function value. Finally, the objective functionvalue is obtained by adding opening costs for each established facility to totaltransportation costs.

2.1 Particle Swarm Optimization (PSO)

In the proposed PSO for solving the BLUFLP, a swarm consists of S = 60particles moving around in a M-dimensional search space. Each particle i, i =1, 2, ..., S is represented by a binary vector xi and corresponds to a candidatesolution in the search space. Particles are first randomly generated, by settingthe bit values of their particle vectors with certain probability. Each particle ihas assigned information on its current position xi, the best visited position biand velocity vi. In each iteration of the PSO, each particle successively adjustsits position xi in respect to the best position bi visited by itself and the bestposition visited by the whole swarm g. The flying direction of the particle

M. Maric et al. / Electronic Notes in Discrete Mathematics 39 (2012) 43–50 45

Page 4: Metaheuristic methods for solving the Bilevel Uncapacitated Facility Location Problem with Clientsʼ Preferences

also depends on a cognitive learning parameter ϕp, social learning parameterϕg and ”inertia weight” parameter ω that controls the impact of the previousvelocity of a particle on the current one. Function Sigmoid(v) = 1/(1 + e−v)is used to normalize the velocities values into the interval [0, 1]. If the particlehas moved to better position compared to its best local solution, the best localposition bi is updated. If the new best local solution is better than the bestglobal one, the best global solution g of the swarm is updated. The algorithmstops if the best global solution remained unchanged within 1000 consecutivePSO iterations.

The basic scheme of the proposed PSO is presented in Algorithm 1.

Algorithm 1: Particle Swarm Optimization

foreach particle pi, i = 1, . . . , S dorandomly initialize particle value vector: xi ← Floor(U(0, 1) + 0.5);set local best known position to the initial position: bi ← xi;initialize particle velocity: vi ← U(−vmax, vmax);if particle pi better than global best particle g then

g ← pi;end

endrepeat

foreach particle pi, i = 1, . . . , S doforeach dimension d = 1, . . . ,M do

fp ← U(0, 1);fg ← U(0, 1);Update particle velocity: vi,d ← ωvi,d + ϕpfp(bi,d − xi,d) + ϕgfg(gd − xi,d);

if vi,d > vmax then vi,d ← vmax;

else if vi,d < −vmax then vi,d ← −vmax;

u← U(0, 1);if u < Sigmoid(vi,d) then

xi,d ← 1;

elsexi,d ← 0;

end

endif xi better than local best position bi then

bi ← xi;if local best position bi better than global g then

g ← bi;end

end

end

until maximum non improving iterations reached;

2.2 Simulated Annealing (SA)

The proposed SA method for the BLUFLP starts with a randomly generatedsolution from the search space ω ∈ Ω and initialization of SA parameters. Ateach iteration, we generate a neighbor solution ω′ ∈ N(ω) by inverting bitvalue on a randomly chosen position in the code of the solution ω. Moves thatimprove the objective function are always accepted. Otherwise, ω′ is selectedwith a given probability p that depends on the current temperature and theamount of degradation Δω,ω′ of the objective function. The temperature tkdecreases after every k generation or after the solution has been improved. The

M. Maric et al. / Electronic Notes in Discrete Mathematics 39 (2012) 43–5046

Page 5: Metaheuristic methods for solving the Bilevel Uncapacitated Facility Location Problem with Clientsʼ Preferences

algorithm stops if the solution has not been improved in 200000 consecutiveSA iterations. The basic concept of the proposed SA method is shown inAlgorithm 2.

Algorithm 2: Simulated Annealing

select initial random solution ω ∈ Ω;select the temperature change counter k;select a temperature cooling schedule tk;select an initial temperature T = t0 ≥ 0;select a repetition schedule, Mk, that defines the number of iterations executed at each temperature, tk;repeat

set repetition counter m = 0;repeat

generate a solution ω′ ∈ N(ω);

calculate Δω,ω′ = f(ω′)− f(ω);

if Δω,ω′ ≤ 0 then ω ← ω′;else ω ← ω′ with probability exp(−Δω,ω′/tk);m← m + 1;

until m = Mk;

until maximum non improving iterations reached;

2.3 RVNS-VNS method

In the proposed RVNS-VNS meetaheuristic for solving the BLUFLP, theRVNS method is employed to provide a good-quality solution that is laterused as a starting point of the VNS algorithm. Throughout the VNS loops,we tend to move to a solution that is relatively far from the current one andperform a systematic search of the solution space. At the same time, we alsotry to prevent the convergence towards worse local optimum.

An initial solution of the RVNS is randomly generated. We further try tofind an improvement of the objective function by inverting a bit value on arandomly chosen position in the solution’s code. The RVNS algorithm runsuntil we reach 500 consecutive iterations without improvement. The bestsolution obtained by the RVNS is used as the initial solution of the VNSmethod. In the main VNS loop, we first randomly move to a solution inthe k-th neighborhood of the current solution, no matter if this new solutionis better or not (Shaking phase). On this solution we apply Local Searchprocedure, trying to find a new local extremum (Local Search phase). If thebest solution is improved, we perform Shake and Local search phase in thek-th neighborhood of the new, improved solution. Otherwise, we keep thecurrent best solution and change the size of the neighborhood to k + 1. Themain VNS loop is repeated until we reach 150 consecutive iterations withoutimprovement. The pseudocode of the RVNS-VNS method for the BLUFLPproblem is presented in Algorithm 3.

M. Maric et al. / Electronic Notes in Discrete Mathematics 39 (2012) 43–50 47

Page 6: Metaheuristic methods for solving the Bilevel Uncapacitated Facility Location Problem with Clientsʼ Preferences

Algorithm 3: RVNS-VNS method

// RVNS part

x← RandomInitialize(M);kmax ← 2;repeat

k← 1;repeat

i← Random(1, M);

x′ ← Invert(x, i);

if x′ better than x then break;k ← k + 1;

until k = kmax;

until maximum non improving iterations reached;// VNS part

kmax ← Min(M/3, 30);repeat

k← 2;repeat

x′ ← Shake(x, k);

x′′ ← LocalSearch(x′ );if x′′ better than x then

x← x′′;break;

endk ← k + 1;

until k = kmax;

until maximum non improving iterations reached;

3 Computational results

In this section, computational results and comparisons of the proposed meta-heuristic methods are presented. All three methods were implemented byusing .NET Framework. We have also employed CPLEX 12.1 solver to findoptimal solutions (if possible). All computational experiments were carriedout on an Intel Core i7-860 2.8 GHz (quad-core processor) with 8GB RAMmemory under Windows 7 Professional operating system. We have used mod-ified instances from the literature, originally introduced for single and multiplelevel uncapacitated facility location problem with up to 2000 users and 2000potential facilities [9]. Each of the three proposed metaheuristic methods wasrun 20 times on each tested instance. Parameter values used in metaheuris-tics were tuned experimentally in order to provide best performance of analgorithm in the sense of solution’s quality.

In Table 1 we provide computational results and comparisons of the consid-ered methods on the chosen subset of tested instances. For each instance, wepresent optimal solution obtained by CPLEX 12.1 solver and its running time(”-” stands if no optimal solution was found). For each of the three proposedmetaheuristics, we give its best solution Best.Sol., corresponding running timet(s) and average gap agap(%) from the optimal/best solution through 20 runs.The best results of all three metaheuristics are bolded in Table1. As it canbe seen from Table 1, the CPLEX 12.1 was able to solve only instances withup to 50 clients and 50 potential users to optimality. The proposed RVNS-VNS approach outperformed the PSO and the SA in the sense of solutions’

M. Maric et al. / Electronic Notes in Discrete Mathematics 39 (2012) 43–5048

Page 7: Metaheuristic methods for solving the Bilevel Uncapacitated Facility Location Problem with Clientsʼ Preferences

Table 1Results and comparisons

Inst-N-M CPLEX PSO SA RVNS-VNS

Opt.Sol. t(s) Best.Sol. t(s) agap(%) Best.Sol. t(s) agap(%) Best.Sol. t(s) agap(%)

cap-50-16 1248142.9 0.172 opt 0.038 3.450 opt 0.355 0 opt 0.056 0

cap-50-25 1248142.9 0.828 1270249.925 0.169 1.891 opt 0.153 0 opt 0.084 0.443

cap-50-50 1248142.9 0.409 opt 0.014 13.959 opt 0.019 0 opt 0.025 0

capa-1000-100 - - 24147833.770 0.449 0 24147833.770 4.377 0 24147833.770 0.564 0

capb-1000-100 - - 22705728.388 0.444 0.205 22705728.388 2.984 0 22705728.388 0.424 0

capc-1000-100 - - 22204075.489 0.538 0.331 22204075.489 4.441 0 22204075.489 0.466 0

mq1-300-300 - - 4820.990 1.013 0.117 4820.990 15.447 0 4820.990 1.542 0

mr1-500-500 - - 3686.929 2.684 0.408 3686.929 43.950 0.138 3686.929 6.351 0.024

ms1-1000-1000 - - 7159.554 11.7126 0.586 7159.554 144.48 0.530 7159.554 45.294 0.024

mt1-2000-2000 - - 14822.496 50.396 25.892 14796.344 589.383 0.893 14796.344 233.365 0.062

rnd0-100-100 - - 559418.823 0.268 2.917 559418.823 9.308 1.504 559418.823 0.427 0

rnd1-100-100 - - 561768.823 0.526 3.024 557000.568 2.341 1.094 557000.568 0.720 0.259

rnd2-100-100 - - 562082.736 0.360 2.904 554583.354 37.526 1.522 553797.540 0.945 0.034

rnd0-200-200 - - 1149737.938 2.638 4.056 1127644.647 8.945 2.574 1122632.46 3.353 0.940

rnd1-200-200 - - 1138336.196 1.510 4.798 1115991.054 5.655 3.003 1110665.699 4.554 1.082

rnd2-200-200 - - 1124097.708 1.236 3.919 1122353.595 5.332 2.874 1102880.789 4.974 0.735

rnd0-300-300 - - 1706456.503 2.801 3.525 1673291.934 7.808 2.966 1661657.633 12.827 0.687

rnd1-300-300 - - 1689891.715 2.871 3.360 1690701.489 18.505 2.290 1667518.851 8.086 0.567

rnd2-300-300 - - 1661295.583 4.631 2.573 1658392.177 15.755 2.104 1648977.107 12.550 0.879

rnd0-500-500 - - 2827363.965 8.302 2.728 2810201.942 44.419 2.127 2787568.582 35.748 0.874

rnd1-500-500 - - 2800942.512 8.141 3.819 2773501.349 46.215 2.723 2753812.000 37.899 0.648

rnd2-500-500 - - 2824298.465 6.848 3.573 2803407.896 53.932 2.366 2782127.139 30.959 0.721

rnd0-1000-1000 - - 5608973.68 28.318 2.946 5601373.986 169.306 2.107 5526194.156 274.600 0.699

rnd1-1000-1000 - - 5594718.762 28.064 2.916 5548414.188 199.298 1.996 5501359.273 229.079 0.999

rnd2-1000-1000 - - 5667948.877 29.203 2.310 5611827.823 188.677 1.335 5605783.436 223.660 0.531

rnd0-2000-2000 - - 11395587.7 352.519 2.596 11296896.49 244.932 1.941 11201602.43 1923.246 0.935

rnd1-2000-2000 - - 11457550.36 329.040 2.337 11343445.6 409.997 1.753 11245868.17 1683.937 1.415

rnd2-2000-2000 - - 11268173.59 379.355 2.403 11254432.88 319.834 1.859 11128587.88 1484.879 1.408

quality: it reached all optimal solutions and provided best solutions for alltest instances. The values in agap(%) column indicate its high reliability inproviding all optimal/best solutions. As the t(s) column shows, the RVNS-VNS is generally slower than the PSO and SA, but its running times are stillrelatively short, even for largest tested instances with 2000 nodes. The pro-posed PSO shows the worst performance regarding solutions’ quality, but itsrunning times are very short, while the SA showed slightly better performancecompared to PSO.

4 Conclusions

In this paper, we proposed the PSO, SA and RVNS-VNS metaheuristics forsolving the Bilevel Uncapacitated Facility Location Problem. The obtained re-sults indicate that the RVNS-VNS outperformed other two methods, especiallyin the cases of large-scale problem instances. It showed excellent performance

M. Maric et al. / Electronic Notes in Discrete Mathematics 39 (2012) 43–50 49

Page 8: Metaheuristic methods for solving the Bilevel Uncapacitated Facility Location Problem with Clientsʼ Preferences

regarding solution quality, stability and running times. The RVNS-VNS rep-resents a promising metaheuristic for solving the BLUFLP and has a potentialto be applied for solving similar facility location problems.

References

[1] Canovas, L., S. Garcıa, M. Labbe, and A. Marın, A Strengthened Formulationfor the Simple Plant Location Problem with Order, Oper. Res. Lett. 35 (2007),141-150.

[2] Gorbachevskaya L. E., “Polynomially solvable and NP-hard bilevelstandardization problems”, Ph.D. Thesis, Sobolev Institute of Mathematics,Novosibirsk, 1998 (in Russian).

[3] Hansen, P., and N. Mladenovic, Variable neighborhood search: Principles andapplications, European Journal of Operational Research 130 (2001), 449-467.

[4] Hansen, H., Yu. A. Kochetov, and N. Mladenovic, Lower bounds for theuncapacitated facility location problem with user preferences, Preprint G-2004-24, GERAD-HEC, Montreal, (2004).

[5] Hanjoul, P., and D. Peeters, A Facility Location Problem with Clients PreferenceOrdering, Regional Sci. Urban Econom. 17 (1987), 451-473.

[6] Kennedy, J., and R. C. Eberhart,Particle swarm optimization. In IEEEInternational Conference on Neural Networks, Perth, Australia, (1995), 1942-1948.

[7] Kirkpatrick, S., C. D. Gelatt, and M. P. Vecchi, Optimization by simulatedannealing, Science 220 (1983), 671-680.

[8] Korte, B., and J. Vygen, “Combinatorial Optimization. Theory andAlgorithms”, 3-rd Edition, Springer, 2005.

[9] Maric, M., An efficient genetic algorithm for solving the multi-leveluncapacitated facility location problem, Computing and Informatics 29 (2010),183-201.

[10] Vasilev, I. L., and K. B. Klimentova, The Branch and Cut Method for theFacility Location Problem with Clients Preferences, Journal of Applied andIndustrial Mathematics 4 (2010), 441-454.

[11] Vasilev, I. L., K. B. Klimentova, and Y. A. Kochetov, New Lower Boundsfor the Facility Location Problem with Clients Preferences, ComputationalMathematics and Mathematical Physics 49 (2009), 1010-1020.

M. Maric et al. / Electronic Notes in Discrete Mathematics 39 (2012) 43–5050