Print

发布时间: 2019-06-16
摘要点击次数:
全文下载次数:
DOI: 10.11834/jig.180559
2019 | Volume 24 | Number 6




    图像理解和计算机视觉    




  <<上一篇 




  下一篇>> 





矩形件简单块占角排样方式的动态规划
expand article info 潘卫平, 张瑞友
东北大学信息科学与工程学院, 沈阳 110819

摘要

目的 针对矩形件无约束2维剪切排样问题,提出一种可简化板材切割工艺的简单块占角排样方式,并构造这种排样方式的动态规划生成算法。方法 该排样方式在板材左下角按照简单块方式排样若干行若干列同种矩形件,将板材剩余部分划分为两个子板;将子板按照上述方法继续递归排样和划分,直至子板排满矩形件为止。采用动态规划确定所有可能尺寸的板材左下角排样的最优矩形件、矩形件的最优行列数和板材剩余部分的最优子板划分。运用规范尺寸排除不必要的计算。结果 将本文算法与目前常见的算法进行比较,实验结果表明本文算法计算时间合理,排样价值较高。在第1组41道基准例题中,本文算法所有例题均求出了精确解,同质块T型算法、同质块两段算法和复合条带两段算法分别有7道、5道和4道例题未求出精确解。在第2组20道基准例题中,本文算法只有1道例题未求出精确解,普通三阶段算法、同质块T型算法、同质块两段算法和匀质条带三块算法分别有18道、15道、15道和20道例题未求出精确解。在第3组50道随机例题中,本文算法、普通两段算法和同质块两段算法板材利用率分别为99.913 7%、99.862 3%和99.796 1%。在第4组31道基准例题中,本文算法所有例题均求出了精确解,普通占角排样算法有2道例题未求出精确解。结论 本文算法计算时间远小于精确算法,优化效果接近精确算法;本文算法计算时间与多种启发式算法接近,但优化效果好于多种启发式算法。

关键词

无约束2维剪切排样; 排样算法; 占角排样方式; 动态规划; 规范尺寸

Dynamic programming algorithm for simple block corner-occupying pattern of rectangular blanks
expand article info Pan Weiping, Zhang Ruiyou
College of Information Science and Engineering, Northeastern University, Shenyang 110819, China
Supported by: National Natural Science Foundation of China (71471034); Fundamental Research Funds for Central Universities (N160404011)

Abstract

Objective In industrial production, we often encounter 2D cutting problems, such as the cutting process of metal sheet, glass, and plywood. A good cutting pattern can effectively simplify the cutting process, improve the utilization rate of metal sheets, reduce resource consumption, and reduce the production costs of enterprises. The 2D cutting problem can be categorized into rectangular and other shape cutting problems according to the geometric shape of the workpiece. According to whether the workpiece can rotate, the same problem can be classified as rotatable and non-rotatable. According to the number of times each workpiece can appear in the sheet, it can be divided into constrained and unconstrained cutting problems. According to whether the cutting process of blanking meets the requirement of guillotine cuts, it can be categorized into guillotine and non-guillotine cutting problems. This study focuses on the unconstrained 2D guillotine cutting problem of rectangular pieces (UTGCR), which refers to cutting a sheet into several rectangular pieces of different sizes and values, and the number of occurrences of each rectangular piece in the sheet is unconstrained. The optimization goal of this problem is to maximize the total value of rectangular pieces cut out of the sheet. The cutting stock algorithm iteratively calls the cutting algorithm to generate the cutting pattern of rectangular pieces on a sheet. After a new cutting pattern is generated, the number of times of using the new cutting pattern is determined by the residual demand of rectangular pieces. The value of the rectangle is corrected by the number of the rectangular pieces included in the new cutting pattern to make the subsequent cutting pattern reasonable. A good cutting algorithm can improve the material utilization of the sheet, reduce resource consumption, reduce production costs and improve the competitiveness of enterprises. From the viewpoint of computational complexity, UTGCR is a complex combinatorial optimization problem with NP complexity. The exact algorithm takes too long to solve large-scale problems and cannot meet practical application requirements because the solution space of the feasible cutting pattern is large. In practice, heuristic algorithms are generally used to solve UTGCR problems, which can be divided into two categories according to the construction idea of the algorithms. The first is the intelligent optimization algorithm, which is widely used in rectangular nonguillotine cutting problems and relatively less used in UTGCR problems. Guaranteeing the quality of the solution is difficult because of the unknown convergence of the algorithm. In addition, the structure of the cutting pattern is complex, which is not conducive to the sheet cutting process. The second is to reduce the solution space and computational complexity of the algorithm by restricting the cutting pattern to satisfy a certain geometric characteristic. Although this kind of algorithm is not guaranteed to obtain the optimal solution, it is widely used because of its minimal calculation time and simple layout structure, which is conducive to the sheet cutting process. A simple block corner-occupying pattern that can simplify the sheet-cutting process is presented, and a dynamic programming algorithm for generating this pattern is constructed. Method The dynamic programming principle is used to construct a simple block corner-occupying pattern with different sizes of sub sheets one by one from small to large. The pattern information of sub sheets with small sizes can be directly used when constructing the sub sheet with current sizes. A simple block corner-occupying pattern is obtained when the simple block corner-occupying pattern of the sub sheet L×W is obtained. With this pattern, several rows and columns of identical pieces are packed at the lower left corner of the sheet according to a simple block mode. The remaining part of the sheet is divided into two sub sheets. Recursive packing and partitioning of the sub sheet are continued according to the above method until the sub sheets are fully filled with rectangular pieces. A dynamic programming algorithm is used to determine the optimal piece type, the optimal number of rows and columns of pieces, and the optimal partitioning of the remaining part of the all possible sheet sizes. The normal size is used to exclude unnecessary calculations. Result Five groups of instances in literature are used. The first, second, and fourth groups are international benchmark instances, which can be found at http://www.laria.u-picardie.fr/hifi/OR-Benchmark. The third group comprises random instances, and the fifth group consists of actual production instances. After comparing the algorithm in this study with the algorithms in common literature, experimental results show that the algorithm in this study has more reasonable calculation time and higher pattern value. In the first set of 41 benchmark instances, the algorithm in this study has found the exact solution to all instances, whereas the homogeneous block T-shape, homogeneous block two-segment, and compound strip two-segment algorithms have not found the exact solution of seven, five, and four instances, respectively. In the second set of 20 benchmark instances, only one has not been solved accurately by the algorithm in this study. A total of 18, 15, 15, and 20 instances have not been solved accurately by the common three-stage, homogeneous block T-type, homogeneous block two-stage, and homogeneous strip three-block algorithms, respectively. In the third set of 50 random instances, the sheet utilization rates of the algorithm in this study, the ordinary two-stage algorithm, and the homogeneous block two-stage algorithm are 99.913 7%, 99.862 3%, and 99.796 1%, respectively. In the fourth set of 31 benchmark instances, the exact solutions of all instances are solved by the algorithm in this study, and the exact solutions of two instances are not solved by the common corner-occupying algorithm. Conclusion The computation time of the algorithm in this study is much less than that of the exact cutting algorithms, and its optimization effect is close to that of the exact cutting algorithms. The computation time of the algorithm in this study is close to that of many heuristic cutting algorithms, and its optimization effect is better than that of many heuristic cutting algorithms. As a cutting pattern generation algorithm, this algorithm can be combined with linear programming, integer programming, and sequential heuristic algorithm to solve the 2D guillotine cutting stock problem of rectangular pieces.

