Hello!
The below code is simple semidefinite programming which approximates the max-cut problem. However, my output matrix X does not seem to satisfy the semidefinite constraint and has a minimum eigenvalue -1, while the constraint is satisfied until n = 999. I would be grateful if someone let me know the problem here. Thanks!
n = 1000;
A = randn(n, n);
A = A + A’;
A = A - diag(diag(A));
one = ones(n, 1);cvx_begin sdp
variable X(n,n) symmetric
maximize(sum(dot(X, A)))
subject to
diag(X) == one
X >= 0
cvx_endfprintf(‘mineigval: %f\n’,min(eig(X)))