NetworkX

Previous topic

networkx.ego_graph

Next topic

networkx.convert_node_labels_to_integers

networkx.stochastic_graph

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