Question: Modify the genrate _ configs _ graphs and genrate _ sbm _ graphs functions to produce 1 0 0 graphs using NetworkX's Configs Model and

Modify the genrate_configs_graphs and genrate_sbm_graphs functions to produce 100 graphs using NetworkX's Configs Model and Stochastic Block Model graph generators. When using the configs_model function, specify create_using=nx.Graph() to obtain a Graph instead of a MultiGraph.
In this task, you'll be dealing with Hierarchical Random Graphs. A dendrogram, derived from the empirical network, is available in "football-hrg.gml" created using PyHRG. The dendrogram is represented as a directed graph. Each leaf node (a node with no outgoing edges) in the dendrogram corresponds to a node in the empirical network. Non-leaf nodes contain information about their left/right children ("L"/"R") and the probability (denoted by "p") of leaf nodes in the left subtree connecting to leaf nodes in the right subtree, stored as node attributes.
def genrate_configs_graphs(dgree_sequence: List[int], n_graphs: int=100)-> List[nx.Graph]:
"""
Inputs:
dgree_sequence: List[int]
n_graphs: int
Returns:
a list of graph
"""
return graphs
def genrate_sbm_graphs(p: np.ndarray, sizes: List[int], n_graphs: int=100)-> List[nx.Graph]:
"""
Inputs:
p: np.ndarray, element (r,s) gives the density of edges going from the nodes of group r to nodes of group s.
dgree_sequence: List[int]
n_graphs: int
Returns:
a list of graph
"""
return graphs

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Programming Questions!