实验四:整数规划
一、实验目的:整数规划问题建模及软件求解。
二、实验要求:
、0-1整数规划问题、指派问题的建模;
:分支定界法、割平面法、隐枚举法、匈牙利法;
、 lingo软件求解整数规划问题。
三、实验内容:
1、求解下列整数规划问题:
给出lingo原始代码;(2)求解结果粘贴。
(1)
model:
max=x1+x2;
2*x1+5*x2<=16;
6*x1+5*x2<=30;
***@gin(x1);***@gin(x2);
end
(2)
Global optimal solution found.
Objective value:
Objective bound:
Infeasibilities:
Extended solver steps: 0
Total solver iterations: 0
Variable Value Reduced Cost
X1 -
X2 -
Row Slack or Surplus Dual Price
1
2
3
2、求解下列0-1整数规划问题:
给出matlab、lingo原始代码;(2)求解结果粘贴。
(1)Lingo
model:
max=2*x1-x2+5*x3-3*x4+4*x5;
3*x1-2*x2+7*x3-5*x4-4*x5<=6;
x1-x2+2*x3-4*x4+2*x5<=0;
***@bin(x1);***@bin(x2);***@bin(x3);***@bin(x4);***@bin(x5);
!sets: A/1..5/x @(for(A:***@bin(x)));
end
(2)
Global optimal solution found.
Objective value:
Objective bound:
Infeasibilities:
Extended solver steps: 0
Total solver iterations: 0
Variable Value Reduced Cost
X1 -
X2
X3 -
X4
X5 -
Row Slack or Surplus Dual Price
1
2
3
matlab
f=[-2 1 -5 3 -4];
A=[3 -2 7 -5 -4;1 -2 2 -4 2];
b=[6 0];
[x,z]=bintprog(f,A,b)
z=-z
(2)
实验四:整数规划 来自淘豆网m.daumloan.com转载请标明出处.