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 nonleaf node stores the information about its leftright child LR and the probability of leaf nodes in the left tree connecting to the leaf nodes in the right tree p as node attributes
def calculateedgeprobabilitydendrogram: nxDiGraph Dictstr Dictstr float:
Inputs:
dendrogram: NetworkX graph object
Returns:
a dictionary of edge probabilities between all pairs of leaf nodes.
return edgeprobs
def generategraphfromprobedgeprobs: Dictstr Dictstr float nxGraph:
Inputs:
edgeprobs: a dictionary of edge probabilities between all pairs of leaf nodes.
Returns:
H: NetworkX graph object
return H
def generatehrggraphsedgeprobs: Dictstr Dictstr float ngraphs: int ListnxGraph:
Inputs:
edgeprobs: a dictionary of edge probabilities between all pairs of leaf nodes.
ngraphs: 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
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