Key words

unconstrained two-dimensional guillotine cutting problem; packing algorithm; corner-occupying pattern; dynamic programming; normal size

0 引言

在工业生产中经常会遇到2维排样问题,例如金属板材、玻璃、胶合板等切割成工件的下料环节,优良的排样方式能有效地简化板材切割工艺,提高板材利用率,减少资源消耗,降低企业生产成本[1-3]。2维排样问题,按照工件的几何形状,可分为矩形件排样问题和其他形状件排样问题;按照工件是否允许旋转,可分为可旋转排样问题和不可旋转排样问题;按照每种工件在板材中允许出现的次数是否有约束,可分为有约束排样问题和无约束排样问题;按照下料的切割工艺是否满足一刀切,可分为剪切排样问题和非剪切排样问题。

讨论矩形件无约束2维剪切排样(UTGCR)问题[4]:将板材$L×W$($L$为长,$W$为宽)剪切成$m$种矩形件,第$i$种矩形件的尺寸为$l_{i}×w_{i}$,价值为$v_{i}$,其中$i∈ \mathit{\boldsymbol{M}}$={1, 2, …, $m$};对每种矩形件在板材中出现的次数$k_{i}$无约束,优化目标是寻找一个剪切排样方式使得排样价值即板材所含矩形件总价值最大,这里排样价值$V=\sum\limits_{i=1}^{m} k_{i} v_{i}$。该问题属于一刀切允许旋转排样问题。由于可行的剪切排样方式组成的解空间非常庞大,精确算法[5-6]在求解大规模问题时耗时过长,无法满足实际应用要求。实际中一般采用启发式算法求解UTGCR问题,按照算法的构造思想可分为两类。

第1类是智能优化算法,此类算法在矩形件非剪切排样问题中应用较多,在UTGCR问题中应用相对较少。Alvarez等人[7]提出了贪心随机自适应搜索算法。Leung等人[8]提出了混合模拟退火元启发式算法,首先给出一个匹配策略用来确定某位置应该被哪个矩形件最先填充,基于该策略构造一种启发式算法确定矩形件的排放顺序得到初始解,然后采用贪心算法搜索更优解,用模拟退火算法跳出局部最优解实现全局搜索。李波等人[9]提出了启发式动态分解算法,根据矩形件将板材正交分解成多个子板,计算矩形件的放置耦合度选择最佳子板,通过干涉关系实现所有子板状态更新。Wang等人[10]提出了粒子群优化算法,适应度函数为板材的浪费面积,解码规则为最佳适应插入排样。Shiangjen等人[11]提出了双向启发式填充算法,通过在板材长宽两个方向逐层填充剩余空间来最大化板材利用率,用迭代局部搜索和移位策略来平衡广度与深度搜索。此类算法由于收敛性未知从而难以保证解的质量,另外生成的排样方式结构比较复杂,不利于板材切割工艺。

第2类是通过限制排样方式满足一定的几何特征,从而缩小排样方式的解空间,减少算法的计算量。此类算法虽然不保证求到最优解,但是由于计算时间较快,排样方式的结构比较简单, 有利于切割工艺,目前被广泛采用。Hifi[12]提出了两阶段和三阶段排样方式的动态规划算法,首先构造矩形件在条带上排样的无约束背包问题模型;然后构造条带在段上排样的无约束背包问题模型;最后采用深度优先树搜索确定板材的段划分。崔耀东等人分别提出了两段排样方式的递归算法[13]和占角排样方式的递归算法[14]。杨传民等人[15]提出了简单块四块排样方式的分支定界算法。Cui等人[16]提出了同质块T型排样方式的动态规划算法,这种算法沿竖直方向将板材切成两个段,每个段包含长度和方向均相同的级,每个级包含一行同质块,每个同质块包含由同种矩形件组成的条带;算法首先采用动态规划生成最优同质块,然后通过求解背包问题得到同质块在级上的布局和级在段上的布局,最后择优选择两个段组成排样方式。之后又提出了三阶段排样方式的改进动态规划算法[17],通过求解3个背包问题分别得到矩形件在条带中的布局、条带在段中的布局和段在板材中的布局。季君等人[18]提出了同质块两段排样方式的背包算法。潘卫平等人[19]提出了匀质条带三块排样方式的背包算法。薛焕堂等人[20]提出了复合条带两段排样方式的确定型算法。

本文提出一种新的排样方式——简单块占角排样方式,并构造其动态规划生成算法。在板材左下角排放若干行若干列同种矩形件,将板材剩余部分划分为两个子板,把子板当作板材按照上述方式继续递归考察,直至子板排满矩形件为止。采用动态规划算法从小到大构造所有可能尺寸的子板的简单块占角排样方式,直至得到板材的简单块占角排样方式。

1 简单块占角排样方式的相关概念

不失一般性,假设矩形件方向固定。因为当矩形件允许转向90°时,可将矩形件$l_{i}×w_{i}$看做$l_{i}×w_{i}$$w_{i}×l_{i}$两种矩形件。规定板材和矩形件的水平边为长,竖直边为宽。

