The same graph, invented twice
Frank Harary built it in 1962 to make a graph as hard to disconnect as possible. Newman and Watts built it in 1999 to make a small world. Under one condition on the parameters, they are the same random graph, and the popular NetworkX versions of both quietly differ from the originals.
An interactive companion to[1] S. Son, E. J. Choi & S. H. Lee, “Revisiting small-world network models,” J. Korean Phys. Soc. 83, 879–889 (2023). doi:10.1007/s40042-023-00921-8
Harary’s rule: fill the ring, scatter the rest
Given n nodes and m edges, the best possible connectivity is r = ⌊2m/n⌋. Harary builds that graph deterministically from rings and diameters, then places any leftover edges uniformly at random. NetworkX’s hnm_harary_graph keeps the first step but puts the leftovers in fixed positions, so every (n, m) gives exactly one graph.[2]
The bottom row shows the Newman–Watts graphs[3] that correspond to the same (n, m) under the mapping of §4: a ring of degree kinit = r, plus shortcuts added with p = 2m/(nr) − 1. The mapping needs r to be even; Newman–Watts reaches m only on average, so the edge count of each draw is shown.
Original Harary (OH)
Leftover edges placed at random
NetworkX Harary (XH)
Leftover edges placed deterministically
Original Newman–Watts (ONW)
NetworkX Newman–Watts (XNW)
Randomness buys a much wider range of graphs
Here n = 64 and m runs over every integer from 256 to 2015 (so r goes from 8 to 62), matching the paper and the neural-network search study it critiques. NetworkX gives one point per m; the original rule, drawn ten times per m, fans out across the clustering–path-length plane.
XH: 1,760 graphs
OH: 17,600 graphs
Two ways to add a shortcut
In the original Newman–Watts model (ONW), each of the n k/2 ring edges triggers, with probability p, a shortcut between a uniformly random pair of nodes. In NetworkX’s newman_watts_strogatz_graph (XNW), the shortcut must start at an endpoint of the ring edge that triggered it, so every node gets a fixed number of attempts. The average degree is the same; its spread is not.
Clustering turns back up
Unlike Watts–Strogatz rewiring, Newman–Watts keeps adding edges. In a dense ring, shortcuts eventually close triangles faster than they open new triads, so average clustering C dips and then rises. Newman’s textbook approximation[4] ignores triangles made by shortcuts, and Jo’s correction[5] adds those closed by a single shortcut but drops the O(p²) terms. The paper’s Eq. (6) counts triangles made by one, two and three shortcuts and catches the upturn. Try kinit = 4 to see it vanish.
Eq. (6) of the paper, for the original Newman–Watts model with n nodes and ring degree kinit:
Its value at p = 0 is the clustering of the bare ring,
so the curve plotted below is
Reading the numerator from left to right, the four terms count triangles already in the ring, triangles closed by one shortcut, by two shortcuts, and by three shortcuts; the denominator counts connected triples. Keeping only the first numerator term gives Newman’s approximation, Eq. (A1); keeping the first two gives the one-shortcut (Jo-type) curve.
The equivalence
Harary’s case 3a with an even r is a ring of degree r plus m − rn/2 edges placed uniformly at random. The original Newman–Watts model is a ring of degree kinit plus, on average, p n kinit/2 edges placed uniformly at random. Match the two:
kinit = r, p = 2m / (n r) − 1
The only difference left is that Newman–Watts hits that edge count on average while Harary hits it exactly. Below, 150 graphs of each kind per point, n = 50.