Undirected Network Coding and Faster External-Memory Integer Sorting

Baochun Li, Zongpeng Li, Sirui Liu

TL;DR

This paper refutes the long-standing Li–Li conjecture by proving that network coding can strictly outperform routing in undirected networks. By translating this theoretical communication advantage into a data-movement strategy, the authors present the first deterministic external-memory integer sorting algorithm that asymptotically beats the classical comparison-sorting bound established in 1988.

What Problem Does This Paper Address?

For decades, two major questions in theoretical computer science remained open. First, the Li–Li conjecture (2004) posited that in undirected networks, "network coding" (where nodes can XOR or combine messages) offers no advantage over simple "routing" (where nodes just forward messages). Second, in the realm of external-memory algorithms, researchers wondered if integer sorting could ever beat the fundamental I/O bound for comparison-based sorting set by Aggarwal and Vitter in 1988.

The classical bound for sorting $N$ items with memory $M$ and block size $B$ is $\Theta(\frac{N}{B} \frac{\log(N/M)}{\log(M/B)})$. While internal-memory integer sorting has seen significant progress, the external-memory version—where the bottleneck is moving data between disk and RAM—seemed stuck at the comparison limit. This paper connects these two problems, showing that if you can move data more efficiently through a "network" of memory locations using coding, you can sort faster.

Methods

The authors' approach is a masterclass in cross-disciplinary theory:

  1. The Counterexample: They first construct a specific undirected network where binary linear coding (using XOR operations) achieves a higher throughput than any possible routing scheme. This refutes the Li–Li conjecture.
  2. Circuit to Network: They represent data permutations as circuits of XOR gates. As shown in Figure 2, these circuits can be mapped onto undirected networks. A three-register circuit and its corresponding undirected network.

  3. Address-Field Interchange: Sorting is essentially a massive data rearrangement task. The authors focus on "address-field interchange"—swapping bits in the address of a data element to move it to a new position (see Figure 3). Interchanging two address fields to move data.

  4. Recursive Coding: They use the coding advantage to perform these interchanges with fewer "block transfers" (I/Os). By recursively breaking down long-field swaps into smaller ones, the savings from network coding accumulate.

  5. Integration: This accelerated interchange is plugged into the Columnsort framework and combined with most-significant-digit (MSD) radix sorting to handle arbitrary input sizes.
  6. Formal Verification: To ensure the complex logic and tiny asymptotic gains are correct, the authors used the Lean 4 theorem prover to verify the algorithm's correctness and complexity bounds.
A three-register circuit and its corresponding undirected network.
Interchanging two address fields to move data.

Datasets

Not discussed in the paper. This is a theoretical work focused on algorithmic complexity and mathematical proofs rather than empirical benchmarking on specific datasets.

Key Insights and Ideas

  • Data Movement as Communication: The core "aha" moment is treating the internal rearrangement of data on a disk as a communication problem over a network. If network coding can save bandwidth in a network, it can save I/O operations on a computer.
  • The Power of XOR: By allowing intermediate steps of the sorting process to involve linear combinations (XORs) of data bits rather than just moving whole records, the algorithm can "compress" the required movement.
  • Telescoping Savings: The authors use nested subspaces and matrix rank properties to show that the "cost" of moving data (measured in matrix rank) is strictly less than what routing would require. This small gap, when applied recursively, leads to an asymptotic improvement.
  • Refuting the Impossible: Previous work suggested that if the Li–Li conjecture were true, beating the sorting bound would be impossible. By proving the conjecture false, the authors opened the door to this new algorithm.

Key Results

The paper introduces a deterministic sorting algorithm with an I/O complexity of: $$O\left(\frac{N}{B}\left[1+\frac{\log N}{(\log(M/B))^{1-\varepsilon}(\log M)^\varepsilon}\right]\right)$$ where $\varepsilon \approx 1.8 \times 10^{-11}$ is a positive constant.

While $\varepsilon$ is tiny, its existence is a massive theoretical breakthrough. As shown in the table below (Table 1 in the paper), for specific parameters, this bound is strictly better than the classical one. Comparison of I/O bounds for different input sizes.

Comparison of I/O bounds for different input sizes.

For example, when $M=2B$ and $N=B^2$, classical sorting requires $\Theta(B \log B)$ I/Os, while this new algorithm uses $O(B (\log B)^{1-\varepsilon})$.

Limitations and Future Work

  • Practicality: The constant $\varepsilon$ is extremely small ($1.8 \times 10^{-11}$), meaning the "faster" algorithm would only outperform classical methods on astronomically large datasets that far exceed current or near-future hardware capacities. It is currently an "existence proof" of a faster algorithm rather than a practical tool for engineers.
  • Complexity: The construction involves sophisticated recursive field exchanges and matrix factorizations that are difficult to implement efficiently.
  • Future Directions: The authors suggest looking for better coding constructions that could yield a larger $\varepsilon$, which might lead to more practical speedups. They also wonder if network coding can similarly accelerate other fundamental data-movement tasks like matrix transposition or FFTs.

Summary updated

Abstract

Network coding allows intermediate nodes to combine messages, whereas routing only forwards them. The Li-Li conjecture asserts that network coding and fractional routing have the same capacity region in undirected multiple-unicast networks. We give a counterexample to this conjecture and apply it to external-memory integer sorting. Since Aggarwal and Vitter posed the question in 1988, whether integer sorting can beat the external-memory comparison bound has remained a central and extensively studied open problem. We give a deterministic sorting algorithm: for $N$ integers of $Θ(\log N)$ bits, a memory holding $M$ integers, and block transfers of $B$ integers, where $2B\le M\le N$, the number of block transfers is $O\left(\frac{N}{B}\left[1+\frac{\log N}{(\log(M/B))^{1-\varepsilon}(\log M)^\varepsilon}\right]\right)$, where $\varepsilon>0$ is an absolute constant. In a range of parameter regimes, this bound is asymptotically smaller than the classical comparison-sorting bound. We also use Lean 4 to verify the sorting algorithm's correctness and complexity bounds, and the strict advantage of coding over routing.
BibTeX
@misc{li2026undirected,
  author = {Baochun Li and Zongpeng Li and Sirui Liu},
  title = {{Undirected Network Coding and Faster External-Memory Integer Sorting}},
  year = {2026},
  eprint = {2610.20079},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2610.20079},
}
Figure