# MGPM Methods for Rectangular Single-Size Printed Circuit Board Orthogonal Packing Problems

Authors: Pengfei Pan; Yi Han; Hexin Lv; Guoyong Dai; Zhiyong Jin
Journal: Mathematical Problems in Engineering
 (2022)

---

## Abstract

Printed circuit board (PCB) orthogonal packing problems derive from the massive circuit board production process in the electronic industry. In the early stage, it mainly relied on human experiences to make decisions on how to make the most of each sheet while meeting customers’ orders. Up till now, researchers in enterprises and academic circles are still trying to explore effective mathematical models and feasible optimization methods. In most cases, what PCB companies generally face is the orthogonal layout decision, which considers positioning each rectangle PCB piece (PCB-P) on a rectangle sheet board (panel) in an ideal way so that each panel has the minimal remains with the most PCB-Ps. In this paper, multi-round gradual packing methods (MGPMs) are proposed based on the idea of combinatorial optimization and dynamic programming. MGPMs include the depth priority-based method (MGPM-DP) and breadth priority-based branch-and-prune method (MGPM-BC). The former has the advantage of finding better solutions, while the latter has the advantage of consuming short computational time. Through extensive computational tests on real data from a PCB production enterprise in China, both MGPM-DP and MGPM-BC have achieved noticeable and satisfactory results compared with the simplex method, dynamic programming method, and a widely used industrial software (Yuanbo) in China.


---

## Body

## 1. Introduction

PCB is the core component of various types of electronic products and electrical equipment. From mobile phones to large aerospace equipment, almost all electronic products contain PCB. With the arrival of an informational society and the fast development of high-techs such as Industry 4.0, big data, cloud computing, and the Internet of things, PCB plays an even more crucial role as a solid foundation in the whole industrial chain. Since the industrial revolution, manufacturing enterprises have always been valuing the utilization rate and cost saving of raw materials.In the PCB production industry, rectangular PCB piece (having a length (L or l) and a width (W or w)) packing problem (RP-PPP) has always been a tricky thing bothering enterprises. RP-PPP considers how to arrange a number of PCB-Ps on a whole sheet board (SB) in an ideal way to meet the production plans while improving the utilization rate of the SB, reducing production costs, and boosting PCB production efficiency [1]. Sometimes, a PCB-P is not rectangular. Enterprises normally capsule an irregular piece into a rectangle if this situation happens.There are two types of rectangular PCB packing decisions here. One is single-size RP-PPP, and the other is multi-size RP-PPP. Single-size RP-PPP revolves around positioning PCB-Ps of the same size on a sheet board. Multisize RP-PPP can be transferred into multiple single-size RP-PPPs. Therefore, researches on models and algorithms of single-size RP-PPP are fundamental and especially essential [2].PCB packing problem is highly similar to the 2D graphics layout (cutting-stock) problem. Therefore, the models and algorithms for 2D graphics layout problems could apply as references to a great extent. As is known to all, cutting or packing problems are NP-complete ones. Therefore, it is impossible to depict each detailed constraint exactly. Normally approximate models are employed for this kind of problem for constraints such as a PCB piece should not overlap with others. Exact models are suitable for problems with explicit objectives and specific constraints. And both exact methods and approximate ones can be applied to solve problems with exact or approximate models. Only that, when an exact method is used for an approximate model, the solutions may not be optimal. Currently, exact methods such as linear programming method (simplex method), dynamic programming method, and branch-and-bound method are mainly and extensively adopted means for solving single-size cutting-stock problems (SCPs) [3].The nesting idea runs through the cutting problem of one-dimensional tubular objects, the cutting problem of two-dimensional graphics, the packing problem of three-dimensional space, and even the packing problem under four-dimensional time constraints [4]. 2D cutting-stock problem is a special case of a 2D bin packing problem.Agrawal [5] proposed a branch-and-bound algorithm (BBA) for single-size RP-PPP. The algorithm first constituted 2 strips based on the guillotine cut idea. Then 2-section, 3-section, 4-section, …, and n-section schemes were constructed, with each scheme being composed of 2 plans. 3-section schemes were derived from 2 2-section plans, and 4-section schemes came out from 2 3-section plans. And in a similar fashion, n-section schemes were produced by gradually splitting the bottom-right rectangular remains on the sheet board. This algorithm reduced search space and computing time to some extent. However, the optimality was not completely assured. Arslanov [6] proposed a continued fractions method, which could reduce the complexity of obtaining the total number of PCB pieces on the sheet board. This algorithm, which was based on mathematical theorems and lemmas, could greatly simplify the whole computational process. However, this algorithm could only explicitly point out the layout of PCB pieces on the bottom-left and up-right corners of the sheet board. And it did not guarantee optimality as well. Cui et al. [7] proposed a continuous fractions-based BBA. This algorithm adopted the continuous fractions method to obtain the upper bound. Then a branch and bound procedure were performed to produce the layout scheme gradually. As we have mentioned before, the continuous fractions method was based on the guillotine cut idea. Thus, the upper bound may not be an ideal one. He and Cui [8] designed a dynamic programming algorithm, which was based on two types of strips, as shown in Figures1(b), and 1(d). Yang and Cui [9] performed research, which is based on literature [8], and considered cutting numbers for each scheme. However, the effect of cutting numbers was set too small to be a leading factor.Figure 1
Four types of strips.
(a)(b)(c)(d)Li [10] developed a two-stage method based on the dynamic programming algorithm and a -D knapsack algorithm. Firstly, several workplates were constructed. Then, a dynamic programming algorithm was applied to determine the layouts of PCB pieces on each workplate. Afterwards, several segments, which were stacks composed of workplates with the same width as shown in Figure 1(d), were obtained by solving a 1D knapsack problem. Finally, segments were selected by solving another 1D knapsack problem and packed horizontally on the sheet board. Wang et al. [11] and Cui et al. [12, 13] solved multi-workplate and single-workplate PCB packing problems with dynamic programming algorithms and segment-based methods. References [7–13] are all features of the dynamic programming algorithm as described in the literature [9]. The possible common crises are when only two strips (actually, there are four types of strips, as shown in Figure 1) are considered and when the remaining sheet is satisfying w≤ L ≤ l or w≤ W ≤ l. For one thing, their algorithms may lead to unwanted waste. For the other, errors will occur if no further control measures are performed. References [14–16] are strip and stage-based methods. First, in stages, segments should be decided. Then, in each segment, homogenous strips with the same orientation will be generated to fill the whole segment. In these methods, efforts should be cast on how many segments there will be. And strip-based ideas may lead to more wasted materials.Beasley [17] proposed a tree-based exact algorithm for a single-size rectangle packing problem in 1985. This algorithm adopted a relaxation technique that captures satisfactory approximate optimal solutions. Litvinchev et al. [18] designed an approximate integer programming algorithm that could guarantee feasible satisfactory solutions as well. Reference [19] introduced strip-based algorithms or the simplex method for 2-dimensional packing problems. Those methods are mostly feasible solutions generating tools too. Only in the pallet packing section the book presented 3-,5-,7-, and 9-block methods for nesting packing problems, and the 9-block method exhibited some optimal solutions with diagonal patterns for several cases. However, for one thing, if the scale of a problem is large, the 9-block method would not always be the best one (11-,13-,15- or 17-block methods may be needed). For the other, when and how a diagonal pattern stands is still up in the air. In addition, there are many possible block types in each block-based method. Therefore, making sure which method and block types should be employed and what the placement sequence of all the blocks will be really time-consuming. For a manufacturing factory, satisfactory solutions with simpler packing patterns and acceptable time would be more plausible than optimal solutions with intricate separation lines and unbearable computational time.In this paper, a step-by-step gradual nesting method based on the dynamic programming idea and a branch-and-prune strategy-based method is proposed from the perspective of making full use of the length and width of the sheet board. According to the experimental results, satisfactory and feasible results are obtained within acceptable computational time.


