Modified Harmony Search Algorithm for the Capacitated Vehicle Routing Problem

Size: px
Start display at page:

Download "Modified Harmony Search Algorithm for the Capacitated Vehicle Routing Problem"

Transcription

1 Modified Harmony Sear Algoritm for te Capaitated Veile Routing Problem Tantikorn Pipibul, Ruengsak Kawtummaai Abstrat Tis paper presents te modifiation of a armony sear algoritm (HS) for te apaitated veile routing problem (CVRP). Te objetive is to find a feasible set of veile routes tat minimizes te total traveling distane and te number of veiles used. Te modified HS as two stages. First, te probabilisti Clarke-Wrigt savings algoritm was inorporated into armony memory meanism to improve its initial solution. Seond, te roulette weel seletion proedure was employed into new armony improvisation meanism to improve its seletion proess. Computational results on te well-known CVRP benmark problems sow tat te modified HS is ompetitive to te best existing algoritms. Index Terms Veile Routing Problem, Harmony Sear Algoritm, Clarke-Wrigt Savings Algoritm, Optimization. T I. INTRODUCTION HE purpose of tis paper is to develop a new approa for armony sear algoritm (HS) to solve te apaitated veile routing problem (CVRP) wi is te first variant of te well-known veile routing problem introdued by Dantzing and Ramser [1]. It is known to be NP-ard problem [2] wi is te ombination between te traveling salesman problem and te bin paking problem. In Fig. 1, an example of te CVRP onsists of one depot wi is assigned to be number 0, five ustomers wi are assigned to be number 1 to 5 and two veile routes. Ea route represents a sequene of ustomers served by a veile. Bot veiles are omogeneous fleet and always depart from te depot. After ompleting te servie, bot veiles must return to te depot as sown in Fig. 1 tat te routes are and Te objetive of tis paper is to onstrut te veile routes tat minimize te total traveling distane and te number of veiles used. Te onstraints of te CVRP are as follows. --Ea ustomer must be served one by one veile. --All veiles start and end at te depot. --Te ustomer demand in ea veile annot exeed te apaity. --Te veiles used in ea solution annot exeed te number of available veiles. Sine te CVRP was proposed in 1959, many algoritms were developed to solve te problem onsisting of an exat Manusript reeived January 8, Tantikorn Pipibul is a leturer wit te Business Administration Faulty, Panyapiwat Institute of Management, Nontaburi, Tailand ( pipibul@gmail.om). Dr.Ruengsak Kawtummaai is an assoiate professor wit te Business Administration Faulty, Panyapiwat Institute of Management, Nontaburi, Tailand ( ruengsak@yaoo.om). Fig. 1. An example of te CVRP. algoritm (bran-and-bound algoritm [3], bran-and-ut algoritm [4], bran-and-ut-and-prie algoritm [5]), a euristi algoritm (Clarke-Wrigt savings algoritm [6], sweep algoritm [7]), and a metaeuristi algoritm (simulated annealing [8], tabu sear [9], geneti algoritm [10], ant olony optimization algoritm [11], partile swarm optimization algoritm [12]). Altoug te algoritms tat we ave mentioned above an find optimal or near-optimal solutions, te development of new algoritms, wi an produe better solutions in less iteration, as still reeived attention from te researers. Due to te suessful appliations to various optimization problems [13][14], we terefore studied te HS wi is one of reent algoritms. In addition, we also modified te HS to suitably solve te CVRP in tis paper. II. HARMONY SEARCH ALGORITHM In 2001, te armony sear algoritm (HS) was originally proposed by Geem et al. [15]. It is simulated by te proess of musi improvisation tat an example is sown in Figs. 2 to 4. Te illustration in Fig. 2 presents a group of musiians playing musial instruments togeter. Ea musiian sounds any pit witin te possible range of notes (Do, Re, Mi, Fa, Sol, La, Ti) in tree times. Te omposition of notes in ea time inluding (Sol, Mi, Do), (La, Fa, Re), and (Do, Sol, Mi) makes tree armony vetors wi are kept in te armony memory (HM). Ea armony vetor is estimated by an aesteti standard. In te improvisation proess, a new armony vetor is made by using memory onsideration, pit adjustment and random seletion. Fig. 3 sows an example of te new armony improvisation. In Fig. 3 (a) te notes in te first instrument (Cello) of tree armony vetors from te HM are osen to be new note (La) wit equal probability (33.3%) by te

