资源描述:
《运筹学实验报告4(运输问题的编程求解)》由会员上传分享,免费在线阅读,更多相关内容在教育资源-天天文库。
1、运筹学实验报告实验课程:运筹学实验日期:6月9日任课教师:杨小康班级:信息与计算科学姓名:刘静学号0202110123一、实验名称:线性规划模型的编程求解(2)二、实验目的:1.掌握Lingo软件中变量定界函数,集合循环函数和@IF(条件,true结果,false结果)2.熟悉运输问题的数学模型,掌握简单运输问题数学模型的Lingo软件编程求解的方法,掌握解报告的内容3.掌握整数规划、0-1规划和指派问题的计算机求解方法。三、实验要求:1.给出所求解问题的数学模型;2.给出Lingo中的编程程序;3.能给
2、出最优解和最优值;四、报告正文(文挡,数据,模型,程序,图形):1.利用lingo软件求解下面运输问题的最优解。单位销地运价产地B1B2B3B4产量A13113107A219284A3741059销量3656 程序:model:sets:AH/A1..A3/:A;BD/B1..B4/:B;link(AH,BD):C,X;endsetsdata:A=7,4,9;B=3,6,5,6;C=311310192874105;enddatamin=@sum(link:c*x);@for(AH(i):@sum(BD(j
3、):x(i,j))<=A(i));@for(BD(j):@sum(AH(i):x(i,j))=B(j));@for(link:@gin(x));end结果:z=85;Globaloptimalsolutionfound.Objectivevalue:85.00000Objectivebound:85.00000Infeasibilities:0.000000Extendedsolversteps:0Totalsolveriterations:0VariableValueReducedCostA(A1)7.
4、0000000.000000A(A2)4.0000000.000000A(A3)9.0000000.000000B(B1)3.0000000.000000B(B2)6.0000000.000000B(B3)5.0000000.000000B(B4)6.0000000.000000C(A1,B1)3.0000000.000000C(A1,B2)11.000000.000000C(A1,B3)3.0000000.000000C(A1,B4)10.000000.000000C(A2,B1)1.0000000.0
5、00000C(A2,B2)9.0000000.000000C(A2,B3)2.0000000.000000C(A2,B4)8.0000000.000000C(A3,B1)7.0000000.000000C(A3,B2)4.0000000.000000C(A3,B3)10.000000.000000C(A3,B4)5.0000000.000000X(A1,B1)0.0000003.000000X(A1,B2)0.00000011.00000X(A1,B3)5.0000003.000000X(A1,B4)2.
6、00000010.00000X(A2,B1)3.0000001.000000X(A2,B2)0.0000009.000000X(A2,B3)0.0000002.000000X(A2,B4)1.0000008.000000X(A3,B1)0.0000007.000000X(A3,B2)6.0000004.000000X(A3,B3)0.00000010.00000X(A3,B4)3.0000005.000000RowSlackorSurplusDualPrice185.00000-1.00000020.00
7、00000.00000030.0000000.00000040.0000000.00000050.0000000.00000060.0000000.00000070.0000000.00000080.0000000.0000002.求解下面混合整数规划minz=-3x1+4x2-2x3+5x4;4x1-x2+2x3-x4=-2;x1+x2+3x3-x4≤14;-2x1+3x2-x3+2x4≥2;x1为整数,x2=0或1,x3≥0,x4无约束;程序:model:sets:location1/1..4/:A,
8、x;location2/1..3/:B;link(location2,location1):C;endsetsdata:A=-3,4,-2,5;B=-2,14,2;C=4,-1,2,-11,1,3,-1-2,3,-1,2;enddatamin=@sum(location1:A*x);@sum(location1(j):C(1,j)*x(j))=-2;@sum(location1(j):C(2,j)*x(j))<=14;@sum