diff --git a/pretext/SmallWorldGraphs/RingLattice.ptx b/pretext/SmallWorldGraphs/RingLattice.ptx index a1639bf..2ad0a4e 100755 --- a/pretext/SmallWorldGraphs/RingLattice.ptx +++ b/pretext/SmallWorldGraphs/RingLattice.ptx @@ -3,8 +3,12 @@ Ring lattice
A ring lattice with n=10 and k=4. - " A ring lattice with n=10 and k=4." -
+ + Ring lattice graph with 10 nodes, each connected to its 4 nearest neighbors. + +

The image displays a ring lattice graph characterized by n=10 nodes and where each node has k=4 neighbors (degree of 4). The ten nodes, labeled with integers from 0 to 9, are visually arranged in a circular pattern.

+

Each node is connected by an undirected edge to its two closest neighbors in the clockwise direction and its two closest neighbors in the counter-clockwise direction along the ring. For example, node 0 is connected to nodes 1 and 2 (clockwise) and nodes 9 and 8 (counter-clockwise). This connectivity pattern, where each node is linked to its four nearest neighbors, is consistent for all nodes, illustrating the "wrap-around" characteristic of the ring lattice structure.

+

A regular graph is a graph where each node has the same number of neighbors; the number of neighbors is also called the degree of the node.

A ring lattice is a kind of regular graph, which Watts and Strogatz use as the basis of their model. In a ring lattice with n nodes, the nodes can be arranged in a circle with each node connected to the k nearest neighbors.

For example, a ring lattice with n=3 and k=2 would contain the following edges: (0, 1), (1, 2), and (2, 0). Notice that the edges wrap around from the highest-numbered node back to 0.

diff --git a/pretext/SmallWorldGraphs/TheWSExperiment.ptx b/pretext/SmallWorldGraphs/TheWSExperiment.ptx index 00ced8e..ac5f2bb 100755 --- a/pretext/SmallWorldGraphs/TheWSExperiment.ptx +++ b/pretext/SmallWorldGraphs/TheWSExperiment.ptx @@ -3,8 +3,16 @@ The WS Experiment
Clustering coefficient (C) and characteristic path length (L) for WS graphs with n=1000, k=10, and a range of p. - " Clustering coefficient (C) and characteristic path length (L) for WS graphs with n=1000, k=10, and a range of p." -
+ + Normalized clustering (C) and path length (L) vs. rewiring probability (p) for Watts-Strogatz graphs. + +

This line graph, titled "Normalized clustering coefficient and path length," shows how these metrics change for Watts-Strogatz (WS) graphs (n=1000 nodes, k=10 initial connectivity) as rewiring probability (p) varies.

+

The x-axis, "Rewiring probability (p)", is logarithmic (10^{-4} to 10^0). The y-axis shows normalized values (0.0 to 1.0) for both C and L.

+

Two curves are shown:

+

Normalized Clustering Coefficient (C(p)/C(0)): (Dark blue squares) Starts at 1.0, stays high until p \approx 10^{-2}, then drops sharply towards 0 as p approaches 10^0.

+

Normalized Characteristic Path Length (L(p)/L(0)): (Light blue circles) Also starts at 1.0, but drops much earlier and faster, beginning its steep decline around p=10^{-4} to 10^{-3} and stabilizing at a low value by p \approx 10^{-1}.

+

The graph illustrates the "small-world" phenomenon: a region (around p \approx 10^{-3} to 10^{-1}) where path length (L) is low (like random graphs) while clustering (C) remains high (like regular lattices), indicating highly clustered networks with short average path lengths.

+

Now we are ready to replicate the WS experiment, which shows that for a range of values of p, a WS graph has high clustering like a regular graph and short path lengths like a random graph.

We will start with run_one_graph, which takes n, k, and p; it generates a WS graph with the given parameters and computes the mean path length, mpl, and clustering coefficient, cc:

def run_one_graph(n, k, p):
diff --git a/pretext/SmallWorldGraphs/WSGraphs.ptx b/pretext/SmallWorldGraphs/WSGraphs.ptx
index 07299e1..c88556a 100755
--- a/pretext/SmallWorldGraphs/WSGraphs.ptx
+++ b/pretext/SmallWorldGraphs/WSGraphs.ptx
@@ -3,8 +3,16 @@
   WS Graphs
   
WS graphs with n=20, k=4, and p=0 (left), p=0.2 (middle), and p=1 (right). - " WS graphs with n=20, k=4, and p=0 (left), p=0.2 (middle), and p=1 (right)." -
+ + Three Watts-Strogatz graphs (n=20, k=4) showing effect of increasing rewiring probability p (0, 0.2, 1). + +

The image displays three Watts-Strogatz (WS) graphs side-by-side, illustrating the effect of different rewiring probabilities (p) on a network structure. Each graph has n=20 nodes, initially connected with k=4 neighbors per node, and the nodes are visually arranged in a circular layout.

+

The leftmost graph, with a rewiring probability p=0, depicts a regular ring lattice. Each of its 20 nodes is strictly connected to its two nearest neighbors on each side along the ring. This results in an ordered, symmetrical appearance with no rewired edges.

+

The middle graph illustrates the structure with a rewiring probability p=0.2. While the underlying lattice structure is still apparent, several edges have been randomly rewired. These rewired edges create "shortcut" connections that span across the circular arrangement, introducing some randomness and reducing the graph's regularity compared to the p=0 case.

+

The rightmost graph shows the outcome when the rewiring probability p=1. Here, every original edge had the chance to be rewired. The initial ordered lattice structure is almost entirely obscured, resulting in a graph that appears highly disordered and random, with numerous long-range connections crisscrossing the interior of the circular node arrangement.

+

The progression from left to right visually demonstrates how increasing the rewiring probability p transitions a Watts-Strogatz graph from a highly ordered ring lattice to a network resembling a random graph.

+
+

To make a Watts-Strogatz (WS) graph, we start with a ring lattice and rewire some of the edges. In their paper, Watts and Strogatz consider the edges in a particular order and rewire each one with probability p. If an edge is rewired, they leave the first node unchanged and choose the second node at random. They don't allow self loops or multiple edges; that is, you can't have a edge from a node to itself, and you can't have more than one edge between the same two nodes.

Here is an implementation of this process.

def rewire(G, p):