Hi Johan;
I've just started to use YALMIP and want to formulate and solve a SDP relaxation of the MAXCUT problem. The problem can be expressed as
Max < Cn*n , Xn*n>
subject to:
diag(X) = 1n*1
X is symmetric positive semi-definite
in which C is the (weighted) adjacency matrix of a graph and <p,q> denotes the standard inner product; that means the objective function is really trace (C' X).
For this, I write the following code in matlab (with SDPT3) but I don't know whether it's the correct way to do it or not.
Enter code here...
X=sdpvar(n,n);
F = set (X >= 0);
for i = 1:n
F = F + set (X(i,i) == 1);
end
obj= trace(C' * X);
ops=sdpsettings ('solver','sdpt3');
solvesdp(F , -obj , ops);
Appreciate if you let me know about the correctness of the above code.
Isaac