I’m trying to create a scale-free network growing model in networkx in Python. Plenty of resources exist on Github for the Barabassi-Albert Model, but my graph needs to be directed and BA is designed only for undirected graphs.
I understand that the Price Model is effectively the directed equivalent of the BA Model, but I can’t find any online resources for how to implement that in Python (preferably nx). Could anyone point me in the right direction?
I’ve tried to tweak the BA model to account for outbound degrees, but implementation hasn’t worked so far:
deg = G.out_degree(n) ## number of outbound edges from this node
print('out degree',deg)
deg_weight = deg / (2 * len(G.edges()))
print('degree weighting:',deg_weight)
edge_weight = edges_per_node[pre_node_type] ## weighting by observed connectivity
adjusted_prob = prob * deg_weight * edge_weight
n_probs.append(adjusted_prob)
nodes.append(n)
TomT is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.