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 digraph in which all of the node (out) neighbors edge weights sum to 1.

Parameters :

G : graph

A NetworkX graph

copy : boolean, optional

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

weight : edge attribute key (optional, default=’weight’)

Edge data key used for weight. If no attribute is found for an edge the edge weight is set to 1.