## 2. Mathematical Models for Constructing Feasible Solutions

Currently, there are not many mathematical models for RP-PPP since RP-PPP itself is difficult to depict explicitly. Normally, two models appear in most references. One is the simplex method-based model, and the other is the dynamic programming algorithm-based model. Both algorithms are based on strips [9].


### 2.1. Simplex Method Based Model

Suppose the rectangle sheet board is in a coordination system. The coordinate of the bottom-left corner point is (0, 0). TheX-axis overlaps with the length side of the sheet board and the Y-axis overlaps with the width side of the sheet board. The small PCB piece is has a length (l) and a width (w) as well.X-axis: (1)MaxC_XX=⌊Ww⌋∗x+⌊Wl⌋∗yS.tl∗x+w∗y≤L0≤x≤⌊Ll⌋0≤y≤⌊Lw⌋.X-axis algorithm procedure:Step 1: Establish the objective functionC_X maximizing the number of PCB-PsStep 2: Set constraintsStep 3: Call the Linear Program Optimizer in Matlab2016Step 4: According tox and y, call the rectangle() function to depict the layout of strips on sheet boardY-axis: (2)MaxC_Y=⌊Ll⌋∗x1+⌊Lw⌋∗y1S.tw∗x+l∗y≤W0≤x≤⌊Ww⌋0≤y≤⌊Wl⌋.Y-axis algorithm procedure:Step 1: Establish the objective functionC_Y maximizing the number of PCB-PsStep 2: Set constraintsStep 3: Call the Linear Program Optimizer in Matlab2016Step 4: According tox and y, call the rectangle() function to draw the layout of strips on sheet boardAt present, most commercial PCB packing software has embedded a simplex method. Since the simplex method only considers the best combination of strips packing horizontally or vertically, some potential optimal layouts may be missed out [8].


### 2.2. Dynamic Programming Method Based Model

The dynamic programming model, which is based on two types of strips, is listed below:(3)FL,W=maxFL,W−l+⌊Lw⌋,FL−l,W+⌊Ww⌋,(4)FL,W=0.Dynamic programming algorithm performs in a divide-and-conquer way. First, suppose the sheet board is divided into two layouts, with each one having two parts. The first part is a strip, and the other part is the remaining board (remains). As long as the remains are not satisfying formula (4), the remains of each layout will be further divided into two layouts, with each one having two parts. As the dividing process goes on, the layout acquiring procedure extends like an upside-down tree. Through comparing each tree leave, the layout with the most PCB-Ps emerges as the best scheme.However, it is taken as the terminating condition the dynamic programming algorithm will go wrong whenw≤ L ≤ l or w≤ W ≤ l. Therefore, we rectify formula (4) as formula (5):(5)FL,W=0,minL,W<minl,w.The advantage of the dynamic recursive procedure is its simple dividing steps. But when the scale of problems increases, the amount of computation, memory usage, and time costs rise sharply as well.


