Originally posted by: IoanNemp
I checked both examples, but I can not see how they are relevant. It seems the program ignores my command:
try
cplex = Cplex();
cplex.Param.lpmethod.Cur=3;
cplex.Param.timelimit.Cur = 20;
H1 = GUless'*GUless;
H1 = round(H1,10);
smallest0 = eigs(H1,1,'sm');
if smallest0 <0
H1 = H1+abs(round(smallest0,10)+10^(-10))*speye(length(H1));
end
H2 = GVless'*GVless;
H2 = round(H2,10);
smallest0 = eigs(H2,1,'sm');
if smallest0 <0
H2 = H2+abs(round(smallest0,10)+10^(-10))*speye(length(H2));
end
H3 = GWless'*GWless;
H3 = round(H3,10);
smallest0 = eigs(H3,1,'sm');
if smallest0 <0
H3 = H3+abs(round(smallest0,10)+10^(-10))*speye(length(H3));
end
H = blkdiag(H1,H2,H3);
f1 = GUless'*rhs(:,1);
f2 = GVless'*rhs(:,2);
f3 = GWless'*rhs(:,3);
f = [f1;f2;f3];
ctype1=[];
ctype2=[];
ctype3=[];
for i=1:Uteams
ctype1 = strcat(ctype1,'I');
end
for i=1:Vteams
ctype2 = strcat(ctype2,'I');
end
for i=1:Wteams
ctype3 = strcat(ctype3,'I');
end
for i=1:length(nonUpoints)-1
ctype1 = strcat(ctype1,'C');
end
for i=1:length(nonVpoints)-1
ctype2 = strcat(ctype2,'C');
end
for i=1:length(nonWpoints)-1
ctype3 = strcat(ctype3,'C');
end
ctype = [ctype1,ctype2,ctype3];
lenVarX = Uteams+length(nonUpoints);
lenVarY = Vteams+length(nonVpoints);
lenVarW = Wteams+length(nonWpoints);
options = cplexoptimset;
options.Display = 'on';
H=(H+H')/2; %unnecessary?
[solx, fval, exitflag, output] = cplexmiqp (H, f, [], [], [], [],...
[], [], [], [], [], ctype, [], options);
fprintf ('\nSolution status = %s \n', output.cplexstatusstring);
%fprintf ('Solution value = %f \n', fval);
%disp ('Values =');
%disp (solx');
catch m
disp(m.message);
return
end
Check lines 3,4. Could you explain why my usage of timelimit is incorrect? Thank you in advance.
#CPLEXOptimizers#DecisionOptimization