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

gnm_random_graph(n, m, create_using=None, seed=None)

Return the random graph G_{n,m}.

Gives 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.

create_using : graph, optional (default Graph)

Use specified graph as a container.

seed : int, optional

Seed for random number generator (default=None).