0.001

0.01

0.1

1

0

0

p

l

dnodewiggle = 0.03
radius = 1
nnodes = 200
nodewiggles = Sequence(RandomUniform[1 - dnodewiggle, 1 + dnodewiggle], i, 1, nnodes)
dtheta: 2 * π / nnodes
logpmin = -6.907755278982137
k = 4
f(x) = 1 / (2 * sqrt(x^(2) + 2 * x)) * atanh(sqrt(x / (x + 2)))
nodes = Sequence((Element[nodewiggles, i] * radius * sin(dtheta * i), Element[nodewiggles, i] * radius * cos(dtheta * i)), i, 1, nnodes)
logp = -6.907755278982137 (slider from logpmin to 0, step 0.1)
p: exp(logp)
rewire1 = Sequence(RandomBinomial[1, p], i, 1, nnodes)
rnodes1 = Sequence(RandomElement[nodes], i, 1, nnodes)
rewire2 = Sequence(RandomBinomial[1, p], i, 1, nnodes)
rnodes2 = Sequence(RandomElement[nodes], i, 1, nnodes)
edges1 = Sequence(Segment[Element[nodes, i], Element[nodes, Mod[i, nnodes] + 1] * (1 - Element[rewire1, i]) + Element[rnodes1, i] * Element[rewire1, i]], i, 1, nnodes)
edges2 = Sequence(Segment[Element[nodes, i], Element[nodes, Mod[i + 1, nnodes] + 1] * (1 - Element[rewire2, i]) + Element[rnodes2, i] * Element[rewire2, i]], i, 1, nnodes)
rewire3 = Sequence(RandomBinomial[1, p], i, 1, nnodes)
rnodes3 = Sequence(RandomElement[nodes], i, 1, nnodes)
l(p) = nnodes / k * f(nnodes * k * p)
C(p) = 3 * (k - 1) / (2 * (2 * k - 1)) * (1 - p)^(3)
Cexp(p) = C(exp(p))
lexp(p) = l(exp(p))
lval: l(p)
text1: "p=" + p + ""
Cscaleexp = Function((1 - ℯ^(x))^(3), logpmin, 0)
lscaleexp = Function(4 * f(nnodes * k * ℯ^(x)), logpmin, 0)
Cval: C(p)
text2: "C=" + Cval + ""
poly1, a, b, c, d = Polygon((-0.02023191922714407, 0.00278372591006424), (-0.02023191922714407, 1.0027837259100643), (logpmin, 1), (logpmin, 0))
LL: (logpmin * 1.2, -0.2)
UR: (-logpmin * 0.2, 1.1)
rewire4 = Sequence(RandomBinomial[1, p], i, 1, nnodes)
rnodes4 = Sequence(RandomElement[nodes], i, 1, nnodes)
edges3 = Sequence(Segment[Element[nodes, i], Element[nodes, Mod[i + 3, nnodes] + 1] * (1 - Element[rewire4, i]) + Element[rnodes4, i] * Element[rewire4, i]], i, 1, nnodes)
tickbot = -0.03
tick001 = Segment((-4.605170185988091, 0), (log(0.01), tickbot))
tick01 = Segment((-2.3025850929940455, 0), (log(0.1), tickbot))
tick1 = Segment((0, 0), (log(1), tickbot))
tick0001 = Segment((-6.907755278982137, 0), (log(0.001), tickbot))
maxC: 3 * (k - 1) / (2 * (2 * k - 1))
maxl: nnodes / (4 * k)
tickwidth: -logpmin * 0.03
tickr0 = Segment((0, 0), (tickwidth, 0))
tickr1 = Segment((0, 1), (tickwidth, 1))
tickl1 = Segment((logpmin, 1), (logpmin - tickwidth, 1))
tickl0 = Segment((logpmin, 0), (logpmin - tickwidth, 0))
text9: "" + maxC + ""
text11: "" + maxl + ""
text12 = RotateText("Clustering coefficient", 1.5708)
text14 = RotateText("Mean path length", 1.5708)
LLL = (-1.2, -1.2)
LUR = (1.2, 1.4)
MRAX = (0, 0.7)
MLAX: (logpmin, 0.7)
p1sm = 0.008
p2sm = 0.1
poly2, e, g, h, i = Polygon((log(p1sm), 0), (log(p2sm), 0), (log(p2sm), 1), (log(p1sm), 1))
A = Point(Cscaleexp)
B = Point(lscaleexp)
text3: "$\ell=" + (LaTeX[lval]) + "$"