## 2.1. Simplex Method Based Model

Suppose the rectangle sheet board is in a coordination system. The coordinate of the bottom-left corner point is (0, 0). TheX-axis overlaps with the length side of the sheet board and the Y-axis overlaps with the width side of the sheet board. The small PCB piece is has a length (l) and a width (w) as well.X-axis: (1)MaxC_XX=⌊Ww⌋∗x+⌊Wl⌋∗yS.tl∗x+w∗y≤L0≤x≤⌊Ll⌋0≤y≤⌊Lw⌋.X-axis algorithm procedure:Step 1: Establish the objective functionC_X maximizing the number of PCB-PsStep 2: Set constraintsStep 3: Call the Linear Program Optimizer in Matlab2016Step 4: According tox and y, call the rectangle() function to depict the layout of strips on sheet boardY-axis: (2)MaxC_Y=⌊Ll⌋∗x1+⌊Lw⌋∗y1S.tw∗x+l∗y≤W0≤x≤⌊Ww⌋0≤y≤⌊Wl⌋.Y-axis algorithm procedure:Step 1: Establish the objective functionC_Y maximizing the number of PCB-PsStep 2: Set constraintsStep 3: Call the Linear Program Optimizer in Matlab2016Step 4: According tox and y, call the rectangle() function to draw the layout of strips on sheet boardAt present, most commercial PCB packing software has embedded a simplex method. Since the simplex method only considers the best combination of strips packing horizontally or vertically, some potential optimal layouts may be missed out [8].


## 2.2. Dynamic Programming Method Based Model

The dynamic programming model, which is based on two types of strips, is listed below:(3)FL,W=maxFL,W−l+⌊Lw⌋,FL−l,W+⌊Ww⌋,(4)FL,W=0.Dynamic programming algorithm performs in a divide-and-conquer way. First, suppose the sheet board is divided into two layouts, with each one having two parts. The first part is a strip, and the other part is the remaining board (remains). As long as the remains are not satisfying formula (4), the remains of each layout will be further divided into two layouts, with each one having two parts. As the dividing process goes on, the layout acquiring procedure extends like an upside-down tree. Through comparing each tree leave, the layout with the most PCB-Ps emerges as the best scheme.However, it is taken as the terminating condition the dynamic programming algorithm will go wrong whenw≤ L ≤ l or w≤ W ≤ l. Therefore, we rectify formula (4) as formula (5):(5)FL,W=0,minL,W<minl,w.The advantage of the dynamic recursive procedure is its simple dividing steps. But when the scale of problems increases, the amount of computation, memory usage, and time costs rise sharply as well.


## 3. Multi-Round Gradual Packing Methods

The strip-base simplex method and the recursive-based dynamic programming algorithm are 2 commonly applied heuristic algorithms for single-size PCB packing decisions. While in some cases, they are not guaranteeing optimal results. Assuming the sheet board is 3000 (mm) in length and 1500 (mm) in width and the piece board is 406 (mm) in length and 229 (mm) in width, the best packing result is shown in Figure2. While the best scheme given by using commercial software (Yuanbo), which heavily relies on the strip-based simplex method or the dynamic programming algorithm, is shown in Figure 3. In Figure 2, the nesting packing layout contains 48 pieces, which is better than the 47-piece scheme in Figure 3.Figure 2
Nesting packing layout.Figure 3
Strip-based packing layout.


### 3.1. Prerequisite Conditions

Before the introduction of our proposed methods, there are some variables need to be listed as follows:L: Length side of the sheet boardW: Width side of the sheet boardl: Length side of the small piece boardw: Width side of the small piece boarda: Number of type 4 strips (Figure 1(d)) on L;b: Number of type 3 strips (Figure 1(c)) on L;c: Number of type 1 strips (Figure 1(a)) on W;d: Number of type 2 strips (Figure 1(b)) on W;CL: Matrix composed of combinations on L satisfying certain constraints [a1,b1; a2,b2; a3,b3;...];CW: Matrix composed of combinations on W satisfying certain constraints [c1,d1; c2,d2;c3,d3;...];clcw: Row vector generated from a Cartesian product of CL × CW [a,b,c,d];Msize: Matrix composed of clcws [clcw1;clcw2;clcw3;...];RECT: Matrix composed of rectangle pairs fromMsize [[a1∗l,c1∗w],[b1∗w,d1∗l];[a2∗l,c2∗w], [b2∗w,d2∗l];...];Inspired by the simplex method, a two-dimensional packing problem is reduced to two one-dimensional packing problems based onL and W, respectively. All enumerated constraint-satisfying combinations (ai,bi) on L are denoted by CL. And all enumerated combinations (cj,dj) satisfying the constraints on W are denoted by CW. And clcwi=(ai,bi,ci,di) is gained by doing the Cartesian product of CL and CW. Then Msize and RECT are obtained afterwards.


### 3.2. Nesting Packing Layout