2 Aestetis (50%) by te pit adjustment wit a probability of pit adjusting rate (PAR). In Fig. 3 (), new note (Sol) in te tird instrument (Viola) is osen witin te possible range of notes (Do, Re, Mi, Fa, Sol, La, Ti) by te random seletion wit a probability of 1-HMCR. If te new armony vetor (La, Re, Sol) is better tan te worst armony vetor (Do, Sol, Mi) in te HM as sown in Fig. 4 (a), te new armony vetor is updated to te HM instead of te worst one as sown in Fig. 4 (b). Tis proess is repeated until a perfet armony is found by te musiians. Fig. 2. An example of te armony memory. Random number = 0.55 (a) Memory onsideration. Range of notes New C D E F G A B Viola G (Sol) (b) Pit adjustment. () Random seletion. Fig. 3. An example of te new armony improvisation. (a) Comparing te new armony vetor wit te worst one. (b) Updating te new armony vetor instead of te worst one. Fig. 4. An example of te armony memory update. memory onsideration wit a probability of armony memory onsidering rate (HMCR). In Fig. 3 (b), after te new note (Mi) in te seond instrument (Violin) is osen from te memory onsideration, it is sifted to be new note (Re), wi is neigboring notes omposed of an upper note (Re) and a lower note (Fa), witin te possible range of notes (Do, Re, Mi, Fa, Sol, La, Ti) wit equal probability III. MODIFIED HARMONY SEARCH ALGORITHM FOR THE CAPACITATED VEHICLE ROUTING PROBLEM Te proess of musi improvisation desribed in Setion II an be modified to solve te apaitated veile routing problem (CVRP) tat te objetive is to find te optimum or near-optimum solution of te veile routes iteration by iteration. In tis paper, te proedures of te HS are explained and applied to te CVRP as following Subsetions. A. Initializing te HS parameters Te HS inludes some parameters wi are desribed as follows: --Harmony memory (HM) is a set of armony vetors tat te best armony vetor is ranked at te first vetor and te oters are sorted in te inreasing order based on te aesteti values. --Harmony memory size (HMS) is te number of armony vetors in te HM. --Harmony vetor is a set of notes of all musial instruments. --Range of notes is a set of ustomers wo require delivery of goods from te depot. --Note is ustomer s identity to serve by te veile. --Musial instrument is te sequene of ustomer for delivery. --Aesteti value is te total traveling distane between notes in ea armony vetor. --Harmony memory onsidering rate (HMCR) is a probability number to oose a note from te HM for te memory onsideration as sown in Fig. 3 (a). For te random seletion as sown in Fig. 3 (), te probability of 1-HMCR is used to oose a random note witin te possible range of notes. --Pit adjusting rate (PAR) is a probability number to oose a neigboring notes from note of te memory onsideration witin te possible range of notes as sown in Fig. 3 (b). --Pratie time is te number of iterations wi is set as te stopping ondition. B. Initializing te HM In order to suitably solve te CVRP by using te HS, we terefore modify te strutures of te HM aording to te HS parameters as sown in Fig. 5. Te CVRP routes from Fig. 1 are presented as an example solution by using te ustomers data from Tables I and II inluding loation, demand, and Eulidean distane matrix. We assume five

