% make a random graph and look for largest
% component
% make a random graph
tic
figure; hold on; grid on;
n=100;
iter=100;
prob = (1/n)*[0:.2:4];
L=length(prob);
comp=zeros(1,L);
for s=1:L
p=prob(s);
for t=1:iter
G=make_rand_graph2(n,p);
[count,sizes]=find_comps_nopics(G);
comp(s)=comp(s)+max(sizes);
end % for t
comp(s)=comp(s)/iter;
end % for s

figure; hold on; grid on;
plot(n*prob,comp);
title(['Growth of the giant component in a random graph, n=',num2str(n)]);
xlabel('average vertex degree = p n')
ylabel('component size as fraction of n')
drawnow;
toc