clear all

fid = fopen('outputVs.txt','w');

fid2 = fopen('outputb4Vs.txt','w');
fclose(fid2);

n = 600;
m_orig = [200;200;200];
p = 0; % no noise edge

[L,edgenumber] = graph_gen(m_orig,p);
A = diag(diag(L)) - L; % adjacency matrix
totaledge = sum(sum(A))/2;

for ii = 180:20:220
  for jj = 180:20:220
    m = [ii;jj;n-ii-jj];
    
    [Lbnd,Abndeq,~,~,upperL,upperA,e1,e2] = myprojeigbd(L,m);
    [qpbd,~,upperQ,fval,q1,q2] = myqpbd(L,m);
    [optvalt3A,~,upperSDP,s1,s2,s0] = mysdpbd(L,m);
    
    upperL2 = floor(upperL); upperA2 = floor(upperA); upperQ2 = floor(upperQ); upperSDP2 = floor(upperSDP);
    Lbnd2 = ceil(Lbnd); Abndeq2 = ceil(Abndeq); qpbd2 = ceil(qpbd); optvalt3A2 = ceil(optvalt3A(2));

    fid = fopen('outputVs.txt','a');
    fprintf(fid,' %d & %d & %4.0f & %4.0f & %4.0f & %4.0f & %4.0f & %4.0f & %4.0f & %4.0f\n', ii,jj,Lbnd2,Abndeq2,qpbd2,optvalt3A2,upperL2,upperA2,upperQ2,upperSDP2)
    fclose(fid);
    
    fid2 = fopen('outputb4Vs.txt','a');
    fprintf(fid2,' %d & %d & %2.1e & %2.1e & %2.1e & %2.1e & %2.1e & %2.1e & %2.1e & %2.1e\n', ii,jj,Lbnd,Abndeq,qpbd,optvalt3A(2),upperL,upperA,upperQ,upperSDP)
    fclose(fid2);

  end
end