NetworkX

Previous topic

networkx.generators.random_graphs.dense_gnm_random_graph

Next topic

networkx.generators.random_graphs.erdos_renyi_graph

networkx.generators.random_graphs.gnm_random_graph

networkx.generators.random_graphs.gnm_random_graph(n, m, seed=None, directed=False)

Return the random graph G_{n,m}.

Produces a graph picked randomly out of the set of all graphs with n nodes and m edges.

Parameters :

n : int

The number of nodes.

m : int

The number of edges.

seed : int, optional

Seed for random number generator (default=None).

directed : bool, optional (default=False)

If True return a directed graph