aryagraph.generators.random.powerlaw_cluster#
- aryagraph.generators.random.powerlaw_cluster(n: int, m: int, p: float, *, seed: int | Generator | None = None) Graph[source]#
Holme–Kim model: preferential attachment plus triad formation.
Like
barabasi_albert(), but after each preferential link the new node closes a triangle with probability p (links to a random neighbor of the node it just attached to). Starts frommisolated nodes, as networkx does. Each new node gets exactlymedges, so there arem·(n - m)edges (networkx occasionally adds fewer, when a triangle step picks a node it later draws again). Requires1 <= m < nand0 <= p <= 1.