3 Fig. 5. An example of te armony memory for te CVRP. TABLE I CUSTOMERS' LOCATION AND DEMAND Customer Loation (X, Y) Demand 0 (0, 0) 0 1 (10, -20) 1 2 (20, -10) 1 3 (0, -20) 1 4 (20, 0) 1 5 (20, -20) 1 TABLE II EUCLIDEAN DISTANCE MATRIX Customer ustomers wi are served by two veiles. Te number of notes in ea armony vetor is also equal to five based on te number of ustomers. In ea armony vetor, tere are five integer numbers between one and five in order to identify ea ustomer. Notie tat, te ustomer s identity in ea note must be distint due to te CVRP onstraint tat ea ustomer must be served one by one veile. As sown in Fig. 5, if we suppose ea ustomer demand to be equal to one and ea veile apaity to be equal to tree, te aesteti standard of te HS for te CVRP is alulated by onsidering te omposition of notes in ea armony vetor. For te armony vetor (1, 2, 3, 4, 5), we assign te first plae to start from te depot (represented by ustomer 0), and ten assign te ustomer 1 in te first note to be te next plae. Te Eulidean distane between depot and ustomer 1, wi is equal to 22.36, is osen from Table II, and te demand of ustomer 1, wi is equal to one, is added to te first veile. We repeat tis proess until te remaining apaity of te first veile is equal to zero or less tan te demand of te next remaining ustomer due to te CVRP onstraint tat te ustomer demand in ea veile annot exeed te apaity. For te first veile, te ustomer 3 in te tird note is te last ustomer tat we assign to return to te depot due to te CVRP onstraint tat all veiles start and end at te depot. In te fourt note, we start te seond veile from te depot and ten follow by te ustomer 4. Finally, te ustomer 5 is assigned to be te last ustomer for te seond veile before return to te depot. Hene, bot routes are onstruted as ( ) in wi te traveling distane is equal to 78.86, and ( ) in wi te traveling distane is equal to Te total traveling distane of bot routes is alulated as te aesteti value for tis armony vetor. In general, te HS always randomly generates ea armony vetor to ollet in te HM. In addition, we generate one more armony vetor by using an improved Clarke and Wrigt savings algoritm proposed by Pipibul and Kawtummaai [16] in order to make a better ane to rea te best armony vetor. C. Improvising a new armony vetor A new armony vetor is generated by using memory onsideration, pit adjustment and random seletion tat we applied te roulette weel seletion wi is one of an operator in te geneti algoritm [17] to improve te seletion proess. First, in te general memory onsideration, te ustomers in ea sequene of all armony vetors in te HM are osen to be a new ustomer wit equal probability. In ontrast, we use te probabilities reated by te roulette weel seletion proess. For armony vetor number wit total traveling distane, its seletion probability p and umulative probability q are alulated as: p ih p i i i for H (1) q for H (2) Here, H is te HMS. Te seletion proess starts by spinning te roulette weel wit a random number r from r q, ten oose te te range between 0 and 1. If 1 ustomer from te first armony vetor 1 ; oterwise, oose te ustomer from te t armony vetor ( 2 H ). Note tat, te ustomers wo are osen by te roulette weel seletion proess are disarded from te next seletion proess in order to avoid te dupliate ustomer. Seond, in te general pit adjustment, after te new ustomer is osen from te memory onsideration, it is sifted to be new ustomer, wi is neigboring ustomers omposed of an upper ustomer and a lower ustomer wit equal probability. In ontrast, we onsider te neigboring ustomers by ranking te distanes between te new ustomer and te oters. Finally, in te general random seletion, te new ustomer is osen witin te possible range of ustomers. In ontrast, we also use te probabilities reated by te roulette weel seletion proess. For ustomer number wit distane from te new ustomer d, its seletion probability p and umulative probability

