NetworkX

Previous topic

networkx.s_metric

Next topic

networkx.gnr_graph

Quick search

networkx.gn_graph

gn_graph(n, kernel=<function <lambda> at 0x9061a74>, seed=None)

Return the GN (growing network) digraph with n nodes.

The graph is built by adding nodes one at a time with a link to one previously added node. The target node for the link is chosen with probability based on degree. The default attachment kernel is a linear function of degree.

The graph is always a (directed) tree.

Example:

>>> D=nx.gn_graph(10)       # the GN graph
>>> G=D.to_undirected()  # the undirected version

To specify an attachment kernel use the kernel keyword

>>> D=nx.gn_graph(10,kernel=lambda x:x**1.5) # A_k=k^1.5

Reference:

@article{krapivsky-2001-organization,
title   = {Organization of Growing Random Networks},
author  = {P. L. Krapivsky and S. Redner},
journal = {Phys. Rev. E},
volume  = {63},
pages   = {066123},
year    = {2001},
}