% make a random graph by choosing 
% a total of p*n*(n-1)/2 edges at 
% random. This is slighly different 
% than make_rand_graph. This script 
% chooses a definite number of edges.
% The number of edges in the other is 
% random and may be different on 
% different runs

function  G=make_rand_graph2(n,E)
         G=sparse(n,n);
         counter=0;
         while counter < E
         %for k=1:p*n*(n-1)/2
            a=randi(n);
            b=randi(n);
            if (a~=b)&(G(a,b)==0)
               G(a,b)=1;
               G(b,a)=1;
               counter=counter+1;
            end % if
         end % while
return 

