n=20;density=.9;
%L=abs(sprandsym(n,density));
L=randn(n);L=L+L';
L(1:n+1:end)=zeros(n,1);
[phi, X, y] = maxcut(L);
[V,D]=eig(X);
format long
egs=diag(D)
format short
X=4*X;
v=V(:,end);
v=sign(v);
disp(['solution vector v is: '])
num2str([v])
disp(['obj. values with X,v: ',num2str([trace(L*X) v'*L*v])])
