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.
Compare with the plot from the Watts and Strogatz paper: