Efficient waste reduction algorithms based on alternative underestimates for the modified Wang method

This paper is concerned with wastage reduction in constrained two-dimensional guillotinecut cutting stock problems, often called trim loss problems. A number of researchers report in the literature on algorithmic approaches to find exact solutions for the trim loss problem. Alternative heuristic functions are investigated and applied to the modified Wang method. This involves the sharpening of underestimates used in the methods heuristic function. Two aspects of these solution approaches are considered and some empirical results are given. The first part considers the feasibility to construct more informed heuristic functions. The second part investigates the role of more informedness on the computational cost of these search processes.


Introduction
The constrained two-dimensional guillotine-cut cutting stock (C2DGC) problem is considered here.An algorithm is introduced that is based on the algorithms proposed by Wang [10] denoted by WA and a modified WA-algorithm by Oliveira and Ferreira [8] denoted by WAM in this paper.These algorithms still form the core of exact trim loss algorithms.
The WA method exploits a way of building larger rectangles by joining smaller ones.Wang proposed two algorithms based on this method to solve C2DGC problems.Using this bottom-up rectangle building approach, larger rectangles are gradually generated from the rectangles and rotated versions of the rectangles.They also distinguish between "horizontal" and "vertical" builds in the building process.Every newly generated rectangle may contain trim loss.This trim loss is called internal trim loss for the build.Further trim loss can in general be expected if this build is subsequently combined with other rectangles to form a larger build and the process can be repeated until no further expansion can take place as limited by the dimensions of the stock sheet.Such a build is called a maximal build.The unused part of the stock sheet (if any) also contributes to trim loss.We refer to the latter trim loss as external trim loss.Pertaining to this maximal build the total trim loss of the stock sheet is thus the sum of the internal trim loss for the build and the external trim loss associated with the build.
The WAM algorithm employs techniques of Gilmore and Gomory [4] to (under)estimate the expected total trim loss associated with a build.In the first part of this paper some ideas are investigated to sharpen these (under)estimates to possibly reduce the search space by means of more informed heuristics.The typical search framework is employed where the evaluation function (of a node to be considered in the search) consists of the sum of a cost function and a heuristic function.The evaluation function in this case consists of the "cost" of a build (internal trim loss) plus a heuristic (under)estimate of further "costs" (trim loss external to the build).Some empirical results are given.In the second part of the paper the results are interpreted in the sense that the trade-off is considered between the benefits of informedness and the higher computational cost of the more complex control strategies of the search.
The remainder of the paper is structured as follows.In §2, the problem is presented and current algorithmic approaches used to solve the problem, are discussed.In §3 an algorithm to solve some larger, industry-sized real life problem instances are presented and §4 contains an example illustrating some of these concepts.In §5 empirical tests and results are shown where the effectiveness of the algorithmic approaches is evaluated.

Problem representation and algorithmic approaches
The C2DGC problem may be defined as follows.Let S be a stock sheet of length L ∈ I + and width W ∈ I + where L ≥ W , and let R be a set of demand rectangles.These rectangles have types r i (i = 1, . . ., n), where each type has a demand constraint of b i ∈ I + , a length of i ∈ I + and a width of w i ∈ I + .Since rotation is allowed in this model, it is assumed that there is a demand constraint b i concerning the maximal number of rectangles of a certain type r i to be produced taking equivalence regarding rotation into account.A guillotine cutting pattern with minimum trim loss must thus be determined that produces no more than b i replicates of rectangle type r i .
The WA-algorithm [10] given in Algorithm 1 terminates with an optimal (exact) solution to the C2DGC problem.Note that when the WA-algorithm returns to Step 1(b) (from Step 4) with an increased β value, it discards all previous builds and information.Note also that the WA-algorithm considers storage of a rectangle in Step 2 (a)(ii) using only internal trim loss.i. T results from a feasible horizontal or vertical build of two rectangles from L (k−1) .ii.The internal trim loss of T does not exceed β • L • W . iii.T does not violate the demand of constraints b1, . . ., bn. 1) , set k ← k + 1 and go to Step 2. 4. For each maximal build of L (k) compute the total trim loss and select the build with the smallest total trim loss.If it is less than or equal to β • L • W , it is optimal and the algorithm terminates.Otherwise, increase β by δ and go to Step 1(b).
In Oliveira and Ferreira [8] the same representation and building process as the WA method is used with the main difference that the requirement in Step 2 (a)(ii) is changed.They require that the internal trim loss of T plus an underestimate of further trim loss incurred by expanding builds based on T should not exceed β • L • W .The underestimate of Oliveira and Ferreira is based on the solution of a two-dimensional knapsack function as described by Gilmore and Gomory [4].Daza et al. [3] propose a different way of calculating the underestimates that is motivated by the desire to find a monotone and admissible heuristic for the search procedure.
Neither Oliveira and Ferreira or Daza et al. discuss the possible re-use of previous build information in the design of the algorithms.In this paper the use of build information to produce sharper underestimates is considered.

