Skip to content

Instantly share code, notes, and snippets.

# Parameters for our Synthetic Network
num_of_nodes = 100 # Total number of nodes (which are, in our case, people)
edges_per_node = 4 # Amount of relations a given person(node) will have by default
prob_of_triangle = 0.1 # Chance of a triangle happening given a relation
# Defining The Network
G = nx.powerlaw_cluster_graph(num_of_nodes, edges_per_node, prob_of_triangle)