1、2.定义符号说明:表示按照第 i 种模式切割 I 型号玻璃的块数xi(i=1,2,3.,20) ;表示按照第 j 种模式切割 II 型号玻璃的块数yj(j=1,2,3,.,20) ;3.模型建立:此问题为建筑公司下料问题,其与钢管易拉罐下料问题,自来水分派问题,奶制品的生产销售问题非常相似,都属于数学优化模型。所以我们可以用一些数学规划的相关知识来解决。按照假设把这其中规格的窗户分为两组,如表 1:A1200x800 1200x650 1100x750 700x600B1500x850 1200x750 800x600I,II 型号玻璃分别以这两组的窗户的尺寸进行切割,例如 I 型号玻璃按照
2、A 组切割,可以切 3 块 1200x800,1 块 1200x650 和 1 块700x600;II 玻璃按照 A 组切割,可以切 3 块 1200x800,4 块1200x650 和 2 块 700x600 等等多种方案,这多种方案由表 2,3 表示:表 2模式尺寸1200x8001200x6501100x750700x600 余量1 4 6 0 0 0 0 0 0 141 1202 3 5 1 1 1 1 1 1 117 963 2 5 3 0 0 0 0 0 99 133.54 2 4 2 4 0 0 0 0 94.5 05 2 4 2 1 2 1 2 1 93 109.56 2 4
3、1 1 2 3 2 3 171 1087 2 4 0 0 2 4 2 4 358.5 61.58 1 3 5 5 0 0 0 0 39 189 1 3 4 4 0 2 0 2 34.5 1210 1 3 2 3 6 4 6 4 21 611 1 3 1 2 7 5 7 5 57 4212 1 3 0 0 8 0 8 0 93 193.513 0 2 5 0 1 0 1 0 93 256.514 0 2 3 0 4 12 4 12 40.5 015 0 1 3 7 6 0 6 0 39 5416 0 0 2 8 2 0 2 0 120 7217 0 0 2 4 4 0 4 0 118.5 136
4、.518 0 0 1 2 3 1 3 1 73.5 319 0 0 1 0 6 0 6 0 112.5 020 0 0 0 0 12 0 12 0 21 0表 3模式尺寸1500x850 1200x750 800x600 余量1 3 4 0 1 0 0 142.5 962 2 4 1 0 1 2 132 903 2 3 0 2 3 0 126 133.54 1 3 3 1 1 2 79.5 127.55 1 3 2 0 3 4 73.5 121.56 1 2 1 4 5 0 67.5 817 1 2 0 3 7 2 61.5 758 0 2 4 2 0 4 165 699 0 2 3 1 4
5、6 63 6310 0 2 0 0 9 8 93 5711 1 4 0 208.512 1 3 2 202.513 1 2 4 196.514 1 1 6 190.515 1 0 10 88.5对 A 组建立的模型为:决策变量 它们为非负整数;xiyj决策目标 分别以切割后剩余的余料量和切割原料玻璃的总块数为最小目标,由表 2,3 可以得到目标函数 Min M1=141x1+117x+99x3+94.5x4+93x5+171x6+358.5x7+39x8+34.5x9+21x10+57x11+93x12+93x13+40.5x14+39x15+120x16+118.5x17+73.5x18+1
6、12.5x19+21x20+120y1+96y2+133.5y3+109.5y5+108.y6+61.5y7+18y8+12y9+6y10+42y11+193.5y12+256.5y13+54y15+72y16+136.5y17+3y18 ;(1)Min M2= + ;(2)201iix1jjy约束条件:4x1+3x2+2x3+2x4+2x5+2x6+2x7+x8+x9+x10+x11+x12+6y1+5y2+5y3+4y4+4y5+4y6+4y7+3y8+3y9+3y10+3y11+3y12+2y13+2y14+y15 =540 (3)x2+3x3+2x4+2x5+x6+5x8+4x9+2x
7、10+x11+5x13+3x14+3x15+2x16+2x17+x18+x19+y2+4y4+y5+y6+5y8+4y9+3y10+2y11+7y15+8y16+4y17+2y18 =480 (4)x2+2x5+2x6+2x7+6x10+7x11+8x12+x13+4x14+6x15+2x16+4x17+3x18+6x19+12x20+y2+y5+3y6+4y7+2y9+4y10+5y11+12y14+y18 =480 (5)x2+2x5+2x6+2x7+6x10+7x11+8x12+x13+4x14+6x15+2x16+4x17+3x18+6x19+12x20+y2+y5+3y6+4y7+2
8、y9+4y10+5y11+12y14+y18 =600 (6) 模型求解:将(1) (3) (4) (5) (6)构成的整数线性规划模型输入 LINDO如下: min 141x1+117x2+99x3+94.5x4+93x5+171x6+358.5x7+39x8+34.5x9+21x10+57x11+93x12+93x13+40.5x14+39x15+120x16+118.5x17+73.5x18+112.5x19+21x20+120y1+96y2+133.5y3+109.5y5+108y6+61.5y7+18y8+12y9+6y10+42y11+193.5y12+256.5y13+54y15
9、+72y16+136.5y17+3y18st4x1+3x2+2x3+2x4+2x5+2x6+2x7+x8+x9+x10+x11+x12+6y1+5y2+5y3+4y4+4y5+4y6+4y7+3y8+3y9+3y10+3y11+3y12+2y13+2y14+y15 =540x2+3x3+2x4+2x5+x6+5x8+4x9+2x10+x11+5x13+3x14+3x15+2x16+2x17+x18+x19+y2+4y4+y5+y6+5y8+4y9+3y10+2y11+7y15+8y16+4y17+2y18 =480x2+2x5+2x6+2x7+6x10+7x11+8x12+x13+4x14+6
10、x15+2x16+4x17+3x18+6x19+12x20+y2+y5+3y6+4y7+2y9+4y10+5y11+12y14+y18 =480x2+2x5+2x6+2x7+6x10+7x11+8x12+x13+4x14+6x15+2x16+4x17+3x18+6x19+12x20+y2+y5+3y6+4y7+2y9+4y10+5y11+12y14+y18 =600end 求解可得到解如下:Global optimal solution found.Objective value: 0.000000Total solver iterations: 6Variable Value Reduced
11、 CostX1 0.000000 141.0000X2 0.000000 117.0000X3 0.000000 99.00000X4 0.000000 94.50000X5 0.000000 93.00000X6 0.000000 171.0000X7 0.000000 358.5000X8 0.000000 39.00000X9 0.000000 34.50000X10 0.000000 21.00000X11 0.000000 57.00000X12 0.000000 93.00000X13 0.000000 93.00000X14 0.000000 40.50000X15 0.0000
12、00 39.00000X16 0.000000 120.0000X17 0.000000 118.5000X18 0.000000 73.50000X19 0.000000 112.5000X20 0.000000 21.00000Y1 0.000000 120.0000Y2 0.000000 96.00000Y3 0.000000 133.5000Y5 0.000000 109.5000Y6 0.000000 108.0000Y7 0.000000 61.50000Y8 0.000000 18.00000Y9 0.000000 12.00000Y10 0.000000 6.000000Y11
13、 0.000000 42.00000Y12 0.000000 193.5000Y13 0.000000 256.5000Y15 0.000000 54.00000Y16 0.000000 72.00000Y17 0.000000 136.5000Y18 0.000000 3.000000Y4 120.0000 0.000000Y14 50.00000 0.000000Row Slack or Surplus Dual Price1 0.000000 -1.0000002 40.00000 0.0000003 0.000000 0.0000004 120.0000 0.0000005 0.000
14、000 0.000000即按照模式 4 切割 II 号玻璃 120 块和模式 14 切割 II 号玻璃 50 块使得余量最小; 为 0。将(1) (3) (4) (5) (6)构成的线性规划模型输入 LINDO 如下:min x1+x2+x3+x4+x+5x6+x7+x8+x9+x10+x11+x12+x13+x14+x15+x16+x17+x18+x19+x20+y1+y2+y3+y4+y5+y6+y7+y8+y9+y10+y11+y12+y13+y14+y15+y16+y17+y18+y19+y20st4x1+3x2+2x3+2x4+2x5+2x6+2x7+x8+x9+x10+x11+x1
15、2+6y1+5y2+5y3+4y4+4y5+4y6+4y7+3y8+3y9+3y10+3y11+3y12+2y13+2y14+y15 =540x2+3x3+2x4+2x5+x6+5x8+4x9+2x10+x11+5x13+3x14+3x15+2x16+2x17+x18+x19+y2+4y4+y5+y6+5y8+4y9+3y10+2y11+7y15+8y16+4y17+2y18 =480x2+2x5+2x6+2x7+6x10+7x11+8x12+x13+4x14+6x15+2x16+4x17+3x18+6x19+12x20+y2+y5+3y6+4y7+2y9+4y10+5y11+12y14+y1
16、8 =480x2+2x5+2x6+2x7+6x10+7x11+8x12+x13+4x14+6x15+2x16+4x17+3x18+6x19+12x20+y2+y5+3y6+4y7+2y9+4y10+5y11+12y14+y18 =600end求解可得到下结果:Global optimal solution found.Objective value: 165.0000Total solver iterations: 7Variable Value Reduced CostX1 0.000000 0.5000000X2 0.000000 0.4375000X3 0.000000 0.375000
17、0X4 0.000000 0.5000000X5 0.000000 0.3750000X6 0.000000 0.5000000X7 0.000000 0.6250000X8 0.000000 0.2500000X9 0.000000 0.3750000X10 0.000000 0.2500000X11 0.000000 0.3125000X12 0.000000 0.3750000X13 0.000000 0.3125000X14 0.000000 0.3750000X15 0.000000 0.2500000X16 0.000000 0.6250000X17 0.000000 0.5000
18、000X18 0.000000 0.6875000X19 0.000000 0.5000000X20 0.000000 0.2500000Y1 0.000000 0.2500000Y2 0.000000 0.1875000Y3 0.000000 0.3750000Y4 75.00000 0.000000Y5 0.000000 0.3125000Y6 0.000000 0.1875000Y7 0.000000 0.2500000Y8 0.000000 0.000000Y9 0.000000 0.000000Y10 60.00000 0.000000Y11 0.000000 0.6250000E-
19、01Y12 0.000000 0.6250000Y13 0.000000 0.7500000Y14 30.00000 0.000000Y15 0.000000 0.000000Y16 0.000000 0.000000Y17 0.000000 0.5000000Y18 0.000000 0.6875000Y19 0.000000 1.000000Y20 0.000000 1.000000Row Slack or Surplus Dual Price1 165.0000 -1.0000002 0.000000 -0.12500003 0.000000 -0.12500004 120.0000 0
20、.0000005 0.000000 -0.6250000E-01即按照模式 4 购买 II 号玻璃 75 块,按照模式 10 购买 II 号玻璃 60块和按照模式 14 购买 II 号玻璃 35 块使得总的购买量最小;为 165块。对 B 组建立的模型为:决策变量 它们为非负整数;xiyj决策目标 分别以切割后剩余的余料量和切割原料玻璃的总块数为最小目标,由表 2,3 可以得到目标函数 Min N1=142.5x1+132x2+126x3+79.5x4+73.5x5+67.5X6+61.5x7+165x8+63x9+93x10+96y1+90y2+133.5y3+127.5y4+121.5y5
21、+81y6+75y7+69y8+63y9+57y10+208.5y11+202.5y12+196.5y13+190.5y14+88.5y15 (1)Min N2= + (2)10iix51jjy约束条件为:3x1+2x2+2x3+x4+x5+x6+x7+4y1+4y2+3y3+3y4+3y5+2y6+2y7+2y8+2y9+2y10+y11+y12+y13+y14+y15 =600(3)x2+3x4+2x5+x6+4x8+3x9+y1+2y3+y4+4y6+3y7+2y8+y9+4y11+3y12+2y13+y14=960 (4)x2+3x3+x4+3x5+5x6+7x7+4x9+9x10+2
22、y2+2y4+4y5+2y7+4y8 +6y9+8y10+2y12+4y13+6y14+10y15=1320(5)模型求解:将(1) (3) (4) (5)构成的整数线性规划模型输入 LINDO如下:Min 142.5x1+132x2+126x3+79.5x4+73.5x5+67.5X6+61.5x7+165x8+63x9+93x10+96y1+90y2+133.5y3+127.5y4+121.5y5+81y6+75y7+69y8+63y9+57y10+208.5y11+202.5y12+196.5y13+190.5y14+88.5y15st3x1+2x2+2x3+x4+x5+x6+x7+4y
23、1+4y2+3y3+3y4+3y5+2y6+2y7+2y8+2y9+2y10+y11+y12+y13+y14+y15 =600x2+3x4+2x5+x6+4x8+3x9+y1+2y3+y4+4y6+3y7+2y8+y9+4y11+3y12+2y13+y14=960x2+3x3+x4+3x5+5x6+7x7+4x9+9x10+2y2+2y4+4y5+2y7+4y8 +6y9+8y10+2y12+4y13+6y14+10y15=1320end可以求得解入下:Global optimal solution found.Objective value: 26640.00Extended solver
24、steps: 0Total solver iterations: 6Variable Value Reduced CostX1 0.000000 57.00000X2 0.000000 69.00000X3 0.000000 69.00000X4 0.000000 33.00000X5 0.000000 33.00000X6 0.000000 33.00000X7 0.000000 33.00000X8 0.000000 141.0000X9 84.00000 45.00000X10 0.000000 93.00000Y1 0.000000 -24.00000Y2 0.000000 -24.0
25、0000Y3 0.000000 36.00000Y4 0.000000 36.00000Y5 0.000000 36.00000Y6 0.000000 0.000000Y7 204.0000 0.000000Y8 0.000000 0.000000Y9 96.00000 0.000000Y10 0.000000 0.000000Y11 0.000000 156.0000Y12 0.000000 156.0000Y13 0.000000 156.0000Y14 0.000000 156.0000Y15 0.000000 60.00000Row Slack or Surplus Dual Pric
26、e1 26640.00 -1.0000002 0.000000 -28.500003 0.000000 -6.0000004 0.000000 0.000000即按照模式 9 分别切割 I 号玻璃 84 块和 II 号玻璃 96 块,按照模式7 切割 II 号玻璃 204 块使得总的剩余量最小,为 26640.00。将(2) (3) (4) (5)构成的整数线性规划模型输入 LINDO如下:Min x1+x2+x3+x4+x5+x6+x7+x8+x9+x10+y1+y2+y3+y4+y5+y6+y7+y8+y9+y10+y11+y12+y13+y14+y15st4x1+3x2+2x3+2x4+
27、2x5+2x6+2x7+x8+x9+x10+x11+x12+6y1+5y2+5y3+4y4+4y5+4y6+4y7+3y8+3y9+3y10+3y11+3y12+2y13+2y14+y15 =540x2+3x3+2x4+2x5+x6+5x8+4x9+2x10+x11+5x13+3x14+3x15+2x16+2x17+x18+x19+y2+4y4+y5+y6+5y8+4y9+3y10+2y11+7y15+8y16+4y17+2y18 =480x2+2x5+2x6+2x7+6x10+7x11+8x12+x13+4x14+6x15+2x16+4x17+3x18+6x19+12x20+y2+y5+3y
28、6+4y7+2y9+4y10+5y11+12y14+y18 =480x2+2x5+2x6+2x7+6x10+7x11+8x12+x13+4x14+6x15+2x16+4x17+3x18+6x19+12x20+y2+y5+3y6+4y7+2y9+4y10+5y11+12y14+y18 =600end 求得结果为:Global optimal solution found.Objective value: 371.1000Extended solver steps: 0Total solver iterations: 14Variable Value Reduced CostX1 0.000000
29、 1.000000X2 0.000000 0.6500000X3 0.000000 0.7000000X4 0.000000 0.1500000X5 0.000000 0.2000000X6 0.000000 0.2500000X7 0.000000 0.3000000X8 0.000000 0.000000X9 6.000000 -0.1500000X10 0.000000 0.1000000Y1 0.000000 0.7500000Y2 0.000000 0.8000000Y3 0.000000 0.5000000Y4 0.000000 0.5500000Y5 0.000000 0.600
30、0000Y6 235.5000 0.000000Y7 0.000000 0.5000000E-01Y8 0.000000 0.1000000Y9 0.000000 0.1500000Y10 0.000000 0.2000000Y11 0.000000 0.000000Y12 0.000000 0.5000000E-01Y13 0.000000 0.1000000Y14 0.000000 0.1500000Y15 129.6000 0.000000Row Slack or Surplus Dual Price1 371.1000 -1.0000002 0.6000000 0.0000003 0.000000 -0.25000004 0.000000 -0.1000000即按照模式9购买6块I号玻璃,按照6模式购买II号236块玻璃和按照模式15购买130块II号玻璃使得购买量最小,为372块。综合 A 组和 B 组考虑:购买 I 号玻璃 6 块,II 号玻璃块 526 块使得总的购买量最小,为 572块。按照模式 9 切割 84 块 I 号玻璃,14 模式切割 50 块 II 号玻璃,9 模式切割 96 块 II 号玻璃,7 模式切割 204 块 II 号玻璃使得浪费最小,最少余量为 26660.00。