NetworkX

Previous topic

networkx.random_regular_graph

Next topic

networkx.powerlaw_cluster_graph

Quick search

networkx.barabasi_albert_graph

barabasi_albert_graph(n, m, seed=None)

Return random graph using Barabási-Albert preferential attachment model.

A graph of n nodes is grown by attaching new nodes each with m edges that are preferentially attached to existing nodes with high degree.

Parameters:
  • n: the number of nodes
  • m: number of edges to attach from a new node to existing nodes
  • seed: seed for random number generator (default=None)

The initialization is a graph with with m nodes and no edges.

Reference:

@article{barabasi-1999-emergence,
title   = {Emergence of scaling in random networks},
author  = {A. L. Barabási and R. Albert},
journal = {Science},
volume  = {286},
number  = {5439},
pages   = {509 -- 512},
year = {1999},
}