Algorithms based on alternative heuristic functions
The WAM-algorithm [8] employs at every coordinate of a lookup table (as used in their evaluation function to identify builds that should be stored) underestimates of further waste using the underestimates produced by solving an unbounded two-dimensional knapsack function.In this section a procedure is explored that can be used to produce underestimates either by superimposing it on the estimates provided by the Gilmore and Gomory method [4] or using it in a standalone fashion using other easily obtained underestimates.These algorithms are based on the information obtained by the application of the WA-algorithm to a portion of the stock sheet and generating underestimates as part of the process.The details of the proposed PSSP-algorithm (partial stock sheet propagation algorithm) are given in Algorithm 2. The PSSP-algorithm is given as an example of methods that can be employed to improve the informedness of heuristic underestimates like that of Gilmore and Gomory.
In this paper the following four approaches are considered although there may be others that can be devised: Algorithm 2: The PSSP-algorithm 1. Choose a value of β, 0 ≤ β < 1 and a value for δ. (Normally close to zero).

Initialize an array
A with dimensions W and L by using underestimates of waste at every coordinate.Specifically the unbounded two-dimensional knapsack function of Gilmore and Gomory [4] can be used.Fill each cell of A with the value obtained.Note that any legitimate underestimates will also suffice (like underestimates of zero).3. Choose S such that 0 < S ≤ 1 ( §5 discusses possible choices).4. Consider the partial stock sheet with dimensions S • W and L. Apply the WA-algorithm to the "stock sheet" with the current β-value.When Step 4 of the WA-algorithm is reached (for the first time) L (k) has elements containing internal waste that correspond to certain cells(x, y).Designate these as waste(L is the i th with dimensions x, y.

Initialize array B as follows:
If no waste(L i , x, y) exists in the list and (x, y) = (1, 1).
Set B(x, y) = mini waste(L (k) i , x, y) .6. Calculate the minimum total trim loss for the subsheet with dimensions (x, y) for each (x, y) by executing the following propagation scheme on the elements of the array B (in a breadth first manner):

Update the underestimates as represented in array A:
For x = 1, . . ., S • W and y = 1, . . ., L do: Set A(x, y) = max(B(x, y), A(x, y)).8. To add symmetrical builds to the lookup table, do the following: For x = S • W + 1, . . ., W and y = 1, . . ., S • W A(x, y) = A(y, x) 9. Solve the original trim loss problem for the stock sheet with dimensions W and L with the WAM-algorithm using the tighter lower bounds stored in array A and the current β-value; and 10.If an optimal solution was found for the problem instance (best build is found where totaltrimloss ≤ β • L • W ), stop.Otherwise increase β by δ and return to Step 4.
Note that the choice of S in Step 3 strives to find a trade-off between the volume of calculations and effective underestimate improvement in as large a portion of the lookup table as possible.For small problems it should be feasible to choose S = 1.The underestimates obtained in Steps 7 and 8 are used as a more informed heuristic in the WAM-algorithm (Step 9) and as such it prunes the search space.In the rest of this paper the trade-off of additional work to improve underestimates and the beneficial effects of a pruned search space are investigated.In the proposition below, the validity of the underestimates generated by the PSSP-algorithm are formally considered.

Proposition 1
For each choice β * of β (assigned in Steps 1 or 10 of the PSSP-algorithm) Step 7 registers a sequence of non-decreasing underestimates for total trim-loss at every coordinate (x, y) of A.
Proof: If for a particular (x, y) it follows that B(x, y) it is a candidate solution to the trim-loss problem corresponding to the partial sheet (x, y).There is, however, the possibility that a build(s) exists for a partial sheet (strictly) contained in the (x, y) partial sheet with the associated (internal) waste less than or equal to β * • L • S • W and the total trim-loss calculated with respect to the partial sheet (x, y) also less than or equal to β * • L • S • W .Such a build will then be a candidate for the optimal cutting pattern for (x, y).The detection of such builds is accomplished by Step 6.The A(x, y) is updated in Step 7 (and 8 for symmetry).This is only done if B(x, y) > A(x, y).This condition guarantees optimality of the minimal waste for the (x, y) partial sheet since the argument is precisely that of Wang [10].For the B(x, y) calculated in Steps 4, 5 and 6 there are only two possibilities.
) is the optimal (least waste) solution for the partial stock sheet (x, y) (according to the Wang [10] argument), or which is true since in such a case no solution exists with waste is less than or equal to These facts establish that B(x, y) are underestimates of waste for the partial stock sheet (x, y).Subsequent underestimates are non-decreasing in the light of Step 7.

