NetLogo banner

Home
Download
Help
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 User Community Models

(back to the NetLogo User Community Models)

[screen shot]

Download
If clicking does not initiate a download, try right clicking or control clicking and choosing "Save" or "Download".(The run link is disabled for this model because it was made in a version prior to NetLogo 6.0, which NetLogo Web requires.)

# ONE LOVE: EMERGENCE OF A GIANT COMPONENT IN A NETWORK OF POLYAMOROUS RELATIONSHIPS

## WHAT IS IT?

In a famous 1959 paper, Paul Erdos and Alfred Renyi proved that, if you add edges at random to a network, a "giant component" emerges when the average number of edges per node becomes greater than 1. In a network, a "component" is a group of nodes (people) that are all connected to each other, directly or indirectly. So if a network has a "giant component", that means most nodes are reachable from most other nodes.

This model simulates the evolution of a network of polyamorous romantic relationships. Polyamory is a relationship style where individuals can be in multiple romantic relationships at the same time. Almost by definition (though some single people self-identify as polyamorous), the average number of relationships across all polyamorous people is greater than 1. By implication, most polyamorists in the world should be connected to each other in the giant component of the romantic relationships network. There are no hard data on the matter (admittedly, collecting them poses significan challenges to research ethics), but, anecdotically, there seems to be no perception in the polyamory community that this is indeed the case.

The model looks at the emergence of a giant component in a network when edges are randomly added. The twist is that, instead of starting from a completely disconnected network with zero edges, it starts from a "lumpy" one, where all nodes are arranged in connected pairs. These represent monogamous couples that "open up".

This model is derived from the NetLogo Giant Component model, one of the standard models in NetLogo's library, that shows how quickly a giant component arises if you grow a random network.

## HOW IT WORKS

Making a wild simplification, the model starts from a situation in which all agents are arranged in monogamous pairs. At each step, we pick two nodes at random which were not directly connected before and add an edge between them. All possible connections between them have exactly the same probability of occurring.

As the model runs, small chain-like "components" are formed, where the members in each component are either directly or indirectly connected to each other. If an edge is created between nodes from two different components, then those two components merge into one. The component with the most members at any given point in time is the "giant" component and it is colored red. (If there is a tie for largest, we pick a random component to color.)

## HOW TO USE IT

The NUM-NODES slider controls the size of the network. Choose a size and press SETUP.

Pressing the GO ONCE button adds one new edge to the network. To repeatedly add edges, press GO.

As the model runs, the nodes and edges try to position themselves in a layout that makes the structure of the network easy to see. Layout makes the model run slower, though. To get results faster, turn off the LAYOUT? switch.

The REDO LAYOUT button runs the layout-step procedure continuously to improve the layout of the network.

A monitor shows the current size of the giant component, and the plot shows how the giant component's size changes over time.

## THINGS TO NOTICE

The y-axis of the plot shows the fraction of all nodes that are included in the giant component. The x-axis shows the average number of connections per node. The vertical line on the plot shows where the average number of connections per node equals 1.5. The rate of growth of the giant component's size increases dramatically around that value. This marks a difference with the value of 1 found by Erdos and Renyi.

## THINGS TO TRY

Let the model run until the end. Does the "giant component" live up to its name?

Run the model again, this time slowly, a step at a time. Watch how the components grow. What is happening when the plot is steepest?

Run it with a small number of nodes (like 10) and watch the plot. How does it differ from the plot you get when you run it with a large number of nodes (like 300)? If you do multiple runs with the same number of nodes, how much does the shape of the plot vary from run to run? You can turn off the LAYOUT? switch to get results faster.

## EXTENDING THE MODEL

Right now the probability of any two nodes getting connected to each other is the same. Can you think of ways to make some nodes more attractive to connect to than others? How would that impact the formation of the giant component?

## NETWORK CONCEPTS

Identification of the connected components is done using a standard search algorithm called "depth first search." "Depth first" means that the algorithm first goes deep into a branch of connections, tracing them out all the way to the end. For a given node it explores its neighbor's neighbors (and then their neighbors, etc) before moving on to its own next neighbor. The algorithm is recursive so eventually all reachable nodes from a particular starting node will be explored. Since we need to find every reachable node, and since it doesn't matter what order we find them in, another algorithm such as "breadth first search" would have worked equally well. We chose depth first search because it is the simplest to code.

The position of the nodes is determined by the "spring" method, which is further described in the Preferential Attachment model.

## NETLOGO FEATURES

Nodes are turtle agents and edges are link agents. The `layout-spring` primitive places the nodes, as if the edges are springs and the nodes are repelling each other.

Though it is not used in this model, there exists a network extension for NetLogo that you can download at: https://github.com/NetLogo/NW-Extension.

## RELATED MODELS

See Wilensky, U. (2005). NetLogo Giant Component model. http://ccl.northwestern.edu/netlogo/models/GiantComponent. Center for Connected Learning and Computer-Based Modeling, Northwestern University, Evanston, IL.

See also Network Example, in the Code Examples section.

There is also a version of this model using the (NW extension)[https://github.com/NetLogo/NW-Extension] in the `demo` folder of the extension.

## CREDITS AND REFERENCES

The original paper:
P. Erdos and A. Renyi. On random graphs. Publ. Math. Debrecen, 6:290-297, 1959.

This paper has some additional analysis:
S. Janson, D.E. Knuth, T. Luczak, and B. Pittel. The birth of the giant component. Random Structures & Algorithms 4, 3 (1993), pages 233-358.

## HOW TO CITE

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

For the model itself:

* Cottica, Alberto (2019). One love: emergence of a giant component in networks of polyamorous relationships.

Contact: alberto@edgeryders.eu

Please cite the NetLogo software as:

* Wilensky, U. (1999). NetLogo. http://ccl.northwestern.edu/netlogo/. Center for Connected Learning and Computer-Based Modeling, Northwestern University, Evanston, IL.

## COPYRIGHT AND LICENSE

Copyright 2019 Alberto Cottica.

![CC BY-NC-SA 3.0](http://ccl.northwestern.edu/images/creativecommons/byncsa.png)

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.

(back to the NetLogo User Community Models)