Generating key points…
Answers are grounded in this paper and cite their sources.
For every odd \(n=2m+1≥3\), a literal shorthand permutation in this explicit \(2×(n!/2)\) torus can be converted to its starting row and column, and those coordinates can be converted back to the window. Each direction takes \(O(n^3)\) arithmetic operations and polynomial bit complexity and storage, with no preliminary scan or factorial-size index. A shorthand permutation here is a \(2× m\) window containing \(n-1\) distinct labels from \(0,…,n-1\), with the remaining label implicit. Rows and columns wrap cyclically, and the starting row is the row read first. The result answers the position-encoding and decoding question for the fixed matching-cycle construction. For \(n=1\), the source uses an empty torus. Gerlach–Hartung–Herkenrath–Sawada–Williams, §9, printed p. 17 The universal-torus construction and the binary rule for orienting its pairs come from the original work. The fixed matching cycle used here is generated by a tree of spare exchanges. The new calculation gives the size of any subtree from tables indexed by only a few labels. Those sizes let the codec skip whole stretches of the matching cycle and recover the two-row coordinates even when a window straddles two orientation blocks. Gerlach et al., Lemma 14 and Algorithm 2, pp. 12–14 A tree node is a cyclically ordered matching of \(m\) unordered pairs. Its spare is the unused label. Canonical slot zero contains label zero, or label one when zero is spare. The desired pair in slot \(j\) is \(\{2j,2j+1\}\), for \(0≤ j<m\). The root has all the desired pairs and spare \(n-1\). Among nodes with nonzero spare, let \(F_\) consist of those with every label from zero through \(\) in its desired slot, for \(0≤≤ n-2\). At stage \(a\), leave a node fixed if \(a\) is already in slot \( a/2\). Otherwise exchange \(a\) with the spare if it is in a later slot, then install it from the spare by evicting the smallest endpoint outside the desired pair. Start with unit mass at every node of \(F_0\). Push masses forward under these repairs and add one at each node of \(F_1\) after stage one. This extra unit counts the leaf obtained by evicting zero from the pair \(\{0,1\}\) in exchange for the spare. Write \(W_(x)\) for the mass at node \(x\) after stage \(\). At stage zero and after odd stages it equals \(f_(s)\), where \(s>\) is the spare. After a positive even stage \(a\) it equals \(g_a(s,d)\), where \(d>a\) is the partner of \(a\), \(s>a\), and \(s≠ d\). All label indices are at most \(n-1\). Initialise with \(f_0(s)=1\) for \(s≥1\) and \(f_1(s)=n\) for \(s≥2\). For positive even \(a≤ n-2\), put \(b=a+1\) and compute \[g_a(s,d)=fₐ₋₁(s)+ 1_{\{s≠ b\}∩(\{d=b\}∪\{s<d\})}(∑ᵤ₌ₐⁿ⁻¹ fₐ₋₁(u)-fₐ₋₁(s)-fₐ₋₁(d)). \] The indicator equals one exactly when \(s\) can be the endpoint evicted during installation. For odd \(3≤ a≤ n-2\) and \(s>a\), compute \[f_a(s)=gₐ₋₁(s,a)+∑_{{a≤ u≤ n-1\≠ s}}gₐ₋₁(u,s). \] To obtain the subtree size at a nonzero-spare node \(x\), take its last achieved stage \(\), with \(=n-2\) at the root. Use \(W_(x)\). If \(x\) is a nonroot node whose spare is precisely the next missing label \(a=+1\), also add \(W_(y)\) for each node \(y\) obtained by exchanging \(a\) with one endpoint of a pair strictly after its target slot. Each such exchange makes the displaced endpoint the spare of \(y\). This accounts for the extra parent step that moves \(a\) into the spare before installing it. A zero-spare leaf has subtree size one. The cyclic stream of unordered pairs has length \(H=n!/2^m\). Its traversal starts at root slot zero. At each slot it visits the attached children in the construction's fixed order and then emits that slot's pair. A child event occupies \(m\) times its subtree size in stream positions, and an emission occupies one. To rank an ordered matching window, canonicalise its cyclic list of pairs and let \(j\) be the slot of its final pair. Read its parent path from the root, adding the lengths of events before each path child and then before the emission of slot \(j\). If that emission has zero-based index \(p\), the window starts at \(t=(p-m+1) H\), including windows that wrap around the stream origin. To decode \(t\), start at emission index \((t+m-1) H\) and descend through the event intervals, subtracting the lengths of preceding events at each step. The selected node and emission slot \(j\) give the window by reading its pairs cyclically from slot \(j+1\) through slot \(j\). There are \(B=2ᵐ⁻¹\) orientation blocks, each of length \(H\), so the total width is \(BH=n!/2\). Block \(k\), for \(0≤ k<B\), repeats the \(m\)-bit binary expansion \(b(k)\) from most to least significant bit, with leading bit zero. In column \(kH+t\) the bit at phase \(t m\) is zero when row zero holds the smaller label of the pair and one when it holds the larger. Given a row and column, decode \(t\) to obtain the pairs and apply these bit tests in the successive columns, taking block and phase after wraparound. Starting in row one reverses the vertical order of each pair. To recover coordinates from a literal window, forget the vertical order in each pair and rank the resulting matching to find \(t\). Record a zero for each pair read smaller-first and a one otherwise. Assign these bits to phases starting at \(r=t m\) and proceeding cyclically. Because \(H\) is a multiple of \(m\), phase zero always carries the leading bit zero, so its observed bit is the starting row \(e\). XOR each observed bit with \(e\). If \(t+m≤ H\), the restored bits in phase order give \(b(k)\). Otherwise \(1≤ r<m\). Phases \(r,…,m-1\) give the low suffix of \(b(k)\), whereas phases \(0,…,r-1\) give the high prefix of \(b((k+1) B)\). Interpret that prefix as a binary integer, subtract one if the low suffix consists entirely of ones, and reduce modulo \(2ʳ⁻¹\). Writing the result as an \(r\)-bit prefix with leading zero and appending the suffix recovers \(b(k)\), including at the last-to-first block boundary. The coordinate pair is \((e,kH+t)\). The tables take \(O(n^3)\) arithmetic operations to build and a subtree query takes \(O(n)\). Either matching calculation visits \(O(n)\) levels with \(O(n)\) events per level. The stored counts, lengths and positions are at most \(n!\), so each uses \(O(nlog n)\) bits. The cost applies to an arbitrary literal window or position in this fixed torus. At each slot of the base traversal, test the two possible exchanges of the spare for an endpoint of the current pair. Keep exactly the choices whose parent rule reverses the exchange. Visit these children in lexicographic order of the increasing replacement pair and then the new spare, before emitting the current pair. This fixes the numerical origin and order used by the rank and unrank maps.
No takes yet. Share an insight, caveat, or question.
Zixuan He (2026) studied this question.
Synapse has enriched 8 closely related papers on similar clinical questions. Consider them for comparative context: