Question: The dendrogram is formulated as a directed graph. Each leaf node ( node with no outgoing edges ) in the dendrogram represents a node in

The dendrogram is formulated as a directed graph. Each leaf node (node with no outgoing edges) in the dendrogram represents a node in the empirical network. Each non-leaf node stores the information about its left/right child (L/R) and the probability of leaf nodes in the left tree connecting to the leaf nodes in the right tree (p), as node attributes
def calculate_edge_probability(dendrogram: nx.DiGraph)-> Dict[str, Dict[str, float]]:
"""
Inputs:
dendrogram: NetworkX graph object
Returns:
a dictionary of edge probabilities between all pairs of leaf nodes.
"""
return edge_probs
def generate_graph_from_prob(edge_probs: Dict[str, Dict[str, float]])-> nx.Graph:
"""
Inputs:
edge_probs: a dictionary of edge probabilities between all pairs of leaf nodes.
Returns:
H: NetworkX graph object
"""
return H
def generate_hrg_graphs(edge_probs: Dict[str, Dict[str, float]], n_graphs: int=100)-> List[nx.Graph]:
"""
Inputs:
edge_probs: a dictionary of edge probabilities between all pairs of leaf nodes.
n_graphs: int
Returns:
a list of NetworkX graph object
"""
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!