In the nesting scheme shown in Figure2, if the piece boards 1–12 and 13–24 are regarded as two new rectangular boards A and B, respectively, the nesting scheme will be of 4 rectangular, among which the lower-left corner and the upper-right corner are two identical rectangles, and the upper-left corner and the lower-right corner are two identical rectangles.By observing Figure2, it can be found that the length L and width W of the sheet board in the nesting scheme is almost fully utilized. And the best combinations of Strips on L and W are captured by an enumeration way. The best combination option on length L is 4∗l + 6∗w, and the best utilization mode on width W is 3∗, w + 2∗l. Therefore, it can be considered to combine 4 × 3 l × w piece boards into one large rectangle and 6 × 2 w × l piece board into another large rectangle. When a nesting layout comes into being, there is no room for a single-piece board on the remains in the middle.The decisive factors of nesting packing layout are as follows:(1)
Number constraint: only 2 different large rectangles are concerned(2)
Length and Width constraints:L-w<(a∗l + b∗w)≤L and W-w<(c∗w + d∗l)≤W and ((a∗l ≥ b∗w and c∗w ≤ d∗l) or (a∗l ≤ b∗w and c∗w ≥ d∗l))


### 3.3. Nonnesting Packing Layout

If the necessary conditions for the nesting layout are not met, the nesting packing mode cannot form. Thus, there will be some exceptions occur as follows:(6)case1a=0andb,c,d≠0case2b=0anda,c,d≠0case3c=0anda,b,d≠0case4d=0anda,b,c≠0case5a,d=0andb,c≠0case6b,c=0anda,d≠0case7a,c=0andb,d≠0case8b,d=0anda,c≠0.In case 1, ab × d rectangle is packed on the sheet board as shown in Figure 4. Cases 2–4 are similar to case 1. In case 5, a vertical strip with a size of l×c∗w and a horizontal strip with a size of b∗w×l are put on the sheet board to generate 2 initial schemes as shown in Figures 5(a) and 6(b). Case 6 is similar to Case 5. In Cases 7 and 8, the rectangles with a size of b×d and a×c can be directly taken as possible candidate schemes, as shown in Figures 6 and 7.Figure 4
Case 1 layout.Figure 5
Case 5 layouts.
(a)(b)Figure 6
Case 7 layout.Figure 7
Case 8 layout.If a, b, c, and d are all positive numbers and the nesting packing conditions are not met, Case 9 happens. In this case, there will be a big rectangle A and a small rectangle B. We first place A on the bottom-left corner of the sheet board. Then we place one B above A, and another B to the right of A as shown in Figures8(a) and 8(b).Figure 8
Case 9 initial layouts.
(a)(b)Afterwards, according to Figure8(a), we first establish a vertical strip, and then a horizontal strip is created, as shown in Figure 9(a). According to Figure 8(b), we first establish a horizontal strip, and then a vertical strip is created, as shown in Figure 9(b). Then, the layouts in Figure 9 are two candidate schemes.Figure 9
Case 9 layouts.
(a)(b)If the nesting packing layout is classified as Case 10, then each time we are searching for the best combinations on each side of the remains, one of those Cases will be matched. If the remaining sheet board is still very large, we need to continue the next round of packing procedure.


### 3.4. Dynamic Programming Algorithm Based MGPM (MGPM-DP)

Dynamic programming algorithm is very suitable and feasible for solving problems in a multi-round or divide-and-conquer way. The aforementioned dynamic programming algorithm was based on strips. Since each strip has some wasted parts, the final results may not be optimal. Here, we combined a dynamic programming algorithm with MGPM to produce a novel algorithm, namely, MGPM-DP. Formula (7) describes the state transition equation.(7)FLi,Wi=0minLi,Wi≤minl,wMaxnk+FLik,Wikk=1,2,⋯,k.MGPM-DP is a rectangular-block-based algorithm rather than a strip-based dynamic programming algorithm. Here, an array of STRUCT structures is taken to store temporary unfinished schemes and record parent nodes in the last round, the number of packed pieces in the current round, rectangular blocks, and possible child nodes appearing in the next round. The classical dynamic algorithm relies on a time-consuming recursion mechanism and tries to shorten the computational time at the cost of memory space. Here, since the number of temporary schemes generated in each round of MGPM is unable to determine, it is easy to cause memory overflow or time limit exceedance when all tree nodes are recursively traversed. Therefore, we recordclcws for all the previously dealt with remains to avoid subsequently repeated combination acquiring process. Then the computational time of MGPM-DP may be further reduced.Some elements in MGPM-DP are defined as follows:Plan: temporary schemes generated by RECTRnum: ideal number of piece boards on the remainsNum1: number of packed piece boards in the current roundNum: ideal total number of piece boards in the current scheme (Num = Num1+Rnum)Respace: size of the remains in the current schemePlancoll: set consists of schemes [Plan1; Plan2; Plan3; ...]Mem: array for information storageThe executive mechanism of MGPM-DP goes as follows:(1)
Enumerate all possible combinations of (a,b) onL to produce CL(2)
Enumerate all possible combinations of (c,d) on W to produce CW(3)
perform Cartesian product of CL and CW to obtain clcws, Msize, and RECT(4)
Traverse each Plani to obtain Numli, Respacei, and Rnumi(5)
Judge if Respacei can be further packed(6)
Recursively apply MGPM-DP to Respacei until all final schemes are captured(7)
Output the best scheme as the final solutionThe flowchart of MGPM-DP is shown in Figure10.Figure 10
Flowchart of MGPM-DP.


