Available online at www.sciencedirect.com
Electronic Notes in Discrete Mathematics 66 (2018) 119–126 www.elsevier.com/locate/endm
A variable neighborhood search for multi-family capacitated lot-sizing problem Jerzy Duda 1 Adam Stawowy AGH University of Science and Technology, Faculty of Management, Depatament of Applied Computer Science, Gramatyka St. 10, 30-067 Krakow, Poland
Abstract The paper presents a novel variable neighborhood search (VNS) algorithm combined with a linear programming solver (LPS) to solve multi-item multi-family capacitated lot-sizing problem with setup times independent of the family sequence. The model has a direct application to real production planning in foundry industry, where the goal is to create the batches of manufactured castings and the sequence of the melted metal loads to prevent delays in delivery of goods to customers. We developed a simple and fast VNS based algorithm with problem-specific operators that are responsible for the neighborhood generating. For large instances of the problem the proposed algorithm is able to provide better results than CPLEX solver. Keywords: lot-sizing, production planning, VNS, local search, linear programming
1
Introduction
Short-time planning (scheduling), due to interconnections between different management areas and direct collaboration with customers with changing requirements, is a very difficult optimization problem, so new solving methods 1
Email:
[email protected]
https://doi.org/10.1016/j.endm.2018.03.016 1571-0653/© 2018 Elsevier B.V. All rights reserved.
120
J. Duda, A. Stawowy / Electronic Notes in Discrete Mathematics 66 (2018) 119–126
are still developed. An extended review of models and tools for that purpose can be found e.g. in [4]. In the article we consider the scheduling problem in the foundry industry, that consists in determining the lot size of the items ordered by clients and the required alloy to be produced during each period of the finite planning horizon. It is a multi-level, multi-item and multi-family lot-sizing problem in which production is done in a few consecutive stages and several products utilize common resources, so they should be planned in the same batches. We propose an efficient VNS algorithm combined with LPS, which is able to obtain results better than the approaches proposed so far in the literature. Our VNS employs five operators to generate the neighborhoods, while LP solver is responsible for their effective exploitation. The organization of this paper is as follows: In Section 2 literature review is presented. A mixed integer programming (MIP) model for foundry scheduling problem is discussed in Section 3. The details of proposed approach are given in Section 4. The computational experiments are described in Section 5. Finally, the conclusions are drawn in Section 6.
2
Literature review
Except of our previous study [3], we could not find any paper concerning application of VNS to the lot sizing problem in foundries. As presented here algorithm combines VNS with LPS, we will focus only on similar approaches. Zhao et al. [7] have used a variable neighborhood decomposition search (VNDS) combined with MIP to solve the multi-item lot-sizing problem. The VNDS algorithm consequently fixes values for some variables on the basis of solution achieved with MIP relaxation and then VNS algorithm is used. The algorithm is able to solve problem with 40 items and 16 periods. The similar approach has been proposed by Seeanner et al.[6] to solve a general multi-level lot-sizing and scheduling problem. They provide results for real world problems with ’hundreds’ of items and 12 weeks. However, the computation time is one hour for a single instance of the problem, and the gap between the achieved results and reference values is 14-27%. Most recently, Chen [1] has presented a VNS algorithm with fix-and-optimize method for the multi-level capacitated lotsizing problem. For a local search procedure binary variables, related to the items produced in the periods, are fixed and then CPLEX branch and bound algorithm is used to solve the relaxed problem. The largest instances considered by the author has a size of 100 items and 16 periods and it takes more than 10 minutes to solve them. We apply an approach similar to Chen, how-
J. Duda, A. Stawowy / Electronic Notes in Discrete Mathematics 66 (2018) 119–126
121
ever, we use LP solver instead of MIP solver for the optimization phase, which gives faster execution times and independence from the commercial solver.
3
Problem formulation
We use a simplified version of the model presented by de Araujo et al. [2] in which a) dependence of setup costs from the type of alloy is removed and b) alloy change does not decrease the furnace capacity. It makes the model more practical for the production planning problem we have found in small and medium-sized alloy castings foundries. The MIP formulation of the problem is as follows: Indices i =1,. . . ,I – produced items; k =1,. . . ,K – produced alloys; t=1,. . . ,T – working days; n=1,. . . ,N – subperiods in a day; Data dit – demand for item i in day t; wi – weight of item i ; ai k = 1, if item i is produced from alloy k, otherwise 0; s – setup cost of changing alloy; C – loading capacity of the furnace; hit − – penalty for delaying (-) and storing (+) item i in day t; Variables Iit − , Iit + – number of items i delayed (-) and stored (+) in day t; ztn k = 1, if there is a setup of alloy k in subperiod n of day t, o/w 0; ytn k = 1, if alloy k is produced in day t and subperiod n, otherwise 0; xitn - number of items i produced in day t and its subperiod n. T T I K N + k (hit Iit + h+ I ) + (sztn ) it it
Minimize
i=1 t=1
(1)
k=1 t=1 n=1
subject to: + Ii,t−1
−
− Ii,t−1
+
K N
xitn aki − Iit+ + Iit− ≥ dit ,
i = 1, ..., I, t = 1, ..., T (2)
n=1 k=1 I
k wi xitn aki ≤ C ytn ,
i=1 k ztn
k k ≥ ytn − yt,n−1 , K
k = 1, ..., K, t = 1, ..., T, n = 1, ..., N k = 1, ..., K, t = 1, ..., T, n = 1, ..., N
k ytn = 1,
t = 1, ..., T, n = 1, ..., N
(3) (4) (5)
k=1
k k Iit , Iit+ , xitn ∈ Z≥0 , ztn , ytn ∈ {0, 1} i = 1, ..., I, t = 1, ..., T, n = 1, ..., N k = 1, ..., K
(6)
122
J. Duda, A. Stawowy / Electronic Notes in Discrete Mathematics 66 (2018) 119–126
Comparing to the de Araujo et al. [2] model we take only single setup cost for changing alloy grade, so it is not dependent on the type of produced alloy. The other simplification is not declining the amount of alloy that is available from a single furnace capacity due to the setup loss in the constraint (3).
4
Proposed VNS algorithm
In [3] we proposed a hybrid GA and VNS algorithm that proved to be better than CPLEX solver for the instances with 50 and 100 items. It used a special representation of a solution, consisting of sets of vectors: at least one vector x , representing production quantity, the same number of vectors o, representing orders’ identifiers, and one vector a, representing alloy type that is produced in subsequent subperiods. The algorithm followed the standard GA scheme, but - after a certain number of generations - a VNS algorithm was used to improve the solutions in the population. This time we decided to use more direct representation of the solution to develop algorithm that follows basic VNS heuristic [5]. For such representation GA-VNS algorithm occurred to be inefficient, and CPLEX solver generated better results, albeit still significantly distant from the lower bound. The general outline of the VNS algorithm is shown in Fig. 1. Initialize(S) for iter:=1 to maxiter k:=0 do S ∗ :=S if k < 10000 then // Neighborhood change r := rnd() if r < 0.1 then S ∗ := SwapP eriods(S) elseif r < 0.3 then S ∗ := SwapW ithAlloy(S) elseif r < 0.4 then S ∗ := AlterAlloy(S) elseif r < 0.8 then S ∗ := AlterItems(S) else S ∗ := AlterP eriods(S) else S ∗ := LocalSearch(S) // Decent local search if f (S ∗ ) < f (S) then S := S ∗ else k := k+1 while k < 10001 S := AlloyP erturabtion(S) for iter%N // Shaking next iter
Fig. 1. Schema of the VNS algorithm
Representation consists of two parts. Matrix of I × T N integer numbers represents decision variables xin , and a vector of T N integers represents alloys
J. Duda, A. Stawowy / Electronic Notes in Discrete Mathematics 66 (2018) 119–126
123
produced in successive days and subperiods, corresponding to the variable yktn . Initialize procedure works as follows: alloys vector is generated according to the distribution of demand for various alloys. The quantities xitn of produced castings are generated from a uniform distribution [0, dit ]. This procedure is repeated 1000 times and the best result becomes the starting solution. In order to generate the neighborhoods we employ five operators allowing for a slight modification of the current production plan: •
AlterAlloy - choose at random one of the subperiods and alter alloy identifier to another one drawn from K available,
•
SwapP eriods - choose at random two different subperiods and exchange between them the quantities of produced items,
•
SwapW ithAlloy - like SwapP eriods, but alloy identifiers are exchanged too,
•
AlterItems - choose randomly one of the subperiods and change the produced quantities of all I items by drawing quantities from normal distribution N(xitn , σ), where xitn is quantity of item i taken from previous iteration, σ is a parameter (standard deviation) responsible for operation intensity after some preliminary experiments a linear decreasing of intensity was chosen, from σ=10.0 in first generation to σ=0.5 in the last generation,
•
AlterP eriods - choose randomly one of I items and change its quantities in all N subperiods using approach described for AlterItems.
Escape from a local minimum is possible due to AlloyP erturbation that changes alloy for 3 subsequent subperiods, starting from the iter modulo N subperiod, where iter is the number of current iteration. The probabilities of using particular operator were established by a grid search from the range of [0.1, 0.6]. We experimented with various types of the local search algorithm (multistart hill climbing, iterative local search, algorithms exploiting the problem specific knowledge), but we did not manage to gain satisfactory results. Finally, we decided to use LP solver for the relaxed version of the model presented in the previous section. Integer variables xitn and in consequence Iit − and Iit + were changed to continuous variables and the variables ytn k were fixed to their current values in solution S ∗ . Real values xitn in the solution provided by LPS were rounded down to integers before they were copied back to S*.
124
5
J. Duda, A. Stawowy / Electronic Notes in Discrete Mathematics 66 (2018) 119–126
Computational experiments
In order to verify the efficiency of the proposed VNS algorithm we used the tests analogous to the ones proposed by de Araujo et al. [2], but with a single setup cost. We generated 10 instances for two problems: 50 items/10 alloys and 100 items/20 alloys. Planning horizon for all instances was set to one week, i.e. 5 working days with 10 subperiods a day. The CPLEX MIP solver (ver. 12.7) was run for 10 minutes, while our VNS algorithm provided the final solution after 2 and 5 minutes for 50 and 100 items, respectively (maxiter was set to 5 times the number of subperiods). The algorithm was ran on the Xeon E3-1220V2 machine. The results achieved by CPLEX solver and VNS are gathered in Tables 1 and 2. MIP column represents the CPLEX MIP solution, VNS best - the best VNS solution out of 20 independent runs, VNS avg - the average solution achieved by VNS for a particular problem instance, best-MIP - relative difference between the best VNS solution and the CPLEX solution, avg-MIP - relative difference between VNS average solution and CPLEX. Items Alloys # 50 10 1 50 10 2 50 10 3 50 10 4 50 10 5 50 10 6 50 10 7 50 10 8 50 10 9 50 10 10 Dev. from the best
MIP VNS best VNS avg best-MIP avg-MIP 5333.38 5435.97 5649.21 -1.92% -5.92% 5286.28 5076.14 5130.10 4.14% 3.04% 4077.83 4145.35 4253.00 -1.66% -4.32% 5693.39 4450.50 4542.59 27.93% 25.33% 5190.13 5228.98 5362.04 -0.75% -3.31% 4702.80 4824.70 4894.30 -2.59% -4.07% 6677.21 6017.98 6144.24 10.95% 8.67% 5093.11 4919.77 5040.26 3.52% 1.05% 6347.24 6411.83 6512.89 -1.02% -2.61% 3896.16 3868.96 3933.27 0.70% -0.95% 4.72% 0.79% 2.96%
Table 1 Results of the experiments with 50 items and 10 alloys
For the test instances with 50 items and 10 alloys VNS algorithm can be regarded at least as competitive as CPLEX solver. Overall average VNS solutions are better than CPLEX solution. In the cases in which CPLEX is better, the maximum deviation of VNS from MIP solutions is 5.9% for average results and 2.6% for the best results. However, in the cases in which VNS is better, it can outperform CPLEX by as much as 27.9%. Moreover, VNS algorithm requires 5 times less time to provide final result. For all test instances with 100 items and 20 alloys VNS algorithm performs better than CPLEX solver, while requiring half of its computational time. On
J. Duda, A. Stawowy / Electronic Notes in Discrete Mathematics 66 (2018) 119–126
125
average the difference is 11%, but for two cases the difference reaches almost 20%, when average VNS results are considered. Items Alloys # 100 20 1 100 20 2 100 20 3 100 20 4 100 20 5 100 20 6 100 20 7 100 20 8 100 20 9 100 20 10 Dev. from the best
MIP VNS best VNS avg best-MIP avg-MIP 28813.62 23833.19 24057.76 20.90% 19.77% 29357.22 26858.57 27070.43 9.30% 8.45% 26124.03 23802.57 24162.61 9.75% 8.12% 27929.03 27160.41 27640.36 2.83% 1.04% 32936.33 29665.08 30100.84 11.03% 9.42% 26269.07 23948.74 24121.39 9.69% 8.90% 30666.96 26731.85 26934.76 14.72% 13.86% 26082.80 25677.59 25928.95 1.58% 0.59% 27782.30 24951.07 25114.89 11.35% 10.62% 27443.70 22968.70 23066.71 19.48% 18.98% 11.06% 0.00% 1.00%
Table 2 Results of the experiments with 100 items and 20 alloys
Finally, we made a paired sample t test for the average results achieved by VNS algorithm and CPLEX. Table 3 shows that differences for the problem with 100 items are statistically significant at α = 0.05 (critical value is 2.26). Items 50 100
Alloys 10 20
Difference Difference
Mean Std. Dev. Std. Err. t value 127.83 449.25 149.75 0.85 2272.28 1395.05 465.02 4.89
Table 3 Paired sample t test for average results of VNS and CPLEX solver
6
Conclusions
The presented VNS algorithm proved to be a very efficient solver for the examined instances of the multi-family capacitated lot-sizing problem with setup times not depending on the family type (alloy). This model, reflecting typical production planning systems in small and medium foundries, is a slightly simplified version of the de Araujo et al. model [2]. It occurred that the adjusted model could not be efficiently solved by neither CPLEX MIP solver, nor by our GA-VNS hybrid method proposed in [3]. Finally, after changing the representation of the solution, we were able to develop a simple and efficient VNS heuristic employing LPS as the local search algorithm. Our VNS heuristic outperforms CPLEX solver, and moreover, provides the results in a
126
J. Duda, A. Stawowy / Electronic Notes in Discrete Mathematics 66 (2018) 119–126
shorter time, which makes it suitable for quick rescheduling tasks, which are now very common in advanced planning and scheduling systems. Such results could be achieved due to the use of smart operations at the neighborhood generation stage, many different ways of neighborhood changing, and the use of LP as a local optimization procedure. There are certainly opportunities for further improvement of the proposed approach. First, new ways of generating neighborhoods using specific knowledge of the problem can be developed. Second, more efficient local search heuristics may be used instead of LP during optimization stage.
Acknowledgments This work is supported by AGH University statutory research no. 11/11.200.327.
References [1] Chen, H., Fix-and-optimize and variable neighborhood search approaches for multi-level capacitated lot sizing problems, Omega 56 (2015), pp. 25–36. [2] de Araujo, S. A., M. N. Arenales and A. R. Clark, Lot sizing and furnace scheduling in small foundries, Computers & Operations Research 35 (2008), pp. 916–932. [3] Duda, J., A hybrid genetic algorithm and variable neighborhood search for multifamily capacitated lot-sizing problem, Electronic Notes in Discrete Mathematics 58 (2017), pp. 103–110. [4] Kobbacy, K. A. H., S. Vadera and M. H. Rasmy, AI and OR in management of operations: history and trends, Journal of the Operational Research Society 58 (2007), pp. 10–28. [5] Mladenovi´c, N. and P. Hansen, Variable neighborhood search, Computers & Operations Research 24 (1997), pp. 1097–1100. [6] Seeanner, F., B. Almada-Lobo and H. Meyr, Combining the principles of variable neighborhood decomposition search and the fix&optimize heuristic to solve multilevel lot-sizing and scheduling problems, Computers & Operations Research 40 (2013), pp. 303–317. [7] Zhao, Q., C. Xie and Y. Xiao, A variable neighborhood decomposition search algorithm for multilevel capacitated lot-sizing problems, Electronic Notes in Discrete Mathematics 39 (2012), pp. 129–135.