NetworkX

Previous topic

ego_graph

Next topic

uniform_random_intersection_graph

stochastic_graph

stochastic_graph(G, copy=True, weight='weight')[source]

Return a right-stochastic representation of G.

A right-stochastic graph is a weighted graph in which all of the node (out) neighbors edge weights sum to 1.

Parameters :

G : graph

A NetworkX graph, must have valid edge weights

copy : boolean, optional

If True make a copy of the graph, otherwise modify original graph

weight : key (optional)

Edge data key used for weight. If None all weights are set to 1.