| Deg | Vertices |
|---|
Vertices are all binary strings of length n with exactly k zeros. Two vertices are adjacent when a consecutive 3-cycle on positions (i, i+1, i+2) — either forward (right rotation: new[i]=s[i+2], new[i+1]=s[i], new[i+2]=s[i+1], i.e. (a,b,c)→(c,a,b)) or reverse (left rotation: new[i]=s[i+1], new[i+1]=s[i+2], new[i+2]=s[i], i.e. (a,b,c)→(b,c,a)) — changes the string. An edge exists only when the triple is not all-0 or all-1. The graph has |V| = C(n,k) vertices and 2(n−2) generator types. G₃ is denser than G₂ and has diameter roughly half that of G₂.
Let A = 0k1n−k (canonical vertex), B with 1-based zero positions z₁<…<zₖ. Define dᵢ = zᵢ−i, I(B) = Σdᵢ, Δ(B) = |Σ(−1)i+1(dᵢ mod 2)|.
No closed-form exact formula is known for d(X,Y) between arbitrary vertices. The app uses BFS for exact distances and displays the two-sided bounds.
1 — By degree: color = number of incident edges.
2 — d from A: BFS distance from A. Green (d=0, A itself shown gold) → red (d=diam=A*).
3 — d from A*: same gradient rooted at A* (complement of mode 2).
4 — d from clicked: live BFS from any node you click.
Green ring = A Purple ring = A* Gold fill = source Orange fill = target Blue ring = d(X,Y) nodes
Red square nodes — see U′ Approximation below.
Color = 3-cycle position index i (10-color palette). Solid stroke = forward rotation (right rotation: (a,b,c)→(c,a,b)). Dashed stroke = reverse rotation (left rotation: (a,b,c)→(b,c,a)). Multiple edges between the same pair of nodes are fanned out with perpendicular offsets so they don't overlap.
When Show generator labels is on, each edge shows a small pill at its visual midpoint: ▶2 = forward 3-cycle at position 2, ◀2 = reverse, ▶3w = wrapped generator.
Check Stretch (pin nodes) to enter stretch mode (cursor changes to a cell crosshair).
With Keep symmetric on, pinning a node simultaneously pins its reversal partner at the mirror position.
Instantly stops physics and zeros all velocities. A and A* receive leader-line callouts so they are easy to identify. Press ▶ Unfreeze to resume. Useful before Sort Vertices or d(X,Y) on large graphs.
Click the button, then click any node U as the BFS root. Nodes partition into layers Ld = {v : d(U,v) = d}.
Node radius auto-scales so nodes fit inside their band. A small verification block shows BFS vs formula d(U,A) and d(U,A*). Holography tooltips remain active in both sub-modes.
Click the button, then click two nodes on the graph (they highlight with a blue ring) or type their binary labels. Press ↳ Compute.
The bounds ⌈½Σ|xᵢ−yᵢ|⌉ ≤ d ≤ Σ⌈|xᵢ−yᵢ|/2⌉ are also displayed. After computing, click any node to start a new query.
For each binary string B = b₁b₂…bₙ with k zeros, a k × (n−k) rectangle encodes the string as a lattice path:
The label below reads A=N (Area = I(B)). With Show I(B) formula on, the per-term breakdown (z₁−1)=d₁ … is shown above it.
Hover any node to see its diagram (works in free layout, Rings, and Rows modes). Check Show all holography to display all diagrams simultaneously.
For each node X, define U = I(B) (the lattice-path area) and U′ = ⌈U/2⌉. The exact formula gives d(A,X) = (I(B)+Δ(B))/2, so U′ = ⌈I/2⌉ is the "naïve" approximation that ignores the parity correction Δ.
When U′ ≠ d(A,X), the node is drawn as a red square instead of a colored circle. This happens precisely when Δ(B) > I(B) mod 2 — i.e., when the alternating parity sum contributes a non-trivial correction. For k=1 the approximation is always exact (no squares). For k≥2 squares appear at nodes where the correction term is non-zero.
At build time the app checks d(A,B) = (I(B)+Δ(B))/2 for every vertex B and displays a green ✓ or red ⚠ pill in the right panel. When |V| ≤ 350 the diameter ⌈k(n−k)/2⌉ is also BFS-verified.