### 3.5. Branch-and-Cut-Based MGPM (MGPM-BC)

Even if the dynamic programming algorithm has some advantages in the solution-seeking procedure, with the increase in problem scale, the whole procedure will be rather time-consuming. Hence, we combine MGPM with a branch-and-cut idea. First, all plans are generated according to decisive factor (2) of MGPM. Then, a variableWastRate (formula (8)) is adopted to sort the plans in the current round. Next, remove the worst PruneRate% plans. Repeat the MGPM procedure until the best scheme is reached.(8)WasteRatei=Li∗Wi−Respacei−∑k=1nSumrectk∑k=1nSumrectk.The flowchart of MGPM-BC is shown in Figure11.Figure 11
Flowchart of MGPM-BC.


## 3.1. Prerequisite Conditions

Before the introduction of our proposed methods, there are some variables need to be listed as follows:L: Length side of the sheet boardW: Width side of the sheet boardl: Length side of the small piece boardw: Width side of the small piece boarda: Number of type 4 strips (Figure 1(d)) on L;b: Number of type 3 strips (Figure 1(c)) on L;c: Number of type 1 strips (Figure 1(a)) on W;d: Number of type 2 strips (Figure 1(b)) on W;CL: Matrix composed of combinations on L satisfying certain constraints [a1,b1; a2,b2; a3,b3;...];CW: Matrix composed of combinations on W satisfying certain constraints [c1,d1; c2,d2;c3,d3;...];clcw: Row vector generated from a Cartesian product of CL × CW [a,b,c,d];Msize: Matrix composed of clcws [clcw1;clcw2;clcw3;...];RECT: Matrix composed of rectangle pairs fromMsize [[a1∗l,c1∗w],[b1∗w,d1∗l];[a2∗l,c2∗w], [b2∗w,d2∗l];...];Inspired by the simplex method, a two-dimensional packing problem is reduced to two one-dimensional packing problems based onL and W, respectively. All enumerated constraint-satisfying combinations (ai,bi) on L are denoted by CL. And all enumerated combinations (cj,dj) satisfying the constraints on W are denoted by CW. And clcwi=(ai,bi,ci,di) is gained by doing the Cartesian product of CL and CW. Then Msize and RECT are obtained afterwards.


## 3.2. Nesting Packing Layout

In the nesting scheme shown in Figure2, if the piece boards 1–12 and 13–24 are regarded as two new rectangular boards A and B, respectively, the nesting scheme will be of 4 rectangular, among which the lower-left corner and the upper-right corner are two identical rectangles, and the upper-left corner and the lower-right corner are two identical rectangles.By observing Figure2, it can be found that the length L and width W of the sheet board in the nesting scheme is almost fully utilized. And the best combinations of Strips on L and W are captured by an enumeration way. The best combination option on length L is 4∗l + 6∗w, and the best utilization mode on width W is 3∗, w + 2∗l. Therefore, it can be considered to combine 4 × 3 l × w piece boards into one large rectangle and 6 × 2 w × l piece board into another large rectangle. When a nesting layout comes into being, there is no room for a single-piece board on the remains in the middle.The decisive factors of nesting packing layout are as follows:(1)
Number constraint: only 2 different large rectangles are concerned(2)
Length and Width constraints:L-w<(a∗l + b∗w)≤L and W-w<(c∗w + d∗l)≤W and ((a∗l ≥ b∗w and c∗w ≤ d∗l) or (a∗l ≤ b∗w and c∗w ≥ d∗l))


## 3.3. Nonnesting Packing Layout

If the necessary conditions for the nesting layout are not met, the nesting packing mode cannot form. Thus, there will be some exceptions occur as follows:(6)case1a=0andb,c,d≠0case2b=0anda,c,d≠0case3c=0anda,b,d≠0case4d=0anda,b,c≠0case5a,d=0andb,c≠0case6b,c=0anda,d≠0case7a,c=0andb,d≠0case8b,d=0anda,c≠0.In case 1, ab × d rectangle is packed on the sheet board as shown in Figure 4. Cases 2–4 are similar to case 1. In case 5, a vertical strip with a size of l×c∗w and a horizontal strip with a size of b∗w×l are put on the sheet board to generate 2 initial schemes as shown in Figures 5(a) and 6(b). Case 6 is similar to Case 5. In Cases 7 and 8, the rectangles with a size of b×d and a×c can be directly taken as possible candidate schemes, as shown in Figures 6 and 7.Figure 4
Case 1 layout.Figure 5
Case 5 layouts.
(a)(b)Figure 6
Case 7 layout.Figure 7
Case 8 layout.If a, b, c, and d are all positive numbers and the nesting packing conditions are not met, Case 9 happens. In this case, there will be a big rectangle A and a small rectangle B. We first place A on the bottom-left corner of the sheet board. Then we place one B above A, and another B to the right of A as shown in Figures8(a) and 8(b).Figure 8
Case 9 initial layouts.
(a)(b)Afterwards, according to Figure8(a), we first establish a vertical strip, and then a horizontal strip is created, as shown in Figure 9(a). According to Figure 8(b), we first establish a horizontal strip, and then a vertical strip is created, as shown in Figure 9(b). Then, the layouts in Figure 9 are two candidate schemes.Figure 9
Case 9 layouts.
(a)(b)If the nesting packing layout is classified as Case 10, then each time we are searching for the best combinations on each side of the remains, one of those Cases will be matched. If the remaining sheet board is still very large, we need to continue the next round of packing procedure.


