Dear all,
I am trying to solve a simple QP that involves only pairwise products of some vector of variables x that take values in {-1,1}.
Every pairwise product has a weight attached, and i want to optimize the sum of the weight*(pairwise products) using CPLEX.
The following implementation in YALMIP is used:
n=10;
%Define integer variables
x=intvar(n+1,1,'full');
%Define Matrix of pairwise products of x
y=x*x';
%Diagonal elements equal to one, to ensure the variables x in {-1,1}
constraints=[diag(y)==ones(n+1,1)];
%cMat is a symmetric matrix with a scalar for each pairwise product
objective = sum(sum(cMat.*y));
%Use Cplex
opts=sdpsettings;
opts.solver='cplex';
info = optimize(constraints,-objective,opts);
However, when running, i get the following warning:
'Warning: Solver not applicable (cplex)'
This is strange, since my constraints are linear equalities (involving pairwise products), and my objective is a linear function of these pairwise products.
Could anyone shed some light on this problem?
Attached you find a sample 'cMat' in .mat format .
Thanks a lot in advance!
All best,
Bart