Watts and Strogatz proposed a small-world network
model in 1998. In the algorithm network start with a regular
lattice, and then randomly rewrite each edge of the lattice
with probability p while self-connections and duplicate
edges are excluded. After that, a modified version of the WS
model was proposed by Newman and Watts. This model is
easier to analyze than the original Watts Strogatz model. The
algorithm of NW model is as follows: