NetLogo banner

Home
Download
Help
Forum
Resources
Extensions
FAQ
NetLogo Publications
Contact Us
Donate

Models:
Library
Community
Modeling Commons

Beginners Interactive NetLogo Dictionary (BIND)
NetLogo Dictionary

User Manuals:
Web
Printable
Chinese
Czech
Farsi / Persian
Japanese
Spanish

  Donate

NetLogo Models Library:
IABM Textbook/chapter 5

(back to the library)

Preferential Attachment Simple

[screen shot]

If you download the NetLogo application, this model is included. You can also Try running it in NetLogo Web

ACKNOWLEDGMENT

This model is from Chapter Five of the book "Introduction to Agent-Based Modeling: Modeling Natural, Social and Engineered Complex Systems with NetLogo", by Uri Wilensky & William Rand.

  • Wilensky, U. & Rand, W. (2015). Introduction to Agent-Based Modeling: Modeling Natural, Social and Engineered Complex Systems with NetLogo. Cambridge, MA. MIT Press.

This model is in the IABM Textbook folder of the NetLogo Models Library. The model, as well as any updates to the model, can also be found on the textbook website: http://www.intro-to-abm.com/.

WHAT IS IT?

This is a simplified version of the Preferential Attachment model in the networks section of the NetLogo models library. It generates a network where the probability of a new link being connected to a node is proportional to the number of links the node already has.

Such networks are "scale-free" in that they look the same at whatever scale you look. Such scale-free networks can be found in a surprisingly large range of real world situations, ranging from the connections between websites to the collaborations between actors.

This model generates these networks by a process of “preferential attachment”, in which new network members prefer to make a connection to the more popular existing members.

Scale-free networks generate a degree distribution that follows a "power law" with a few very "link-rich" nodes or hubs, and many "link-poor" nodes.

HOW IT WORKS

The model starts with two nodes connected by an edge. At each step, a new node is added. A new node picks an existing node to connect to randomly, but with some bias. More specifically, a node’s chance of being selected is directly proportional to the number of connections it already has, or its “degree.” This is the mechanism which is called “preferential attachment.”

HOW TO USE IT

SETUP creates two nodes and creates a link between them.

GO-ONCE creates one new node and finds it a partner based on preferential attachment.

GO continuously preferentially adds nodes until there are NUM-NODES nodes.

The LAYOUT button attempts to move the nodes around to make the structure of the network easier to see. Some network layout happens in the GO procedure, but pressing the LAYOUT button can add more layout during processing or in post-processing the network.

The MIN DEGREE monitor shows the degree of the node with the least links. It has to be at least 1, as all new nodes are linked to old nodes.

The MAX DEGREE monitor shows the degree of the node with the most links.

The DEGREE DISTRIBUTION plot shows the number of nodes with each degree value. This is a power law distribution.

If you look at the DEGREE DISTRIBUTION histogram, you will see that there are many more nodes with low degrees than nodes with high degrees. Nodes with a degree of one (meaning that they have just one link) should be by far the most common.

The DISPLAY-DEGREE? switch, toggles an alternate visualization in which the size of the node is proportional to its degree.

THINGS TO NOTICE

The networks that result from running this model are often called “scale-free” or “power law” networks. These are networks in which the distribution of the number of connections of each node is not a normal distribution — instead it follows what is a called a “power law distribution”. Power law distributions are different from normal distributions in that they do not have a peak at the average, and they are more likely to contain extreme values (see Albert & Barabási 2002 for a further description of the frequency and significance of scale-free networks). Barabási and Albert originally described this mechanism for creating networks, but there are other mechanisms for creating scale-free networks and so the networks created by the mechanism implemented in this model are referred to as "Barabási scale-free networks".

THINGS TO TRY

Let the model run a little while. How many nodes are “hubs”, that is, have many connections? How many have only a few? Does some low degree node ever become a hub? How often?

Choose a large value for the NUM-NODES slider, then allow a large network to form. Do you see a pattern as the number of nodes increases?

EXTENDING THE MODEL

Assign an additional attribute to each node. Make the probability of attachment depend on this new attribute as well as on degree. (A bias slider could control how much the attribute influences the decision.)

NETLOGO FEATURES

Nodes are turtle agents and edges are link agents.

The model uses the ONE-OF primitive to chose a random link and the BOTH-ENDS primitive to select the two nodes attached to that link.

It uses some clever code to give "tickets" to each node so that its chance of winning the lottery (and thus being linked to by the new node) is proportional to its degree:

let partner one-of [ both-ends ] of one-of links

There are many ways to graphically display networks. This model uses the layout-spring primitive to implement a common method in which the movement of a node at each time step is the net result of "spring" forces that pulls connected nodes together, and repulsion forces that push all the nodes away from each other.

Because the model uses a bounded topology, some additional layout code keeps the nodes from staying at the view boundaries.

Though it is not used in this model, there exists a network extension for NetLogo (bundled with NetLogo) that has many more network primitives.

RELATED MODELS

See other models in the Networks section of the Models Library, such as the fuller Preferential Attachment model, the Giant Component model and others.

See also Network Example, in the Code Examples section.

CREDITS AND REFERENCES

This model is a simplified version of:

Both the original and this model are based on:

  • Albert-László Barabási. Linked: The New Science of Networks, Perseus Publishing, Cambridge, Massachusetts, pages 79-92.

For a more technical treatment, see:

  • Albert-László Barabási & Reka Albert. Emergence of Scaling in Random Networks, Science, Vol 286, Issue 5439, 15 October 1999, pages 509-512.

The layout algorithm is based on the Fruchterman-Reingold layout algorithm. More information about this algorithm can be obtained at: http://cs.brown.edu/people/rtamassi/gdhandbook/chapters/force-directed.pdf.

For a model similar to the one described in the suggested extension, please consult:

  • W. Brian Arthur, "Urban Systems and Historical Path-Dependence", Chapt. 4 in Urban systems and Infrastructure, J. Ausubel and R. Herman (eds.), National Academy of Sciences, Washington, D.C., 1988.

HOW TO CITE

This model is part of the textbook, “Introduction to Agent-Based Modeling: Modeling Natural, Social and Engineered Complex Systems with NetLogo.”

If you mention this model or the NetLogo software in a publication, we ask that you include the citations below.

For the model itself:

Please cite the NetLogo software as:

Please cite the textbook as:

  • Wilensky, U. & Rand, W. (2015). Introduction to Agent-Based Modeling: Modeling Natural, Social and Engineered Complex Systems with NetLogo. Cambridge, MA. MIT Press.

COPYRIGHT AND LICENSE

Copyright 2008 Uri Wilensky.

CC BY-NC-SA 3.0

This work is licensed under the Creative Commons Attribution-NonCommercial-ShareAlike 3.0 License. To view a copy of this license, visit https://creativecommons.org/licenses/by-nc-sa/3.0/ or send a letter to Creative Commons, 559 Nathan Abbott Way, Stanford, California 94305, USA.

Commercial licenses are also available. To inquire about commercial licenses, please contact Uri Wilensky at uri@northwestern.edu.

(back to the NetLogo Models Library)