定义1   简单块。若干行若干列同种矩形件排列在一起组成的矩形块。

定义2   简单块占角排样方式。初始时选择一种矩形件按照简单块方式在板材左下角排放若干行若干列,然后用一条剪切线将板材剩余部分划分为2个子板[15];将子板当作板材按照上述方式继续递归考察,直到子板排满矩形件为止。

简单块占角排样方式是一种启发式排样方式,它的基本单元是简单块,简单块只含同种矩形件,可以简化板材的切割工艺。

定义3   排样价值。板材或子板的排样价值是指按照某种排样方式其包含的矩形件总价值。

$F(x, y)$为子板$x×y$的最大排样价值。为了叙述的统一性,将板材看做长为$L$、宽为$W$的子板。如图 1所示,在子板$x×y$左下角排放$s$$t$列矩形件$i$后,用一条剪切线沿着矩形件的上边界(如图 1(a)所示)或右边界(如图 1(b)所示)将板材剩余部分划分为A、B两个子板。设两种划分方式所得简单块占角排样方式的价值分别为

图 1 子板剩余部分的两种划分方式
Fig. 1 Two ways of dividing the remaining part of the sub sheet ((a) horizontal dividing; (b) vertical dividing)

$ \begin{array}{c}{f_{X}(x, y, i, s, t)=} \\ {v_{i} s t+F\left(x-t l_{i}, s w_{i}\right)+F\left(x, y-s w_{i}\right)}\end{array} $ (1)

$ \begin{array}{c}{f_{Y}(x, y, i, s, t)=} \\ {v_{i} s t+F\left(t l_{i}, y-s w_{i}\right)+F\left(x-t l_{i}, y\right)}\end{array} $ (2)

排放在子板左下角的矩形件$i$$m$种选法;对于特定的矩形件$i$,因为矩形件不能超出子板边界,故其在子板左下角允许排放的最大行数为$\left\lfloor {y/w_{i}} \right\rfloor $,最大列数为$\left\lfloor {x/l_{i}} \right\rfloor $,其中符号“$ \left\lfloor {\; } \right\rfloor $”表示向下取整。设图 1(a)划分方式所得排样方式的最大价值为$F_{X}(x, y)$图 1(b)划分方式所得排样方式的最大价值为$F_{Y}(x, y)$,具体公式为

$ \begin{array} [c]{c} F_{X}(x, y)=\\ \underset{i\in \mathit{\boldsymbol{M}}}{\mathop{\text{max}}}\, \underset{s\in \{1, \ldots , \left\lfloor y/{{w}_{i}} \right\rfloor \}, t\in \{1, \ldots , \left\lfloor x/{{l}_{i}} \right\rfloor \}}{\mathop{\text{max}}}\, {{f}_{X}}\left( x, y, i, s, t \right) \end{array} $ (3)

$ \begin{array} [c]{c} F_{Y}(x, y)=\\ \underset{i\in \mathit{\boldsymbol{M}}}{\mathop{\text{max}}}\, \underset{s\in \{1, \ldots , \left\lfloor y/{{w}_{i}} \right\rfloor \}, t\in \{1, \ldots , \left\lfloor x/{{l}_{i}} \right\rfloor \}}{\mathop{\text{max}}}\, {{f}_{Y}}\left( x, y, i, s, t \right) \end{array} $ (4)

$ F(x, y)=\max \left\{F_{X}(x, y), F_{Y}(x, y)\right\} $ (5)

式(3)(4)表示对于每种子板划分方式按照子板排样价值最大原则选择子板左下角排放的矩形件种类,以及矩形件排列的行数和列数。式(5)表示子板的最大排样价值等于两种划分方式所对应,最大排样价值的较大者。

2 动态规划排样算法

采用动态规划原理[21]由小到大逐个构造不同尺寸子板的简单块占角排样方式,在构造当前尺寸的子板排样方式时能够直接使用比当前尺寸小的子板的排样信息。当得到子板$L×W$的简单块占角排样方式时即得到了板材的简单块占角排样方式。

运用规范尺寸可以在不影响解的质量前提下缩小排样问题的计算量[18]。本文规范长度是矩形件长度的线性组合,规范宽度是矩形件宽度的线性组合。令$ \mathit{\boldsymbol{G}}_{\rm L}$$ \mathit{\boldsymbol{G}}_{\rm W}$分别为规范长度集合和规范宽度集合,则有

$ \boldsymbol{G}_{\mathrm{L}}=\left\{x \in {\bf{Z}} | x=\sum\limits_{i=1}^{m} a_{i} l_{i} ; a_{i} \in {\bf{N}}, 0 \leqslant x \leqslant L\right\} $ (6)

$ \boldsymbol{G}_{\mathrm{W}}=\left\{y \in {\bf{Z}} | y=\sum\limits_{i=1}^{m} b_{i} w_{i} ; b_{i} \in {\bf{N}}, 0 \leqslant y \leqslant W\right\} $ (7)

式中,$\bf N$为非负整数集合,$a_{i}$为规范长度所包含矩形件$i$长度的个数,$b_{i}$为规范宽度所包含矩形件$i$宽度的个数。规范尺寸具有性质:假如$A_{\rm L}(x)$为不超过$x$的最大规范长度,$A_{\rm W}(y)$为不大于$y$的最大规范宽度,则按照简单块占角排样方式进行排样时子板$x×y$与子板$A_{\rm L}(x)$×$A_{\rm W}(y)$具有相等的排样价值。令$l_{{\rm min}}$$w_{{\rm min}}$分别为矩形件的最小长度和最小宽度,即$l_{\min }=\min\limits _{i \in \mathit{\boldsymbol{M}}}\left\{l_{i}\right\}$$w_{\min }=\min\limits _{i \in \mathit{\boldsymbol{M}}}\left\{w_{i}\right\}$

