Skip to content

Python implementation of the Watts-Strogatz model for generating small-world networks

Notifications You must be signed in to change notification settings

thecrazyphysicist369/watts-strogatz

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

13 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Creating small world networks in Python using the Watts-Strogatz model

Watts, D. J.; Strogatz, S. H. (1998). "Collective dynamics of 'small-world' networks" Nature. 393 (6684): 440–442.

This is a Python 2.7 implementation of the Watts-Strogatz model for generating small-world networks. GraphTest.py produces a .csv file which can be plotted to verify the result of the 1998 paper by Duncan Watts and Steven Strogatz.

Graphs with small-world properties are characterized by short average path lengths and high clustering. They notably resemble many real-world phenomena such as food chains, electric power grids, brain neurons, voter networks, telephone call graphs, and social networks. The Watts-Strogatz model is a generative model which starts with a regular graph and rewires its edges randomly to produce graphs with small-world properties.

Below is a plot of the clustering coefficient and average path length against the rewiring probability p, generated by this Python implementation.

From this implementation

Compare with the plot from the Watts and Strogatz paper:

From the paper by Watts & Strogatz

About

Python implementation of the Watts-Strogatz model for generating small-world networks

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Python 100.0%