4 q are alulated as: p d d ih p i i i for C (3) q for C (4) Here, C is te number of available ustomers (wi is unassigned to be te new ustomer in te new armony vetor). Te seletion proess starts by spinning te roulette weel wit a random number r from te range between 0 and 1. If r q1, ten oose te ustomer from te first ustomer d 1 ; oterwise, oose te ustomer from te t ustomer d ( 2 C ). D. Updating te HM Te new armony vetor replaes te worst armony vetor in te HM if te total traveling distane of te new armony vetor is less tan te worst one. After tat, all armony vetors in te HM are sorted in te inreasing order based on te total traveling distane. Note tat, te best armony vetor wi represents te best CVRP solution is always ranked at te first position in te HM. E. Stopping ondition Te proedures of te HS are ontinued until te stopping ondition represented by te number of iterations is satisfied. IV. COMPUTATIONAL RESULTS Te modified HS was oded in Visual Basi 6.0 on an Intel Core i7 CPU 860 loked at 2.80 GHz wit 1.99 GB of RAM under Windows XP platform. Before te exeution, we ave preset te HS parameters (inluding HMS = 50, HMCR = 0.95, PAR = 0.5, Pratie time = 1000). Te numerial experiment used well-known CVRP benmark problems omposed of 71 instanes [18][19][20] wi are available online at ttp:// In ea instane, we use te same nomenlature, onsisting of a data set identifier, followed by n wi represents te number of ustomers (inluding depot), and k wi represents te number of available veiles. We disuss ea CVRP benmark problem in wi te perentage deviation between te optimal solution (OPT ) and te obtained solution (OBT ) is alulated as follows: Perentage deviation = obt opt 100 (5) opt Te numerial results are sown in Table III. Out of 71 problems, we found te optimal solutions, wi are igligted by using bold type, for all problems wit up to 135 ustomers. Tese indiate tat te proposed HS is very effetive and effiient in produing ig quality solutions for well-known CVRP benmark problems. V. CONCLUSIONS In tis paper, we ave presented a modified armony sear algoritm to solve te apaitated veile routing problem (CVRP). We ave modified te armony sear algoritm (HS) by two proedures onsisting of te probabilisti Clarke and Wrigt savings algoritm and te roulette weel seletion proedure. We also ave done te experiments by using te well-known CVRP benmark problems omposed of 71 instanes obtained from te literatures, and ave ompared tem wit te optimal solutions. Te omputational results sow tat te proposed HS is ompetitive to te best existing algoritms in terms of solution quality. It generates te optimal solution in all of te tested instanes. Terefore, we an onlude tat te performane of our algoritm is exellent wile omparing wit oter algoritms in ea instane. REFERENCES [1] G. B. Dantzig and J. H. Ramser, Te truk dispating problem, Management Siene, vol. 6, pp , [2] P. Tot and D. Vigo, Te veile routing problem, in SIAM monograps on disrete matematis and appliations. Piladelpia: SIAM Publising, [3] N. Cristofides, A. Mingozzi and P. Tot, Exat algoritm for te veile routing problem, based on spanning tree and sortest pat relaxations, Matematial Programming, vol. 20, pp , [4] M. L. Fiser, Optimal solution of veile routing problems using minimum K-trees, Operations Resear, vol. 42, pp , [5] R. Fukasawa, H. Longo, J. Lysgaard, M. Poggi de Aragão, M. Reis, E. Uoa and R. F. Wernek, Robust bran-and-ut-and-prie for te apaitated veile routing problem, Matematial Programming Series A, vol. 106, pp , [6] G. Clarke and J. W. Wrigt, Seduling of veiles from a entral depot to a number of delivery points, Operations Resear, vol. 12, pp , [7] A. Wren and A. Holliday, Computer seduling of veiles from one or more depots to a number of delivery points, Operational Resear Quarterly, vol. 23, pp , [8] S. Kirkpatrik, J. Gelatt and M. Vei, Optimization by simulated annealing, Siene, vol. 220, pp , [9] F. Glover, Heuristi for Integer Programming Using Surrogate Constraints, Deision Sienes, vol. 8, pp , 1977 [10] J. H. Holland, Adaptation in Natural and Artifiial Systems. Ann Arbor: University of Miigan Press, [11] M. Dorigo, V. Maniezzo and A. Colorni, Ant system: optimization by a olony of ooperating agents, IEEE Transations on Systems, Mans, and Cybernetis, vol. 1, pp , [12] J. Kennedy and R. Eberart, Partile swarm optimization, in Pro. IEEE International Conferene on Neural Networks, Pert, 1995, pp [13] K. S. Lee and Z. W. Geem, A New Meta-Heuristi Algoritm for Continuous Engineering Optimization: Harmony Sear Teory and Pratie, Computer Metods in Applied Meanis and Engineering, vol. 194, pp , [14] Z. W. Geem, M. Fesangary, J. Coi, M. P. Saka, J. C. Williams, M. T. Ayvaz, L. Li, S. Ryu and A. Vasebi, Reent Advanes in Harmony Sear, in Advanes in Evolutionary Algoritms, W. Kosinski, Ed. Vienna: I-Te Eduation and Publising, 2008, pp. 468.

