• No results found

Implementing the Five-Block Heuristic for 2D-KP

In document Packing in two and three dimensions (Page 147-150)

E. A FIVE-BLOCK HEURISTIC FOR 2D-KP

1. Implementing the Five-Block Heuristic for 2D-KP

The main difference between the four-block and five-block heuristics, as indicated by their titles, is the maximum number of blocks containing items of the same type allowed in the solution. The four-block heuristic generates solutions similar to Figure II.7, while the five-block heuristic can produce solutions resembling Figure II.8.

As in the PLP case, we only consider linear combinations of the length and width of each item being packed when defining the dimensions of the two initial corner blocks (blocks I and III). Then, we apply the G5-heuristic within each block to determine the packing pattern. We store the best packing patterns obtained for a block with given dimensions so we can use it again later in the algorithm, if necessary.

For each item k, we consider, without loss of generality, that lkwk. The dimensions of block ,i i=1, 2,3, 4,5, are given by ( , )L W , and i i C the total value of the i items packed in block i . In the algorithm proposed by Scheithauer and Sommerweiss

[1998], C is defined by the used area within each block. In the present algorithm, we i consider the more general case of 2D-KP.

Let { |Gl = g g L g n l≤ , = ∗ + ∗k m w for someitem kk, } be the set of dimensions to be investigated as the length of blocks I and III.

Let { |Gw= g g W g n l≤ , = ∗ + ∗k m w for someitem kk, }be the set of dimensions to be investigated as the width of blocks I and III.

The pseudocode for the five-block heuristic for 2D-KP is: For each L1∈ , Gl L2 ←X L− 1

For each W1∈Gw, W3 ← −Y W1,computeC1

For each L3∈ , Gl L4X L3, computeC4

For each W3∈Gw, W2 ← −Y W3,computeC2andC3

If no blocks overlap, then Compute L W5, 5andC 5

If C1+C2+C3+C4+C5 is higher than the previous best, record solution.

2. Computational Results

Scheithauer and Sommerweiss [1998] use sets of 100 random generated instances to investigate the performance of the four-block heuristic. The bin has fixed dimensions, 1, 250 800× , and items are uniformly generated in the range

[

100, 300

]

. All instances initially have four different item types, and additional item types are added until ten different types are available in each instance. Then the algorithm is applied successively to each instance, with from four up to ten item types. In our analysis of the performance of the five-block heuristic, we use a set of instances generated using the same procedure. Initially, the objective is to minimize wasted area.

Table VI.8 presents some statistics computed from the results of the application of the five-block heuristic to the set of 100 instances. Columns are numbered from four to ten, representing the number of different item types in each instance group. The “G5-heuristic” and “Four-block” rows present the average area usage resulting from the selection of the

area usage obtained with the five-block, with the same instances. The number of instances, out of 100, where the five-block yields a better result than the four-block is counted in the row “Better.” 4 5 6 7 8 9 10 Four-block (%) 98.70 98.94 99.15 99.27 99.39 99.46 99.52 G5-heuristic (%) 95.72 96.22 96.56 96.78 97.00 97.15 97.32 Five-block (%) 98.82 99.04 99.23 99.34 99.46 99.51 99.57 Better 36 35 36 42 39 35 39

Table VI.8 Average area usage obtained with three different block heuristics.

Columns are numbered from four to ten, representing the number of different item types in each set of instances. Each set is composed of 100 randomly generated problems. The “G5-heuristic” and “four-block” rows contain the average area usage resulting from the selection of the best G5-heuristic pattern, and best four-block pattern. The “Five-block” row has average area usage obtained with the five-block, with the same instances. The number of instances, out of 100, where the five-block yields a better result than the four- block is counted in the row “Better.”

In the table, we can observe that more than 35% of the instances had a better solution using the five-block heuristic, although the improvement in area usage is small. The relative change in wasted area, when it occurs, is on the order of 20%. The authors of the four-block heuristic observe that up to 96 items can be packed in the instances considered. In this case, the items are small relative to the bin, making them easer to pack.

The average run times for the five-block heuristic are compatible with those reported for the four-block heuristic, but the run times with the five-block heuristic do not increase with number of types of items as quickly as with the four-block (as reported by Scheithauer and Sommerweiss [1998], and shown in Table VI.9). The run times presented in the table for the five-block corresponds to the execution on a Athlon 1 GHz personal computer. For the four-block heuristic, times are those reported in the original work on a 586 200 MHz personal computer.

Heuristic 4 5 6 7 8 9 10 Four-block (Sec) 0.20 0.34 0.54 0.73 1.02 1.37 1.78

Five-Block (Sec) 0.10 0.14 0.17 0.21 0.24 0.28 0.34 Table VI.9 Average run times, in seconds, with the five-block heuristic, in the present research, and the four-block heuristic, as reported by Scheithauer and Sommerweiss [1998].

We generate a second set with 100 random instances, this time with items with dimensions selected in the range

[

200, 400

]

, and the same bin. Instances with this range of

items contain a minimum of 6 and a maximum of 24 items. Table VI.10, with the same layout as Table VI.9, presents the results for this new set.

4 5 6 7 8 9 10 Four-block (%) 96.41 97.08 97.47 97.80 98.10 98.39 98.52 G5-heuristic (%) 92.46 93.24 93.65 93.91 94.28 94.61 94.80 Five-block (%) 96.51 97.19 97.52 97.90 98.21 98.49 98.60 Better 11 14 12 18 25 22 23

Table VI.10 Results obtained with 100 instances, item dimensions selected in the range [200,400], with the same layout as Table VI.8.

In this range, although the number of cases in which the five-block heuristic generates a better solution is smaller than in Table VI.9, the relative change in the wasted area is about the same.

In document Packing in two and three dimensions (Page 147-150)