由规范尺寸性质可知,本文排样算法只需考察规范尺寸的子板即可。分别对集合$\mathit{\boldsymbol{G}}_{\rm L}$$\mathit{\boldsymbol{G}}_{\rm W}$中的元素进行升序排列,记$\mathit{\boldsymbol{G}}_{\rm L}$$\mathit{\boldsymbol{G}}_{\rm W}$的第$i$($i=0, …, |\mathit{\boldsymbol{G}}_{\rm L}|-1$)个元素分别为$g_{\rm L}(i)$$g_{\rm W}(i)$,其中$|\mathit{\boldsymbol{G}}_{\rm L}|$$|\mathit{\boldsymbol{G}}_{\rm W}|$分别为集合$\mathit{\boldsymbol{G}}_{\rm L}$$\mathit{\boldsymbol{G}}_{\rm W}$的元素个数。令$l_{{\rm min}}$$w_{{\rm min}}$分别为矩形件的最小长度和最小宽度,即$l_{\min }=\min\limits _{i \in \mathit{\boldsymbol{M}}}\left\{l_{i}\right\}$$w_{\min }=\min\limits _{i \in \mathit{\boldsymbol{M}}}\left\{w_{i}\right\}$。易知普通子板的长度个数$\overline{L}$=$L-l_{{\rm min}}+1$,宽度个数$\overline{W}$=$W-w_{{\rm min}}+1$;规范尺寸子板的长度个数为$|\mathit{\boldsymbol{G}}_{\rm L}|$-1,宽度个数为$|\mathit{\boldsymbol{G}}_{\rm W}|$-1。因此普通子板数量为$\overline{L}\overline{W}$,规范尺寸子板的数量为($|\mathit{\boldsymbol{G}}_{\rm L}|$-1)($|\mathit{\boldsymbol{G}}_{\rm W}|$-1),由于$(|\mathit{\boldsymbol{G}}_{\rm L}|$-1)($|\mathit{\boldsymbol{G}}_{\rm W}|$-1)有可能小于$\overline{L}\overline{W}$,故采用规范尺寸有可能减少算法考察的子板数量,从而加速排样算法的求解过程。

构造动态规划算法生成板材的简单块占角排样方式。令$Q(x, y)$$N_{1}(x, y)$$N_{2}(x, y)$分别为子板$x×y$左下角排放的矩形件的编号、矩形件的行数和矩形件的列数;$T(x, y)$表征子板$x×y$剩余部分的划分方式,水平划分时$T(x, y)=1$,竖直划分时$T(x, y)=2$。在计算出板材最大排样价值后,通过逆向追踪上述4个数组的取值,可以得到板材的最优排样方式。简单块占角排样方式的动态规划生成算法具体步骤如下:

输入:一个矩形件无约束2维剪切排样问题的实例$I^{\#}=(L, W, l[\;], w[\;], v[\;])$

输出:实例$I^{\#}$的最大排样价值$F(L, W)$及其对应排样方式的特征数组$ \mathit{\boldsymbol{Q}}$$ \mathit{\boldsymbol{N}}_{1}$$ \mathit{\boldsymbol{N}}_{2}$$ \mathit{\boldsymbol{T}}$

1) 初始化$F(x, y)=N_{1}(x, y)=N_{2}(x, y)=T(x, y)=0$, 其中$x=0, …, L$, $y=0, …, W$

2) For $p=1$ to $(|\mathit{\boldsymbol{G}}_{\rm L}|$-1)

3)   For $q=1$ to $(|\mathit{\boldsymbol{G}}_{\rm W}|$-1)

4)      $x=g_{\rm L}(p),y = g_{\rm W}(q)$

5)    If $F(g_{\rm L}(p-1), y)≥F(x, g_{\rm W}(q-1)) $

      Then $F(x, y) = F(g_{\rm L}(p-1), y)$

6)   Else $F(x, y)=F(x, g_{\rm W}(q-1))$

7)   For $i=1$ to $m$

8)     If $x <l_{i} \;{\rm or} \;y <w_{i}$

      Then skip type $i$

9)     For $s=1 \;{\rm to}\; \left\lfloor {y/w_{i}} \right\rfloor $

10)        For $t=1 \;{\rm to}\; \left\lfloor {x/l_{i}} \right\rfloor $

11)          If $F(x, y) < v_{i}st + F(A_{\rm L}(x-tl_{i}), sw_{i}) +$ $F(x, A_{\rm W}(y-sw_{i})) $

12)           Then $F(x, y)=v_{i}st+F(A_{\rm L}(x-tl_{i}), sw_{i})+$ $F(x, A_{\rm W}(y-sw_{i})), \mathit{\boldsymbol{Q}}(x, y)=i, $ $ \mathit{\boldsymbol{N}}_{1}(x, y)=s, \mathit{\boldsymbol{N}}_{2}(x, y)=t, \mathit{\boldsymbol{T}}(x, y)=1$

13)           If $F(x, y) <v_{i}st+F(tl_{i}, A_{\rm W}(y-sw_{i}))+$ $F(A_{\rm L}(x-tl_{i}), y)$

14)           Then $F(x, y)=v_{i}st+F(tl_{i}, A_{\rm W}(y-sw_{i}))+$ $F(A_{\rm L}(x-tl_{i}), y), \mathit{\boldsymbol{Q}}(x, y)=i,$ $\mathit{\boldsymbol{N}}_{1}(x, y)=s, \mathit{\boldsymbol{N}}_{2}(x, y)=t, \mathit{\boldsymbol{T}}(x, y)=2$

15)          End for

16)        End for

17)      End for

18)    End for

19) End for

20) For $x=l_{{\rm min}}$ to L

21)    For $y=w_{{\rm min}}$ to W

22)      $F(x, y)=F(A_{\rm L}(x), A_{\rm W}(y))$, 同理, 令$\mathit{\boldsymbol{Q}}, \mathit{\boldsymbol{N}}_{1}, \mathit{\boldsymbol{N}}_{2}, \mathit{\boldsymbol{T}}$数组的元素值为其对应规范尺寸的元素值。

23)   End for

24) End for

