In [2]:
%pylab inline
In [6]:
import networkx as nx
import pandas as pd
import seaborn as sns
import scipy as sp
import scipy.stats as sps
In [7]:
sns.set_style('white')
sns.set_context('notebook')
In [8]:
G = nx.random_graphs.erdos_renyi_graph(100, .1)
In [43]:
def random_graph_maxc(N=100):
P = np.arange(0,1,.001)
graphs = [nx.random_graphs.erdos_renyi_graph(N, p) for p in P]
c_max = [float(len(next(nx.connected_components(g)))) for g in graphs]
return pd.Series(c_max, index=P*N)
In [45]:
maxc_df = pd.DataFrame([random_graph_maxc() for _ in xrange(10)])
In [51]:
maxc_df.median().plot(logx=True, logy=True)
Out[51]:
In [ ]:
In [ ]:
In [ ]:
In [ ]: