gnm_random_graph¶
- gnm_random_graph(n, m, seed=None, directed=False)[source]¶
Returns a
random graph.In the
model, a graph is chosen uniformly at random from the set of all graphs with nodes and edges.This algorithm should be faster than
dense_gnm_random_graph()
for sparse graphs.- Parameters
- nint
The number of nodes.
- mint
The number of edges.
- seedinteger, random_state, or None (default)
Indicator of random number generation state. See Randomness.
- directedbool, optional (default=False)
If True return a directed graph
See also