步骤1),初始化所有可能尺寸子板的排样价值和子板排样方式的特征数组:$\mathit{\boldsymbol{Q}}$$\mathit{\boldsymbol{N}}_{1}$$\mathit{\boldsymbol{N}}_{2}$$\mathit{\boldsymbol{T}}$;步骤2)-4),按照尺寸大小顺序考察所有可能的规范尺寸子板;步骤5)6),令子板最大排样价值等于与其尺寸最接近的两个小子板的最大排样价值的较大者;步骤7)8),子板左下角矩形件有$m$种选择,当矩形件尺寸大于子板尺寸时,该种矩形件不予考虑;步骤9)10),逐个考察矩形件排放的行数和列数,其中矩形件不能超出子板边界;步骤11)12),若水平划分子板剩余部分得到的子板排样价值更大,则令子板最大排样价值为当前排样价值,且记录左下角的矩形件编号和矩形件行列数及子板划分方式。步骤13)14),若竖直划分子板剩余部分得到的子板排样价值更大,则令子板最大排样价值为当前排样价值,且记录左下角的矩形件编号和矩形件行列数及子板划分方式。步骤20)-24),令非规范尺寸子板的排样方式和排样价值与其对应的规范尺寸子板相同。

本文算法的时间复杂度上界为O$(m(\mathit{\boldsymbol{G}}_{\rm L}-1)^{2}(\mathit{\boldsymbol{G}}_{\rm W}-1)^{2}/(l_{\min}w_{\min}))$

3 例题求解

将尺寸为$9×7$的板材剪切成2种矩形件,其中$l_{1}=4$$w_{1}=3$$v_{1}=11$$l_{2}=5$$w_{2}=7$$v_{2}$=36,对每种矩形件在板材中出现的次数无约束,优化目标是寻找一个剪切排样方式使得排样价值即板材所含矩形件总价值最大。

用本文算法求解该例题。由式(6)(7)确定规范长度集合$\mathit{\boldsymbol{G}}_{\rm L}|={0, 4, 5, 8, 9},规范宽度集合|\mathit{\boldsymbol{G}}_{\rm W}$={0, 3, 6, 7},可知($|\mathit{\boldsymbol{G}}_{\rm L}|$-1)=4,($|\mathit{\boldsymbol{G}}_{\rm W}|$-1)=3,故算法中$p$的取值范围为{1, 2, 3, 4};$q$的取值范围为{1, 2, 3}。

$p$=1,$q$=1时,执行算法步骤4)-6),由于$F(0, 3)≥F(4, 0)$,故$F(4, 3)=F(0, 3)=0$(这里$F(g_{\rm L}(p-1), g_{\rm W}(q))$$F(0, 3)$$F(g_{\rm L}(p), g_{\rm W}(q-1))$$F(4, 0)$$F(g_{\rm L}(p), g_{\rm W}(q))$$F(4, 3)$)。执行算法步骤7)-17),当$i$=1,$s$=1,$t$=1时,由于$F(4, 3)=0 < v_{1} + F(A_{\rm L}(4-l_{i}), w_{i}) + F(4, A_{\rm W}(3-w_{1}))=11+F(0, 3)+F(4, 0)=11$,故$F(4, 3)$=11,同时记录数组$ \mathit{\boldsymbol{Q}}、\mathit{\boldsymbol{N}}_{1}、\mathit{\boldsymbol{N}}_{2}、\mathit{\boldsymbol{T}}$的对应元素值;当$i$=2,$s$=1,$t$=1时,算法步骤8)由于4 <$l_{2}$,故跳过$i$。最终得到$F(4, 3)$=11。

同理可得:$F(4, 6)=2v_{1}$=22,$F(4, 7)=2v_{1}$=22,$F(5, 3)$=$v_{1}$=11,$F(5, 6)$=2$v_{1}$=22,$F$(5, 7)=$v_{2}$=36,$F(8, 3)$=2$v_{1}$=22,$F$(8, 6)=4$v_{1}$=44,$F(8, 7)$=4$v_{1}$=44,$F(9, 3)$=2$v_{1}$=22,$F$(9, 6)=4$v_{1}$=44。

$p$=4,$q$=3时,执行算法步骤4)-6),由于$F(8, 7)≥F(9, 6)$,故$F(9, 7)=F(8, 7)$=44。执行算法步骤7)-17),当$i$=1时,可知$s$取值范围为{1, 2},$t$取值范围为{1, 2}。当$s$=1,$t$=1时,算法步骤11)条件$F(9, 7) < v_{1} + F(A_{\rm L}(9-l_{1}, w_{1})) + F(9, A_{\rm W}(7-w_{1}))=11+F(5, 3)+F(9, 3)$=44不成立,算法步骤13)条件$F(9, 7) < v_{1} + F(l_{1}, A_{\rm L}(7-w_{1})) + F(A_{\rm W}(9-l_{1}), 7)=11+F(4, 3)+F(5, 7)$=58成立,执行算法步骤14),$F(9, 7)=58$,同时记录数组$ \mathit{\boldsymbol{Q}}、\mathit{\boldsymbol{N}}_{1}、\mathit{\boldsymbol{N}}_{2}、\mathit{\boldsymbol{T}}$的对应元素值。同理可得$s$=1,$t$=2时,$F(9, 7)=58$$s$=2,$t$=1时,$F$(9, 7)=58;$s$=2,$t$=2时,$F(9, 7)=58$

$i$=2时,可知$s$的取值范围为{1},$t$的取值范围为{1}。当$s$=1,$t$=1时,同理可得$F(9, 7)=58$

因此最终得$F(9, 7)=58$。通过逆向追踪数组$ \mathit{\boldsymbol{Q}}、\mathit{\boldsymbol{N}}_{1}、\mathit{\boldsymbol{N}}_{2}、\mathit{\boldsymbol{T}}$的元素取值,可以得到板材的简单块占角排样方式。图 2为例题的解,其中灰色区域为板材裁剪后的剩余部分。

图 2 例题的解
Fig. 2 The solution of an instance

4 实验结果