An example of the lookup table calculation in the PSSPalgorithm
Consider a stock plate with width 5 and length 5 units.It has two demand rectangles.
The first has a length, width and upperbound of 1 unit, while the second has a width of 2, length of 3 and an upperbound of 5.This example (EP 1) will be used to demonstrate a typical iteration of the PSSP-algorithm to generate a lookup table of underestimates.
Figure 1 shows the possible builds that are generated by the WA-algorithm with a β-value of 0.24 and a partial stock sheet with dimensions (3,5).(The maximal builds are e, g and h).
A typical iteration of Algorithm 2 to demonstrate the generation of a lookup table of underestimates by utilizing the patterns generated (Figure 1) is shown below.
Step 1.A β-value of 0.24 is arbitrarily chosen for illustrative purposes (through previous experimentation it was found that this β-value is required for the algorithm to generate an optimal solution).It should be noted that any other β-value could also have been chosen with 0 ≤ β < 1; Choose δ such that δ • L • S • W = 1 (to make calculations simple).Step 2. Initialize array A with underestimates calculated by the Gilmore and Gomory knapsack [4].For this problem instance, because a demand piece with dimensions (1, 1) exists, the knapsack generates underestimates of 0 at each dimension (because the knapsack assumes that there is no bound on the number of demand pieces that can be used).One could also initialize A with underestimates of zero without executing the Gilmore and Gomory knapsack for any problem instance, which would trivially also represent feasible underestimates.(Figure 2(i)).
Step 4. Solve the problem with a partial stock sheet of dimensions S • W and L (for the original demand pieces) with the WA-algorithm (Figure 2(ii)).See Figure 1 for possible builds.
Step 5. Initialize array B. Choose the smallest internal trim loss build for each dimension in the partial stock sheet from the list of builds generated in Step 4 and write it to array B, if such a build exists.Otherwise, set the value to Step 6. Execute the propagation scheme in the PSSP-algorithm.The data in each cell in Figure 2(iv) shows the intermediate calculations.The number at the bottom of each cell gives the underestimate.
Step 7. Update the lookup table (A) where possible with improved under-estimates.
Step 8. Symmetrical equivalent values are also updated in the final full lookup table (Figure 2(v) and 2(vi)).
If the Gilmore-Gomory underestimates in Figure 2(i) is compared to the "sharper" underestimates calculated with the PSSP-algorithm given in Figure 2(vi) it is found that many Step 2: (Gilmore & Gomory) Step 4: (WA); Step 5 Step 6 Step 7 Step 8 of the estimates are more "informed."

