function  G=make_rand_graph2(n,p)
         G=sparse(n,n);
         counter=0;
          while counter < p*n*(n-1)/2
         %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 

