필터 지우기
필터 지우기

mixed binary interger linear programming

조회 수: 6 (최근 30일)
Busra Keles
Busra Keles 2015년 1월 16일
답변: Johan Löfberg 2015년 2월 4일
I am trying to solve a mixed integer linear programming. It seems like it solves, but it does not. I don't receive any result although there is no coding error. Could someone please look at it?
By the way, I am using YALMIP. Thanks.
m = 5; %number of orders
r = [4 5 1 3 2]; %received time
mu = 0.1; % percent of work
d = 60;
t = ones(1,d);
x = binvar(d,m);
y = sdpvar(d,m);
w = sdpvar(d,m);
f = sdpvar(1,m);
Constraints = [sum(x(1:r(1),1))== 0;...
sum(x(1:r(2),2)) == 0;
sum(x(1:r(3),3)) == 0;
sum(x(1:r(4),4)) == 0;
sum(x(1:r(5),5)) == 0;
%%%%%%%%%%%%%%%%%%%%%%%
sum(x(r(1):d,1))== 1;
sum(x(r(2):d,2)) == 1;
sum(x(r(3):d,3)) == 1;
sum(x(r(4):d,4)) == 1;
sum(x(r(5):d,5)) == 1;
%%%%%%%%%%%%%%%%%%%%%%%
f - t * x == 0;
%%%%%%%%%%%%%%%%%%%%%%%
sum(y(1:r(1)-1,1)) == 0;
sum(y(1:r(2)-1,2)) == 0;
sum(y(1:r(3)-1,3)) == 0;
sum(y(1:r(4)-1,4)) == 0;
sum(y(1:r(5)-1,5)) == 0;
%%%%%%%%%%%%%%%%%%%%%%%%
sum(y) <= 1;
%%%%%%%%%%%%%%%%%%%%%%%
sum(w) - sum(y)*mu == 0;
%%%%%%%%%%%%%%%%%%%%%%%%
x >= 0;
w >= 0;
y >= 0;
f >= 0
];
Objective = sum (f-r);
options = sdpsettings;
options.cplex = [];
optimize(Constraints,Objective,options);

답변 (1개)

Johan Löfberg
Johan Löfberg 2015년 2월 4일
Why are you empying the options structure?
Anyway, works fine here
optimize(Constraints,Objective)
...
Total (root+branch&cut) = 0.00 sec. (0.70 ticks)
ans =
yalmiptime: 0.3604
solvertime: 0.0116
info: 'Successfully solved (CPLEX-IBM)'
problem: 0
Note though, you should post YALMIP specific questions on the YALMIP Google group forum

카테고리

Help CenterFile Exchange에서 Ordinary Differential Equations에 대해 자세히 알아보기

태그

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by