mixed binary interger linear programming
Afficher commentaires plus anciens
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);
Réponses (1)
Johan Löfberg
le 4 Fév 2015
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
Catégories
En savoir plus sur Deep Learning Toolbox dans Centre d'aide et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!