NetworkX

Previous topic

networkx.generators.ego.ego_graph

Next topic

networkx.generators.intersection.uniform_random_intersection_graph

networkx.generators.stochastic.stochastic_graph

networkx.generators.stochastic.stochastic_graph(G, copy=True)

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