Class WattsStrogatzGenerator

Inheritance Relationships

Base Type

Class Documentation

class WattsStrogatzGenerator : public NetworKit::StaticGraphGenerator

Public Functions

WattsStrogatzGenerator(count nNodes, count nNeighbors, double p)

Constructs a graph according to the Watts and Strogatz model (https://en.wikipedia.org/wiki/Watts_and_Strogatz_model), which produces graphs with high clustering and low average path length.

First, a regular ring lattice is generated. Then some edges are rewired randomly.

Parameters:
  • nNodes – number of nodes in target graph

  • nNeighbors – number of neighbors on each side of a node

  • p – rewiring probability

virtual Graph generate() override