NetworkX

Previous topic

dense_gnm_random_graph

Next topic

erdos_renyi_graph

gnm_random_graph

gnm_random_graph(n, m, seed=None, directed=False)[source]

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