% makes a random graph by connecting
% two vertices with probability p

function G=make_rand_graph(n,p)
G=sparse(n,n);
for k=1:n-1
for j=k+1:n
if rand < p
G(j,k)=1;
G(k,j)=1;
end % if
end % for j
end % for k
return