5 No Instane Optimal solution Ganes and Narendran [21] Juan et al. [22] TABLE III COMPUTATIONAL RESULTS Perentage deviation wit te optimal solution (%) Groër et al. [23] Ai and Kaitviyanukul [24] Kim and Son [25] Mogaddam et al. [26] Pipibul and Kawtummaai 1 A-n32-k A-n33-k A-n33-k A-n34-k A-n36-k A-n37-k A-n37-k A-n38-k A-n39-k A-n39-k A-n44-k A-n45-k A-n45-k A-n46-k A-n48-k A-n53-k A-n55-k A-n60-k A-n61-k A-n63-k A-n65-k A-n80-k B-n31-k B-n34-k B-n35-k B-n38-k B-n39-k B-n41-k B-n43-k B-n44-k B-n45-k B-n45-k B-n50-k B-n50-k B-n51-k B-n52-k B-n56-k B-n57-k B-n57-k B-n63-k B-n64-k B-n66-k B-n67-k B-n68-k B-n78-k P-n23-k P-n40-k P-n45-k P-n50-k P-n50-k P-n50-k P-n51-k P-n55-k P-n55-k P-n55-k P-n55-k P-n60-k P-n60-k P-n65-k P-n70-k P-n76-k P-n76-k P-n101-k E-n30-k E-n51-k E-n76-k E-n76-k E-n76-k F-n45-k F-n72-k F-n135-k

6 [15] Z. W. Geem, J. H. Kim and G. V. Loganatan, A New Heuristi Optimization Algoritm: Harmony Sear, Simulation, vol. 76, pp , [16] T. Pipibul and R. Kawtummaai, An improved Clarke and Wrigt savings algoritm for te apaitated veile routing problem, SieneAsia, vol. 38, pp , [17] J. Holland, Adaptation in Natural and Artifiial Systems, Ann Arbor: University of Miigan Press, [18] P. Augerat, J. Belenguer, E. Benavent, A. Corbern, D. Naddef and G. Rinaldi, Computational results wit a bran and ut ode for te apaitated veile routing problem, Grenoble, Frane: Universite Josep Fourier, [19] N. Cristofides and S. Eilon, An algoritm for te veile dispating problem, Operational Resear Quarterly, vol. 20, pp , [20] M. L. Fiser, Optimal solution of veile routing problems using minimum K-trees, Operations Resear, vol. 42, pp , [21] K. Ganes and T. T. Narendran, CLOVES: A luster-and-sear euristi to solve te veile routing problem wit delivery and pikup, European Journal of Operational Resear, vol. 178, pp , [22] A. A. Juan, J. Faulin, R. Ruiz, B. Barrios and S. Caballé, Te SR- GCWS ybrid algoritm for solving te apaitated veile routing problem, Applied Soft Computing, vol. 10, pp , [23] C. Groër, B. Golden and E. Wasil, A library of loal sear euristis for te veile routing problem, Matematial Programming Computation, vol. 2, pp , [24] T. J. Ai and V. Kaitviyanukul, Partile swarm optimization and two solution representations for solving te apaitated veile routing problem, Computers & Industrial Engineering, vol. 56, pp , [25] B. I. Kim and S. J. Son, A probability matrix based partile swarm optimization for te apaitated veile routing problem, Journal of Intelligent Manufaturing, vol. 23, pp , [26] B. F. Mogaddam, R. Ruiz and S. J. Sadjadi, Veile routing problem wit unertain demands: An advaned partile swarm algoritm, Computers & Industrial Engineering, vol. 62, pp , 2012.