Empirical results
Different data sets exist in literature to compare algortihms.The first eight problem instances used in this paper are from Daza et al. [3] and are given in Table 1.(10,31,4).
Table 2 displays data for each problem that were solved using the WAM(GG)-algorithm as introduced by Oliveira and Ferreira [8].Furthermore, it also displays the results for the WAM(GG+PSSP)-algorithm, i.e. each problem were solved using the WAM(GG)algorithm in Algorithm 2, Step 9 with updated Gilmore-Gomory underestimate values (PSSP) based on the solutions of the partial sub-problem.
The partial sub-problems were solved using the original demand rectangles and a stock sheet of the dimensions ( S • W , L).The choice of S could conceivably be handled in a few different ways.Through empirical tests in Oberholzer [7] it was found that S = 0.25, is generally a good choice.Most authors, including Daza et al. [3] and Christofides and Whitlock [2] report empirical results for the WA-and WAM-algorithms in general for small, textbook-sized problem instances.For the test problems (P1, . . ., P8) considered it is clear that the problems can be solved very easily and that there is very little merit to further calculate tighter underestimates using algorithms based on the PSSP ideas.It is uncertain how well these methods scale when larger problems are used.In the last part of this section some results are presented based on the solution of larger, industry-sized problem instances with algorithms based on the WA-, WAM-and PSSP-methods.The problem instances were obtained from a local corporation that manufactures and sells glass.Table 4 shows the results obtained when the larger problem instances are solved with the WA-, WAM(GG)-and PSSP-algorithms.The partial sub-problems for the PSSPalgorithm are once again solved using the original demand rectangles and a stock sheet of the dimensions ( S • W , L).The results for the partial sub-problems are not shown separately in Table 4, but the PSSP totals incorporate the calculation effort.
Considering the results in Table 4, it is clear that the WAM(GG)-algorithm does not perform well for problem instances with larger stock sheets.The reason for this is that if, for instance, a lookup table of underestimates must be calculated using the Gilmore-Gomory approach for problem PG2, an underestimate for each cell of the matrix must be calculated.This translates to a staggering 2 550 × 3 210 = 8 185 500 underestimates!Table 4 further shows that to compute these values for PG2, 454.28 seconds of processing time is required.To solve problem PG2 with the WA-algorithm, requires only 9.87 seconds.This shows that the WAM-algorithm does not scale well.It should be noted, though, that after the underestimates are available, the solving process completion is very fast for the WAM-algorithm.Therefore, the underestimates obtained through the unbounded twodimensional knapsack are valuable if available, but it generally takes long to calculate.This implies that if another method, that executed faster, could be devised to calculate underestimates; these resulting initial underestimates would also be of value.For the PSSP-algorithm, the results in Table 4 were obtained by simply using initial underestimates of 0 to initialize the PSSP-algorithm, thereby eliminating the need for costly calculations of underestimates.
The results show that by eliminating the underestimate calculation using the Gilmore-Gomory approach, processing time decreases significantly.Lastly, if the calculation time for the underestimate table is not considered, it should be noted that the WAM(GG)algorithm completes very fast.Therefore, if a method can be devised where underestimates (not necessarily as good as the Gilmore-Gomory estimates but better than 0) are produced quickly, the PSSP-algorithm might be enhanced.
Figure 3 shows that the PSSP-algorithm with initial underestimates of zero does indeed scale well for problem instances where larger stock sheets are concerned.
An observation illustrated in Figure 4, adapted from Luger and Stubblefield [5], applies to the modified Wang-and PSSP-algorithms and their respective mechanisms to generate underestimates with various levels of informedness.Referring to Figure 4, the total cost of solving the given problem must be minimized.To accomplish this, a strategy to calculate  underestimates must be chosen that does not have calculation times that spiral out of control, and yet delivers results that can decrease the application cost of the algorithm used as solver.The modified Wang method fails here, according to Figure 3, where the control strategy becomes costly as the stock sheet size increases.The PSSP-algorithm, on the other hand, succeeds in generating effective underestimates at a reasonable cost.

Conclusion
This paper introduces alternative algorithms called partial stock sheet propagation (PSSP) algorithms, which aim at improving the lower bounds as produced by the unbounded twodimensional knapsack function of Gilmore and Gomory.Improvements on execution time, generated nodes and stored nodes were illustrated through the results of some numerical experiments.For larger, more complex, industry type of problems, the Gilmore and Gomory estimates were found to be computationally costly to produce.The simple approach to start with underestimates of zero and to improve them using the PSSP algorithm described in this paper turned out to be effective.However, the main practical result found in this research was that the easy to find less informed heuristic functions performed well (computationally) on more complex problems in producing exact trim loss solutions.For small problems the computational cost of most of the approaches is comparable.

Figure 2 :
Figure 2: Demonstration of the generation of underestimates.

Figure 3 :
Figure 3: Scalability of the PSSP-algorithm with initial underestimates of zero.

Figure 4 :
Figure 4: A plot of the different computational costs as a function of informedness.
Table 3 summarizes these problem instances.

Table 3 :
Set of four C2DGC problem instances from a glass merchant.

Table 4 :
A summary of the results when the PSSP-algorithm was applied to problems from industry.