## 3.4. Dynamic Programming Algorithm Based MGPM (MGPM-DP)

Dynamic programming algorithm is very suitable and feasible for solving problems in a multi-round or divide-and-conquer way. The aforementioned dynamic programming algorithm was based on strips. Since each strip has some wasted parts, the final results may not be optimal. Here, we combined a dynamic programming algorithm with MGPM to produce a novel algorithm, namely, MGPM-DP. Formula (7) describes the state transition equation.(7)FLi,Wi=0minLi,Wi≤minl,wMaxnk+FLik,Wikk=1,2,⋯,k.MGPM-DP is a rectangular-block-based algorithm rather than a strip-based dynamic programming algorithm. Here, an array of STRUCT structures is taken to store temporary unfinished schemes and record parent nodes in the last round, the number of packed pieces in the current round, rectangular blocks, and possible child nodes appearing in the next round. The classical dynamic algorithm relies on a time-consuming recursion mechanism and tries to shorten the computational time at the cost of memory space. Here, since the number of temporary schemes generated in each round of MGPM is unable to determine, it is easy to cause memory overflow or time limit exceedance when all tree nodes are recursively traversed. Therefore, we recordclcws for all the previously dealt with remains to avoid subsequently repeated combination acquiring process. Then the computational time of MGPM-DP may be further reduced.Some elements in MGPM-DP are defined as follows:Plan: temporary schemes generated by RECTRnum: ideal number of piece boards on the remainsNum1: number of packed piece boards in the current roundNum: ideal total number of piece boards in the current scheme (Num = Num1+Rnum)Respace: size of the remains in the current schemePlancoll: set consists of schemes [Plan1; Plan2; Plan3; ...]Mem: array for information storageThe executive mechanism of MGPM-DP goes as follows:(1)
Enumerate all possible combinations of (a,b) onL to produce CL(2)
Enumerate all possible combinations of (c,d) on W to produce CW(3)
perform Cartesian product of CL and CW to obtain clcws, Msize, and RECT(4)
Traverse each Plani to obtain Numli, Respacei, and Rnumi(5)
Judge if Respacei can be further packed(6)
Recursively apply MGPM-DP to Respacei until all final schemes are captured(7)
Output the best scheme as the final solutionThe flowchart of MGPM-DP is shown in Figure10.Figure 10
Flowchart of MGPM-DP.


## 3.5. Branch-and-Cut-Based MGPM (MGPM-BC)

Even if the dynamic programming algorithm has some advantages in the solution-seeking procedure, with the increase in problem scale, the whole procedure will be rather time-consuming. Hence, we combine MGPM with a branch-and-cut idea. First, all plans are generated according to decisive factor (2) of MGPM. Then, a variableWastRate (formula (8)) is adopted to sort the plans in the current round. Next, remove the worst PruneRate% plans. Repeat the MGPM procedure until the best scheme is reached.(8)WasteRatei=Li∗Wi−Respacei−∑k=1nSumrectk∑k=1nSumrectk.The flowchart of MGPM-BC is shown in Figure11.Figure 11
Flowchart of MGPM-BC.


## 4. Computational Practices

In this part, the MGPM-DP, the MGPM-BC, the simplex method, and the strip-based dynamic programming algorithms are coded in MATLIB2016 on a desktop computer with a 16 G RAM, an Intel i5 2.4 G CPU, a 64-bit Windows 10 OS, and a 500 G HD. Here,PruneRate is 0.2.


### 4.1. Exploration of Computational Performances of 4 Algorithms

Here, 1200 pieces of data from an electronic manufacturing company in Pan’an Zhejiang province, China, are selected and merged into 6 data sets. Each data set has 200 pieces of data. The computational results are listed in Table1. We adopted AN to represent an average number, AUR to denote average utilization rate, ACT to depict average computational time, and DS as the abbreviation of data sets.Table 1
Statistics of 4 algorithms.
DSMGPM-DPMGPM-BCSimplex methodDynamic prog. AlgorithmAUR (%)AN (Ps)ACT (S)AUR (%)AN (Ps)ACT (S)AUR (%)AN (Ps)ACT (S)AUR (%)AN (Ps)ACT (S)D197.78%∗689∗0.158497.47%6870.124097.41%6870.0193∗97.51%68826.2678D298.33%∗577∗0.062998.11%5760.044398%5750.0183∗97.76%57423.8502D398.23%∗944∗0.558798.04%9430.151797.96%9420.0186∗97.75%93328.9502D498.61%∗1288∗0.269198.49%12870.180198.45%12860.0186∗97.97%128029.1002D598.91%∗1607∗0.576498.75%16050.425198.68%16040.0185∗98.27%159627.6002D697.95%∗2291∗1.609197.80%22891.281397.71%22880.0185∗97.59%228021.0023Note. Since the dynamic programming algorithm is very time-consuming, if no solutions are found in 30 seconds, AUR and AN is 0.It can be clearly seen in Table1 that the average utilization rate and the average number of piece boards achieved by MGPM-DP are superior to the other 3 algorithms. Simplex Method shows an overwhelming advantage in computational time. The performance of MGPM-BC is only a little bit inferior to that of MGPM-DP in terms of AUR an AN. As for ACT, MGPM-BC does display its superiority over MGPPM-DP. Although the average utilization rate of the strip-based dynamic programming algorithm is acceptable, the time consumption is substantial and not quite satisfactory.Figure12 shows a statistics chart of 1200 pieces of data falling into different sections of utilization rates. From Figure 12, we can find out the superiority of MGPM-DP over the other 3 algorithms as well.Figure 12
Statistics chart of all cases. Note: theX-axis displays utilization rate (%), and the Y-axis points out the number of cases.


