lundi 13 septembre 2021

How Do I create 1000 fast random graphs using networkx

Create A graph using fast_gnp_random_graph, then for each graph calculate transitivity. Number of graphs created should equal 1000. Not understanding where the randomness comes in.

tran = []
n = 100 #Nodes
m = 500 #Expected Edges
p = m/(n*(n-1)/2)

GG=nx.fast_gnp_random_graph(n,p)
for i in range(1000):
    tran.append(nx.transitivity(GG))



Aucun commentaire:

Enregistrer un commentaire