mesa-examples icon indicating copy to clipboard operation
mesa-examples copied to clipboard

Add New Preferential Attachment Example

Open Spartan-71 opened this issue 9 months ago • 4 comments

Summary

This PR introduces a new Preferential Attachment simulation example, inspired by the Barabási–Albert model of network growth. The simulation models how a network evolves over time as new nodes are added and preferentially attach to existing nodes with higher degrees, leading to the emergence of scale-free network structures.


Features

  • Node Agents: Represent individual nodes in the network.
  • Preferential Attachment Rule: New nodes attach to existing nodes with probability proportional to node degree.
  • Data Collection: Tracks the number of nodes with degree 1 over time.
  • Dynamic network topology: Dynamic graph representation of the growing network.

Implementation Details

  • Uses Mesa’s Network grid to embed and manage the graph.
  • Relies on networkx for graph data structure and operations.
  • Probabilities for attachment are derived from current node degrees.
  • Includes a DataCollector to track key metrics like node degrees.

Visualization

image


Spartan-71 avatar Apr 14 '25 03:04 Spartan-71