采用文献[14, 18]实验所用的全部例题,共有5组,其中第1组、第2组和第4组为国际通用的Benchmark基准例题(http://www.laria.u-picardie.fr/hifi/OR-Benchmark);第3组为随机例题,第5组为实际生产实例。需要注意的是文献[18]所用的例题矩形件方向允许转向90°,文献[14]所用的例题矩形件方向是固定的。本文算法是简单块占角排样方式的精确算法,由于简单块占角排样方式是一种启发式排样方式,它只是剪切排样方式的一个子集,故本文算法也可以看做是剪切排样方式的一种启发式算法。将本文算法与9种文献算法进行比较,其中文献[5-6]算法是剪切排样方式的精确算法,其余7种文献算法是剪切排样方式的启发式算法。由于本文算法和9种文献算法都是确定性算法,故只要算法执行完毕,实验环境只对算法的计算时间有影响而对算法优化结果无影响。本文实验采用的计算机为:AMD速龙4880+ CPU主频2.8 GHz,内存512 MB。

4.1 第1组例题

本组包含41道国际通用的Benchmark例题,具体参见文献[12]。表 1为5种算法的排样价值统计结果,4种文献算法的排样价值和计算时间(硬件环境与本文算法相同)来源于文献[18]。从表 1可以看出,对于41道例题,本文算法均得到了最优解;文献[16]同质块T型算法有34道例题得到最优解;文献[18]同质块两段算法有36道例题得到最优解;文献[20]复合条带两段算法求解了其中20道例题,有16道例题得到最优解。

表 1 第1组例题的实验结果
Table 1 Experimental results of the first set of instances

下载CSV
题号 排样价值
文献[5]精确算法 文献[16]算法 文献[18]算法 文献[20]算法 本文算法
H 12 387 12 348
HZ1 5 226
M1 15 550
M2 73 176 73 080
M3 147 366
M4 273 991
M5 590 012 588 315 588 315 588 315
B 9 000 000 -
U1 22 435 030 22 419 021 22 419 021 -
U2 20 446 684 -
UU1 246 046
UU2 595 655
UU3 1 089 308
UU4 1 188 638 -
UU5 1 878 253 -
UU6 2 951 202 -
UU7 2 949 043 -
UU8 3 974 828 3 964 638 -
UU9 6 117 826 -
UU10 12 004 474 11 996 982 11 996 982 -
UU11 13 170 382 13 169 380 1 3169 380 -
HZ2 8 523 8 394
MW1 3 916
MW2 24 950
MW3 39 637
MW4 64 044
MW5 190 937
BW 2 379 786 -
W1 168 834 168 289 168 289 -
W2 37 621 -
UW1 6 696
UW2 9 732
UW3 7 188 6 500
UW4 8 452
UW5 8 398
UW6 6 937 -
UW7 11 585 -
UW8 8 088 -
UW9 7 527 -
UW10 8 172 -
UW11 18 200 -
注:“△”表示对应值与文献[5]精确算法相同,“-”表示对应值未被报道。

本文算法求解41道例题,总共耗时19.67 s,平均每道例题耗时0.48 s,计算时间在实际应用中合理。文献[16, 18]算法平均每道例题分别耗时0.46 s和0.51 s,文献[20]算法计算时间未被报道。文献[5]精确算法每道例题平均耗时41.67 s,其中例题UU11耗时958.55 s,本文算法求解例题UU11只用13.67 s。综上得:1)本文算法在计算时间合理的前提下,排样优化结果好于文献[16, 18, 20]这3种文献算法;2)本文算法在排样优化结果等于文献[5]精确算法的前提下,计算时间远短于文献[5]精确算法。

4.2 第2组例题

本组包含20道国际通用的Benchmark例题[7]表 2为6种算法的排样价值统计结果,其中前4种文献算法的排样价值和计算时间(硬件环境与本文算法相同)来源于文献[18]的表 6,第5种文献算法排样价值和计算时间(主频2.7 GHz,内存2 GB)来源于文献[19]。从表 2可以看出,本文算法有19道例题得到最优解;文献[12]经典三阶段算法有2道例题得到最优解;文献[16]同质块T型算法和文献[18]同质块两段算法均有5道例题得到最优解;文献[19]匀质条带三块算法没有例题得到最优解。

表 2 第2组例题的实验结果
Table 2 Experimental results of the second set of instances

下载CSV
题号 排样价值
文献[5]精确算法 文献[12]算法 文献[16]算法 文献[18]算法 文献[19]算法 本文算法
APT10 3 591 980 3 591 395 3 591 813 3 591 813 3 587 427
APT11 4 190 481 4 189 406 4 189 704 4 189 730 4 183 718
APT12 5 162 097 5 157 280 5 157 782 5 157 858 5 153 572
APT13 3 498 302 3 496 776 3 498 240 3 498 240 3 495 824
APT14 4 466 844 4 466 098 4 466 098 4 466 098 4 458 984
APT15 6 054 955 6 053 226 6 054 230 6 054 230 6 044 200
APT16 7 573 596 7 571 638 7 573 404 7 573 404 7 559 453 7 573 404
APT17 4 537 842 4 536 836 4 532 015
APT18 5 835 996 5 834 516 5 834 516 5 834 928 5 816 829
APT19 6 833 281 6 831 801 6 832 852 6 832 852 6 820 818
APT20 5 717 092 5 691 316 5 532 197
APT21 3 582 310 3 556 714 3 573 678 3 578 150 3 484 406
APT22 4 190 116 4 179 696 4 185 891 4 185 891 4 123 868
APT23 3 568 354 3 557 391 3 567 248 3 567 248 3 538 135
APT24 4 078 132 3 896 332
APT25 3 546 813 3 531 646 3 538 507 3 538 507 3 507 615
APT26 2 723 840 2 694 022 2 723 248 2 723 248 2 656 729
APT27 2 458 038 2 429 052
APT28 4 113 349 4 112 224 4 112 224 4 112 224 4 065 011
APT29 3 688 965 3 676 018 3 652 858
注:“△”表示对应值与文献[5]精确算法相同。

本文算法每道例题的排样价值均高于或等于文献[12, 16, 18-19]算法。本文算法求解20道例题总共耗时38.64 s,平均每道例题耗时1.93 s,计算时间可以满足实际应用需要;文献[12, 16, 18-19]算法平均每道例题分别耗时32.96 s、2.18 s、2.18 s和0.023 s。文献[5]精确算法每道例题平均耗时92.08 s。综上得:1)本文算法计算时间长于文献[19]算法,但短于文献[12, 16, 18]算法,排样优化结果好于这4种文献算法;2)本文算法排样优化结果非常接近文献[5]精确算法,但计算时间远远短于文献[5]精确算法。

4.3 第3组例题

本组包含50道随机例题,具体参见文献[18]。在相同的硬件环境下,分别用本文算法、文献[17-18]算法求解这组例题,表 3为实验统计结果。从表 3可以得出本文算法板材利用率高于文献[17-18]算法;计算时间短于文献[18]算法,略长于文献[17]算法。图 3为本文算法和两种文献算法求得的例题26的排样方式,图中数字表示矩形件编号;灰色区域为板材裁剪后的剩余部分。本文算法、文献[17-18]算法求得的排样方式的排样价值分别为4 497 382、4 490 668和4 497 306。文献[17-18]算法的排样价值均小于本文算法。

