matlab调用yalmip+gurobi时出现警告,为啥求解不出来
后附代码
ais数据
clear
clc
案例参数
sNum = 10; %候选点数量
iNum = 12; %道路数量
ais = xlsread('take nio.xlsx', 4); %覆盖矩阵ais
%Ys = 4;
决策变量
Ys = binvar(sNum, 1, 'full'); % s是否被选为救援点,0-1型变量
%Zi = sum(Ys(sNum)*ais(iNum));
Zi=sdpvar(iNum,1,'full');
%(0<=Zi)&&(Zi<=1);
目标函数
Z =max(sum(Zi)); %目标函数:最大覆盖率
求解目标
Totalobj = Z;
约束条件
%sum(Ys(1:end, sNum)) =4;
Constraint=[];
for s = 1:sNum
Constraint = [Constraint;sum( Ys) ==4];%约束条件:建设数量约束
end
for i = 1:iNum
for s = 1:sNum
Constraint = [Constraint;Zi ==7 sum(Ys*ais(iNum))];%约束条件:管道覆盖约束
end
end