### 4.2. Size-Fixed Sheet Board with Nonfixed Piece Boards

Here, we check the utilization rate distributions for 5 common sheet boards (1230 mm × 1030 mm, 1224 mm × 1104 mm, 1224 mm × 1054 mm, 1220 mm × 1100 mm, and 1220 mm × 1100 mm), aiming to look for ideal piece boards for each sheet board in that company. The 3D distribution charts for each sheet board are presented in Figures13–17. According to Figures 13–17, we can learn that piece boards in each figure with convex peaks (utilization rates closest to 1) are ideal ones for that sheet board.Figure 13
Utilization rate distribution chart for 1230 × 1030 sheet board.Figure 14
Utilization rate distribution chart for 1224 × 1104 sheet board.Figure 15
Utilization rate distribution chart for 1224 × 1054 sheet board.Figure 16
Utilization rate distribution chart for 1220 × 1050 sheet board.Figure 17
Utilization rate distribution chart for 1220 × 1100 sheet board.


### 4.3. Size-Fixed Piece Board with Nonfixed Sheet Boards

In the real production setting, enterprises sometimes randomly set some workplates. They first pack piece boards on the workplates. Then they try to find the best packing layout of workplates on the sheet board. Here, 5 common piece board sizes (62.5 mm × 23 mm, 37 mm × 25 mm, 27 mm × 27 mm, 238.5 mm × 75 mm, 315 mm × 209.6 mm) are selected to explore the utilization rate distribution on sheet boards withL [1220 mm, 2060 mm] and W [1030 mm, 1230 mm]. The results are shown in Figures 18–22.Figure 18
Utilization rate distribution chart for 62.5 × 23 piece board.Figure 19
Utilization rate distribution chart for 37 × 25 piece board.Figure 20
Utilization rate distribution chart for 27 × 27 piece board.Figure 21
Utilization rate distribution chart for 238.5 × 75 piece board.Figure 22
Utilization rate distribution chart for 315 × 209.6 piece board.


### 4.4. Comparison of MGPM-DP with Yuanbo Commercial Packing Software

Currently, there are many commercial packing software applications widely run in circuit board manufacturing companies. Yuanbo Software, which is apparently superior to other commercial software, is used as a comparison benchmark here. 5 experiments are performed to further clarify the performance of MGPM-DP as shown in Figures23–27.Figure 23
Comparison result with piece board: 158 mm × 89 mm and sheet board: 1245 mm × 1040 mm. (a) MGPM-DP. (b) Yuanbo commercial software.
(a)(b)Figure 24
Comparison result with piece board: 98.5 mm × 70 mm and sheet board: 1230 mm × 1030 mm. (a) MGPM-DP. (b) Yuanbo commercial software.
(a)(b)Figure 25
Comparison result with piece board: 313.5 mm × 31.6 mm and sheet board: 1220 mm × 1050 mm. (a) MGPM-DP. (b) Yuanbo commercial software.
(a)(b)Figure 26
Comparison result with piece board: 196.2 mm × 59.4 mm and sheet board: 1220 mm × 1030 mm. (a) MGPM-DP. (b) Yuanbo commercial software.
(a)(b)Figure 27
Comparison result with piece board: 106.5 mm × 78.85 mm and sheet board: 1220 mm × 1100 mm. (a) MGPM-DP. (b) Yuanbo commercial software.
(a)(b)Therefore, according to Figures23–27, MGPM-DP’s performance is clearly better than that of Yuanbo Commercial Software.


## 4.1. Exploration of Computational Performances of 4 Algorithms

Here, 1200 pieces of data from an electronic manufacturing company in Pan’an Zhejiang province, China, are selected and merged into 6 data sets. Each data set has 200 pieces of data. The computational results are listed in Table1. We adopted AN to represent an average number, AUR to denote average utilization rate, ACT to depict average computational time, and DS as the abbreviation of data sets.Table 1
Statistics of 4 algorithms.
DSMGPM-DPMGPM-BCSimplex methodDynamic prog. AlgorithmAUR (%)AN (Ps)ACT (S)AUR (%)AN (Ps)ACT (S)AUR (%)AN (Ps)ACT (S)AUR (%)AN (Ps)ACT (S)D197.78%∗689∗0.158497.47%6870.124097.41%6870.0193∗97.51%68826.2678D298.33%∗577∗0.062998.11%5760.044398%5750.0183∗97.76%57423.8502D398.23%∗944∗0.558798.04%9430.151797.96%9420.0186∗97.75%93328.9502D498.61%∗1288∗0.269198.49%12870.180198.45%12860.0186∗97.97%128029.1002D598.91%∗1607∗0.576498.75%16050.425198.68%16040.0185∗98.27%159627.6002D697.95%∗2291∗1.609197.80%22891.281397.71%22880.0185∗97.59%228021.0023Note. Since the dynamic programming algorithm is very time-consuming, if no solutions are found in 30 seconds, AUR and AN is 0.It can be clearly seen in Table1 that the average utilization rate and the average number of piece boards achieved by MGPM-DP are superior to the other 3 algorithms. Simplex Method shows an overwhelming advantage in computational time. The performance of MGPM-BC is only a little bit inferior to that of MGPM-DP in terms of AUR an AN. As for ACT, MGPM-BC does display its superiority over MGPPM-DP. Although the average utilization rate of the strip-based dynamic programming algorithm is acceptable, the time consumption is substantial and not quite satisfactory.Figure12 shows a statistics chart of 1200 pieces of data falling into different sections of utilization rates. From Figure 12, we can find out the superiority of MGPM-DP over the other 3 algorithms as well.Figure 12
Statistics chart of all cases. Note: theX-axis displays utilization rate (%), and the Y-axis points out the number of cases.