表 3 3种算法的比较
Table 3 Comparison of three algorithms

下载CSV
算法 平均板材利用率/% 平均计算时间/s
文献[17] 99.796 1 0.502
文献[18] 99.862 3 0.616
本文 99.913 7 0.581
图 3 不同算法分别求出的例题26的解
Fig. 3 The solution of instance 26 solved by three algorithms
((a) reference [17]; (b) reference [18]; (c)ours)

4.4 第4组例题

本组包含31道国际通用的Benchmark例题,具体参见文献[14]。例题的板材尺寸及其规范尺寸子板数量如表 4所示。从表 4可以看出,规范尺寸子板的数量只有普通子板数量的11%~66%,平均为34%。本文算法求解这31道例题,算法总共耗时7.39 s,平均每道例题耗时0.24 s,所有例题均求出了最优解。在不运用规范尺寸时求解31道例题总共耗时32.89 s,平均每道例题耗时1.06 s,可见运用规范尺寸可以提高算法的计算效率。文献[14]算法平均每道例题耗时0.64 s(硬件环境与本文算法相同),有2道例题未得到最优解。

表 4 板材尺寸及其规范尺寸子板数量
Table 4 Sheet sizes and the number of sub sheets with normal size

下载CSV
题号 $\bar{L}$ $\bar{W}$ $|\mathit{\boldsymbol{G}}_{\rm L}|$-1 $|\mathit{\boldsymbol{G}}_{\rm W}|$-1 $(\mathit{\boldsymbol{G}}_{\rm L}-1)(\mathit{\boldsymbol{G}}_{\rm W}-1)/(\bar{L}\bar{W})$
H 109 85 33 60 0.21
HZ1 72 62 69 43 0.66
M1 84 124 47 73 0.33
M2 215 242 153 86 0.25
M3 242 398 70 155 0.11
M4 420 443 116 138 0.09
M5 629 643 122 145 0.04
B 2 635 2 935 1 820 2 554 0.60
UU1 381 399 170 204 0.23
UU2 597 626 333 321 0.29
UU3 873 778 388 316 0.18
UU4 784 955 443 569 0.34
UU5 1 151 1 038 693 642 0.37
UU6 1 626 1 115 648 494 0.18
UU7 1 164 1 613 742 943 0.37
UU8 1 594 1 534 913 829 0.31
UU9 1 949 1 958 1 046 1 043 0.29
UU10 2 788 2 749 1 303 1 541 0.26
UU11 3 463 3 657 3 013 2 460 0.59
HZ2 81 67 24 55 0.24
UW1 389 383 207 218 0.30
UW2 447 594 308 354 0.41
UW3 559 519 300 310 0.32
UW4 985 811 622 532 0.41
UW5 871 1 141 451 474 0.22
UW6 1 392 1 217 763 720 0.32
UW7 1 764 1 498 904 836 0.29
UW8 2 106 2 197 1 115 1 262 0.30
UW9 2 400 2 113 1 512 1 087 0.32
UW10 2 794 2 899 1 525 1 555 0.29
UW11 463 534 365 426 0.63

4.5 实际生产实例

用本文算法求解文献[18]的4.4节桂林客车厂的排样实例,算法求得了最优解,耗时0.86 min;文献[18]两段算法和文献[6]精确算法也求得了最优解,分别耗时1.6 min和21 min(硬件环境与本文算法相同)。可以看出本文算法在计算时间上优于文献[18]算法和文献[6]精确算法。

5 结论

针对矩形件无约束2维剪切排样问题,设计了一种简单块占角排样方式,构造了其动态规划生成算法,这种排样方式能使同种矩形件尽量聚集在一个块中,有利于板材切割工艺。本文算法是剪切排样方式的启发式算法,与剪切排样方式的其他启发式算法相比,本文算法排样价值高于同质块T型排样算法、同质块两段排样算法、经典三阶段排样算法、普通占角排样算法、复合条带两段排样算法、改进的三阶段排样算法和匀质条带三块排样算法,计算时间比前4种算法短,比后2种算法长。与剪切排样方式的精确算法相比,本文算法计算时间远小于精确算法,优化结果非常接近精确算法。本文算法设计思想比较简单,计算时间能满足实际应用需要。

由于本文算法只考虑单张板材上矩形件的无约束排样,故只能生成单张板材上矩形件的排样方式;对于每种矩形件需求量已知的下料问题,本文算法暂无法解决。今后可将本文算法作为排样方式生成算法与线性规划、整数规划和顺序启发式算法相结合来求解矩形件2维剪切下料问题。

