Evolutionary algorithm for bin packing problem

in GGA; there is also the penalty term as the element of the fitness function.3. **Evolutionary** based heuristicThe version of the evolutionary strategy used by the author is the result of his studies of evolutionary **algorithm**s inflowshop **problem** [7]. No attempts were made to fine-tune any of the **algorithm** parameters. That is (1, λ) - ESwherein λ descendants are generated from one parent using simple operators. No crossover is applied. The best ofthe descendants becomes the new parent solution.The overall procedureThe general **for**m of the applied **algorithm** written in PASCAL pseudo-codes is presented below.BEGINgenerate and evaluate random starting solution;best solution:= start solution;REPEATFOR i:=1 to λ DOBEGINcopy parent to create child number i ;mutate child i;END;evaluate children;choose best child based on objective function to be a new parent;UNTIL (max. generation);output best solution;END.Chromosome representationPermitted solutions are represented by the list of n elements and s group separators, whereas the value j (1≤j≤n)can appear only once and so can the value i (n+1≤i≤n+s), indicating the separator number.There**for**e, **for** 7 elements and 3 group separators the solution in the **for**m R 1= (1,2,9,8,5,2,7,10,6,4) willmean that the elements **for**m three **bin**s (1,3); (5,2,7); (6,4), while the solution R 2=(1,10,3,8,5,2,9,7,6,4) meansthat the elements ought to be packed into four **bin**s (1), (3), (5,2), (7,6,4).It is accepted that s=ROUND (0.7* n)The initial populationThe initial population was obtained in a random manner.The fitness functionIn the **algorithm** the maximum of the following function was sought:FD =N∑i = 1Fis⋅ ⎛ ⎝ ⎜ ⎞⎟C ⎠N2whereN - the number of **bin**s in the given solutionFi - the sum of weights of the elements packed into the **bin** i, i=1..NC - the **bin** capacitys- a penalty constant, such that:⎧ 1s = ⎨⎩−1**for** F ≤ Ci**for** F > Ci2

Applied operatorsThe **algorithm** made use of the operators presented in the publications on the subject, that is: exchange andinsertion mutations and inversion. The characteristic feature of the **algorithm**, the one distinguishing it from thoseproposed by other authors is that both elements and separators are subjected to genetic operators.The final version of the evolution strategy **for** the BPP is characterised by the elements and parameterssummarised in Table 1.Fitness functionPopulationRepresentationReproductionInitializationSelection **for** the nextgenerationTermination criterionCrossoverOther operators4. Experimental testsTable 1. Anatomy of the evolution strategy **for** the **bin** **packing** **problem**FD =N∑i = 1Fis⋅ ⎛ ⎝ ⎜ ⎞⎟C ⎠N2a list (sequence) of n parts and s separators of the groups1 parent, 10 descendants1 randomly generated solutionthe best descendant replaces the parentafter realization of 45 000 generationsnot appliedexchange, insertion and inversion applied at an equal probabilityTests were run using 8 sets with 20 **problem**s each, the **problem**s being included in the Beasley’s library [2]. These**problem**s were divided into two groups:• elements whose weights were drawn at random from the uni**for**m distribution of the interval [20...100] are tobe placed in the **bin**s of the size 150, the number of elements being 120, 250, 500, 1000,• elements whose values are taken from the interval [0.25...0.50] are to be placed in the **bin**s of the size 1, thenumber of elements being 60, 120, 249, 501- 1/3 of which has considerable weight, while the weigh of theremaining 2/3 is rather small (less than 1/3 of the **bin** size).It must be emphasised that ES itself involves some random searching. There**for**e, each calculation using the sameset of input data may yield different solution. Because of that, three runs were completed **for** each set of data, thenthe best solution was selected. During one run the **algorithm** would analyse 450 000 solutions, which is a minorpart of the search space. It is comparable to the value applied by Khuri et al. (1000 generations, each yielding 500solutions).Table 2 presents the results obtained **for** well-known approximate **algorithm**s **for** 2 out of 8 sets from theBeasley’s library: **bin**pack4 **for** 1000 elements and **bin**pack8 **for** 501 elements, which are the major and the mostdifficult **problem**s from the first and the second group of **problem**s, respectively.Results of those tests have confirmed the superiority of Falkenauer’s GGA **algorithm**, especially in relation to**problem**s involving large dimensions. Algorithm proposed by Martello and Toth and FFD are adequate whilesolving the **problem**s from the first group. In the case of those considered by Falkenauer to be more difficult, these**algorithm**s prove inadequate. The **algorithm** by Khuri et al. gives the worst results. The evolution strategydeveloped by the author yields slightly less satisfactory results than GGA proposed by Falkenauer. It is moreadvantageous that other techniques, especially in relation to the second group of **problem**s.3

Table 2. Runs per**for**med by FFD, GGA, MTP (Mortello and Toth), ES-K (Khuri Evolution Strategy) and ES-S(Stawowy Evolution Strategy); OPT - global optimumBINPACK4BINPACK8No. OPT FFD GGA MTP ES-K ES-S No. OPT FFD GGA MTP ES-K ES-S1 399 403 399 403 509 403 1 167 190 167 184 211 1682 406 411 406 410 519 409 2 167 191 167 181 213 1683 411 416 411 416 526 415 3 167 190 167 177 210 1684 411 416 411 416 532 417 4 167 190 167 180 216 1685 397 402 397 401 498 402 5 167 191 167 181 213 1686 399 404 399 402 506 403 6 167 190 167 183 207 1687 395 399 395 398 497 400 7 167 190 167 183 209 1698 404 408 404 406 521 411 8 167 189 167 183 208 1699 399 404 399 402 512 406 9 167 191 167 177 209 16810 397 404 397 402 513 403 10 167 190 167 185 210 16811 400 404 400 404 504 403 11 167 190 167 179 212 16812 401 405 401 404 508 405 12 167 190 167 178 213 16813 393 398 393 396 494 397 13 167 190 167 187 209 16814 396 401 396 401 511 400 14 167 190 167 181 205 16815 394 400 394 399 504 398 15 167 189 167 183 214 16916 402 408 402 407 516 408 16 167 190 167 181 209 16817 404 407 404 407 515 407 17 167 189 167 183 209 16818 404 409 404 407 524 408 18 167 191 167 183 210 16819 399 403 399 403 514 403 19 167 189 167 180 206 16920 400 406 400 405 509 404 20 167 191 167 188 209 1684