## 4.2. Size-Fixed Sheet Board with Nonfixed Piece Boards

Here, we check the utilization rate distributions for 5 common sheet boards (1230 mm × 1030 mm, 1224 mm × 1104 mm, 1224 mm × 1054 mm, 1220 mm × 1100 mm, and 1220 mm × 1100 mm), aiming to look for ideal piece boards for each sheet board in that company. The 3D distribution charts for each sheet board are presented in Figures13–17. According to Figures 13–17, we can learn that piece boards in each figure with convex peaks (utilization rates closest to 1) are ideal ones for that sheet board.Figure 13
Utilization rate distribution chart for 1230 × 1030 sheet board.Figure 14
Utilization rate distribution chart for 1224 × 1104 sheet board.Figure 15
Utilization rate distribution chart for 1224 × 1054 sheet board.Figure 16
Utilization rate distribution chart for 1220 × 1050 sheet board.Figure 17
Utilization rate distribution chart for 1220 × 1100 sheet board.


## 4.3. Size-Fixed Piece Board with Nonfixed Sheet Boards

In the real production setting, enterprises sometimes randomly set some workplates. They first pack piece boards on the workplates. Then they try to find the best packing layout of workplates on the sheet board. Here, 5 common piece board sizes (62.5 mm × 23 mm, 37 mm × 25 mm, 27 mm × 27 mm, 238.5 mm × 75 mm, 315 mm × 209.6 mm) are selected to explore the utilization rate distribution on sheet boards withL [1220 mm, 2060 mm] and W [1030 mm, 1230 mm]. The results are shown in Figures 18–22.Figure 18
Utilization rate distribution chart for 62.5 × 23 piece board.Figure 19
Utilization rate distribution chart for 37 × 25 piece board.Figure 20
Utilization rate distribution chart for 27 × 27 piece board.Figure 21
Utilization rate distribution chart for 238.5 × 75 piece board.Figure 22
Utilization rate distribution chart for 315 × 209.6 piece board.


## 4.4. Comparison of MGPM-DP with Yuanbo Commercial Packing Software

Currently, there are many commercial packing software applications widely run in circuit board manufacturing companies. Yuanbo Software, which is apparently superior to other commercial software, is used as a comparison benchmark here. 5 experiments are performed to further clarify the performance of MGPM-DP as shown in Figures23–27.Figure 23
Comparison result with piece board: 158 mm × 89 mm and sheet board: 1245 mm × 1040 mm. (a) MGPM-DP. (b) Yuanbo commercial software.
(a)(b)Figure 24
Comparison result with piece board: 98.5 mm × 70 mm and sheet board: 1230 mm × 1030 mm. (a) MGPM-DP. (b) Yuanbo commercial software.
(a)(b)Figure 25
Comparison result with piece board: 313.5 mm × 31.6 mm and sheet board: 1220 mm × 1050 mm. (a) MGPM-DP. (b) Yuanbo commercial software.
(a)(b)Figure 26
Comparison result with piece board: 196.2 mm × 59.4 mm and sheet board: 1220 mm × 1030 mm. (a) MGPM-DP. (b) Yuanbo commercial software.
(a)(b)Figure 27
Comparison result with piece board: 106.5 mm × 78.85 mm and sheet board: 1220 mm × 1100 mm. (a) MGPM-DP. (b) Yuanbo commercial software.
(a)(b)Therefore, according to Figures23–27, MGPM-DP’s performance is clearly better than that of Yuanbo Commercial Software.


## 5. Conclusion

In this paper, we reduce the two-dimensional PCB board packing problem into two one-dimensional problems focusing on the best combinations on two sides of a rectangle sheet board. Then, we try to obtain the best solution by applying multiple rounds of nesting packing mode. Experimental results show that the average utilization rates of MGPM methods are closer to the theoretical optimal value than the simplex method and strip-based dynamic programming algorithm. In addition, it is of great significance for enterprises to select and set the sizes of workplates by carrying out research on size-fixed sheet boards and piece boards, respectively. Moreover, comparisons between the MGPM-DP and the Yuanbo commercial packing software further verify the advantages and feasibility of the MGPM. Our follow-up work will aim at developing circuit packing software eagerly needed by electronic enterprises engaging in the PCB manufacturing industry.



---

*Source: 2224820-2022-10-12.xml*