aryagraph.generators.random.barabasi_albert#

aryagraph.generators.random.barabasi_albert(n: int, m: int, *, seed: int | Generator | None = None) → Graph[source]#

Barabási–Albert preferential attachment.

Starts from star_graph(m) (m + 1 nodes, as networkx does); each new node links to m distinct existing nodes chosen with probability proportional to their degree. The result has n nodes and exactly m·(n - m) edges. Requires 1 <= m < n.