参考文献

  • [1] Wang L, Liu Q, Chen X. Heuristic search algorithm for the rectangular fixed-size guillotine bin packing problem[J]. Journal of Software, 2017, 28(7): 1640–1654. [王磊, 刘强, 陈新. 单规格一刀切矩形排样问题的启发式搜索算法[J]. 软件学报, 2017, 28(7): 1640–1654. ] [DOI:10.13328/j.cnki.jos.005100]
  • [2] Zhang F, Liu Q, Zhang H, et al. Packing optimization of rectangle workpieces oriented to variable-sized bin[J]. Computer Integrated Manufacturing Systems, 2015, 21(11): 2921–2928. [张帆, 刘强, 张浩, 等. 面向多规格板材的矩形工件排样优化方法[J]. 计算机集成制造系统, 2015, 21(11): 2921–2928. ] [DOI:10.13196/j.cims.2015.11.011]
  • [3] Yang W B, Wang Z, Wang W L, et al. Packing of irregular polygons based on real-coded quantum evolutionary algorithm[J]. Computer Integrated Manufacturing Systems, 2016, 22(5): 1235–1243. [杨卫波, 王铮, 王万良, 等. 基于实数编码量子进化算法的不规则多边形排样[J]. 计算机集成制造系统, 2016, 22(5): 1235–1243. ] [DOI:10.13196/j.cims.2016.05.009]
  • [4] Wäscher G, Hauβner H, Schumann H. An improved typology of cutting and packing problems[J]. European Journal of Operational Research, 2007, 183(3): 1109–1130. [DOI:10.1016/j.ejor.2005.12.047]
  • [5] Cui Y, Wang Z, Li J. Exact and heuristic algorithms for staged cutting problems[J]. Proceedings of the Institution of Mechanical Engineers, Part B:Journal of Engineering Manufacture, 2005, 219(2): 201–207. [DOI:10.1243/95440505X8136]
  • [6] Russo M, Sforza A, Sterle C. An exact dynamic programming algorithm for large-scale unconstrained two-dimensional guillotine cutting problems[J]. Computers & Operations Research, 2014, 50: 97–114. [DOI:10.1016/j.cor.2014.04.001]
  • [7] Alvarez-Valdés R, Parajón A, Tamarit J M. A tabu search algorithm for large-scale guillotine (un)constrained two-dimensional cutting problems[J]. Computers & Operations Research, 2002, 29(7): 925–947. [DOI:10.1016/S0305-0548(00)00095-2]
  • [8] Leung S C H, Zhang D F, Zhou C L, et al. A hybrid simulated annealing metaheuristic algorithm for the two-dimensional knapsack packing problem[J]. Computers & Operations Research, 2012, 39(1): 64–73. [DOI:10.1016/j.cor.2010.10.022]
  • [9] Li B, Wang S, Shi S X, et al. Optimum packing of rectangles based on heuristic dynamic decomposition algorithm[J]. Journal of Computer Applications, 2013, 33(7): 1908–1911. [李波, 王石, 施松新, 等. 基于启发式动态分解算法的矩形件优化排样[J]. 计算机应用, 2013, 33(7): 1908–1911. ] [DOI:10.11772/j.issn.1001-9081.2013.07.1908]
  • [10] Wang Y R, Liaw J H, Lin H L, et al. Swarm manifold PSO for solving two-dimensional guillotine cutting problem[C]//Proceedings of 2016 International Conference on Machine Learning and Cybernetics. Jeju, South Korea: IEEE, 2016: 622-626.[DOI: 10.1109/ICMLC.2016.7872959]
  • [11] Shiangjen K, Chaijaruwanich J, Srisujjalertwaja W, et al. An iterative bidirectional heuristic placement algorithm for solving the two-dimensional knapsack packing problem[J]. Engineering Optimization, 2018, 50(2): 347–365. [DOI:10.1080/0305215X.2017.1315571]
  • [12] Hifi M. Exact algorithms for large-scale unconstrained two and three staged cutting problems[J]. Computational Optimization and Applications, 2001, 18(1): 63–88. [DOI:10.1023/A:1008743711658]
  • [13] Cui Y D, Ji J, Zeng T J. Recursive algorithm for generating optimal two-segment cutting patterns of rectangular blanks[J]. Journal of Nanjing University of Aeronautics & Astronautics, 2006, 38(1): 111–114. [崔耀东, 季君, 曾窕俊. 生成矩形毛坯最优两段排样方式的递归算法[J]. 南京航空航天大学学报, 2006, 38(1): 111–114. ] [DOI:10.3969/j.issn.1005-2615.2006.01.022]
  • [14] Cui Y D, Huang J M, Zhang X Q. Recursive algorithm for unconstrained two-dimensional guillotine cutting problem of rectangular pieces[J]. Journal of Computer-Aided Design & Computer Graphics, 2006, 18(7): 948–951. [崔耀东, 黄健民, 张显全. 矩形毛料无约束2维剪切排样的递归算法[J]. 计算机辅助设计与图形学学报, 2006, 18(7): 948–951. ] [DOI:10.3321/j.issn:1003-9775.2006.07.009]
  • [15] Yang C M, Wang S R, Wang X Y. Heuristic algorithm on layout of chopped cutting based on 4 pieces of structure[J]. Journal of Machine Design, 2007, 24(2): 25–26. [杨传民, 王树人, 王心宇. 基于4块结构的斩断切割布局启发性算法[J]. 机械设计, 2007, 24(2): 25–26. ] [DOI:10.3969/j.issn.1001-2354.2007.02.008]
  • [16] Cui Y D, Liu Z Y. T-shape homogenous block patterns for the two-dimensional cutting problem[J]. Journal of Global Optimization, 2008, 41(2): 267–281. [DOI:10.1007/s10898-007-9252-z]
  • [17] Cui Y D. A new dynamic programming procedure for three-staged cutting patterns[J]. Journal of Global Optimization, 2013, 55(2): 349–357. [DOI:10.1007/s10898-012-9930-3]
  • [18] Ji J, Lu Y P, Zha J Z, et al. A deterministic algorithm for optimal two-segment cutting patterns of rectangular blanks[J]. Chinese Journal of Computers, 2012, 35(1): 183–191. [季君, 陆一平, 查建中, 等. 生成矩形毛坯最优两段排样方式的确定型算法[J]. 计算机学报, 2012, 35(1): 183–191. ] [DOI:10.3724/SP.J.1016.2012.00183]
  • [19] Pan W P, Chen Q L, Cui Y D, et al. An algorithm for generating optimal homogeneous strips three block patterns of rectangular blanks[J]. Journal of Graphics, 2015, 36(1): 7–11. [潘卫平, 陈秋莲, 崔耀东, 等. 基于匀质条带的矩形件最优三块布局算法[J]. 图学学报, 2015, 36(1): 7–11. ] [DOI:10.3969/j.issn.2095-302X.2015.01.002]
  • [20] Xue H T, Dong H F, Guan W L. An algorithm for generating composite strip two-segment cutting patterns[J]. Machinery Design & Manufacture, 2017(7): 124–127. [薛焕堂, 董海芳, 管卫利. 复合条带两段排样方式的生成算法[J]. 机械设计与制造, 2017(7): 124–127. ] [DOI:10.19356/j.cnki.1001-3997.2017.07.032]
  • [21] Zhang H G, Zhang X, Luo Y H, et al. An overview of research on adaptive dynamic programming[J]. Acta Automatica Sinica, 2013, 39(4): 303–311. [张化光, 张欣, 罗艳红, 等. 自适应动态规划综述[J]. 自动化学报, 2013, 39(4): 303–311. ] [DOI:10.3724/SP.J.1004.2013.00303]