networkx 2.8.2 Pypi GitHub Homepage
Other Docs
NotesParametersRaisesReturnsBackRef
gaussian_random_partition_graph(n, s, v, p_in, p_out, directed=False, seed=None)

A Gaussian random partition graph is created by creating k partitions each with a size drawn from a normal distribution with mean s and variance s/v. Nodes are connected within clusters with probability p_in and between clusters with probability p_out[1]

Notes

Note the number of partitions is dependent on s,v and n, and that the last partition may be considerably smaller, as it is sized to simply fill out the nodes [1]

Parameters

n : int

Number of nodes in the graph

s : float

Mean cluster size

v : float

Shape parameter. The variance of cluster size distribution is s/v.

p_in : float

Probabilty of intra cluster connection.

p_out : float

Probability of inter cluster connection.

directed : boolean, optional default=False

Whether to create a directed graph or not

seed : integer, random_state, or None (default)

Indicator of random number generation state. See Randomness<randomness> .

Raises

NetworkXError

If s is > n If p_in or p_out is not in [0,1]

Returns

G : NetworkX Graph or DiGraph

gaussian random partition graph

Generate a Gaussian random partition graph.

See Also

random_partition_graph

Examples

>>> G = nx.gaussian_random_partition_graph(100, 10, 10, 0.25, 0.1)
... len(G) 100
See :

Back References

The following pages refer to to this document either explicitly or contain code examples using this.

networkx.generators.community.stochastic_block_model networkx.generators.community.gaussian_random_partition_graph

Local connectivity graph

Hover to see nodes names; edges to Self not shown, Caped at 50 nodes.

Using a canvas is more power efficient and can get hundred of nodes ; but does not allow hyperlinks; , arrows or text (beyond on hover)

SVG is more flexible but power hungry; and does not scale well to 50 + nodes.

All aboves nodes referred to, (or are referred from) current nodes; Edges from Self to other have been omitted (or all nodes would be connected to the central node "self" which is not useful). Nodes are colored by the library they belong to, and scaled with the number of references pointing them


GitHub : /networkx/generators/community.py#305
type: <class 'function'>
Commit: