A graph does not have to look random to behave randomly: rewiring a percent or two of a regular lattice leaves the clustering intact while the average path length falls to near its random-graph value.
Details
Determinism: edges visited in a fixed order, rewiring draws from the shared Lehmer minstd stream, so a seed gives the same graph in both arms.
Formula: ring where each node joins its k nearest neighbours, then rewire each edge with probability p, refusing self-loops and duplicates.
Examples
Watstro(n = 5L, k = 5L, p = 0.5)
#> $A
#> [,1] [,2] [,3] [,4] [,5]
#> [1,] 0 1 1 1 1
#> [2,] 1 0 1 1 1
#> [3,] 1 1 0 1 1
#> [4,] 1 1 1 0 1
#> [5,] 1 1 1 1 0
#>
#> $estimate
#> [1] 4
#>
#> $n_rewired
#> [1] 0
#>
#> $n_edges
#> [1] 10
#>
#> $n
#> [1] 5
#>
#> $method
#> [1] "Watts-Strogatz small-world graph"
#>
#> attr(,"class")
#> [1] "morie_rich_result" "list"
