Manuscript Offprint
arXiv:2610.39922Communication-Oblivious Permutation and Sorting
Abstract
With the help of secure hardware such as trusted execution environments (TEEs), private data can be uploaded and computed in untrusted cloud clusters, so that an adversary controlling the cloud can only see the data in encrypted form. However, the communication pattern between the processors may still reveal sensitive information about the data, so it is important to develop parallel algorithms in the BSP model whose communication pattern is independent of the input data, a property known as communication obliviousness. In this paper, we study such algorithms for three fundamental problems: permutation, sorting, and 0-1 sorting. For the first two problems, we prove a tight (up to lower-order terms) communication complexity of . Here, is the number of processors and is the input size, assuming and . Our lower bound holds regardless of the number of rounds and local memory size, while for balanced permutation and sorting the upper bound is achieved in a constant number of rounds with load at most . For 0-1 sorting, we also derive a tight communication complexity of , where is the optimal value of a linear program parameterized by . Although there appears to be no closed-form for , we show that it is strictly smaller than for all , thus separating 0-1 sorting from general sorting in terms of their communication complexity.
1 Introduction
Large-scale analytics increasingly relies on cloud clusters because the underlying datasets and computations exceed the capacity of a single machine. A standard model for computation using a cluster is the Bulk Synchronous Processing (BSP) model [23], also known as the Massively Parallel Computation (MPC) model [5, 7]. In this model, which will be defined more precisely in Section 2, there are processors, each holding data initially and (ideally) also in the end. Computation proceeds in synchronous rounds, where each round consists of a local computation stage and a communication stage. Good BSP algorithms should have a small number of rounds, low total communication cost, and low memory requirement for each processor. For example, the classical sample sort algorithm runs in 3 rounds, has a communication cost of , and requires local memory per processor, assuming the parameter range [21]. Note that both its communication cost and local memory requirement are clearly optimal up to lower-order terms.
Datasets uploaded to a cloud often contain sensitive medical, financial, behavioral, or organizational information. While the data can be encrypted during communication and local computation, the adversary can still infer sensitive information from the communication pattern, which is known
Corresponding author.
The ~notation hides logarithmic factors.
as side-channel attacks [26, 19]. Most cloud-based secure distributed computation systems suffer from such attacks as they are based on Trusted Execution Environments (TEEs), which prevent the untrusted cloud from seeing the data in plaintext but still reveal communication patterns. Thus, it is important to design algorithms whose communication pattern is independent of the input data, a property known as communication obliviousness. The sample sort algorithm, however, is not communication-oblivious (henceforth simply called oblivious): The communication pattern reveals which processors originally had the smallest n/p items, the second smallest n/p items, etc. A trivial oblivious algorithm sends all data to one processor, sorts them locally, and distributes them back in sorted order. This algorithm incurs communication, (almost) twice as much as non-oblivious sort, and more critically, requires n local memory, forfeiting all parallelism. Better parallel oblivious sorting algorithms have been designed [16, 18] using local memory, but the best communication cost they can achieve is 3n.
We use load, the maximum number of words received by a processor in a round, to measure per-processor communication. To keep this communication proportional to the local data size, we seek algorithms with load and a small constant factor. For balanced permutation, sorting, and 0-1 sorting, our algorithms achieve load at most while attaining the optimal leading communication cost.
Permutation and sorting. We first prove a lower bound on the communication cost for oblivious permutation, regardless of the number of rounds and local memory size. The same lower bound thus also holds for sorting, meaning that the trivial algorithm above that sends all data to one processor is already optimal in terms of the communication complexity. Then we design better parallel oblivious permutation and sorting algorithms with a communication cost of , assuming and . For balanced permutation and sorting, these algorithms have load at most . The communication cost is thus optimal up to lower order terms (even for a constant ). The permutation algorithm is deterministic and perfectly communication-oblivious, while the sorting algorithm is randomized with negligible failure and non-oblivious probability. The lower bound holds for deterministic algorithms, but can be extended to randomized algorithms (with negligible failure and non-oblivious probability) by just adding an term.
0-1 sorting. The situation of oblivious 0-1 sorting is more intricate. We prove a tight communication complexity of , where is the optimum of a linear program (LP) parameterized by . The lower bound again holds for both deterministic and randomized algorithms, regardless of the number of rounds and local memory size. Our algorithm achieving the upper bound, under the regime and , has load and uses rounds. More generally, there is a trade-off between the number of rounds and the communication cost; please see Theorem 5.8 for the precise statement.
Finally, although we do not have a closed-form for , we are able to show that
for all . Consequently, for every , the leading communication coefficient of oblivious 0-1 sorting is strictly between those of non-oblivious sorting and oblivious general sorting.
1.2 Related Work
Communication-oblivious BSP algorithms. BSP/MPC algorithms have been extensively studied in both the algorithms and the systems literature, as the model resembles many big-data computing platforms such as MapReduce and Spark [14, 9, 27]. There are generic techniques [7, 22] that can convert BSP algorithms to oblivious ones with constant-factor overhead under suitable parameter assumptions. Applying either compiler to the one-round non-oblivious balanced permutation algorithm gives roughly 4n communication, which does not attain the optimal communication cost obtained here.
RAM-oblivious algorithms. In addition to the communication pattern, side-channel information also includes the memory access pattern. To differentiate, we refer to the latter as RAM-oblivious algorithms. While we only focus on communication obliviousness in this paper, one can combine our algorithms with RAM-oblivious algorithms for the local computation part to achieve full obliviousness.
RAM-oblivious algorithms enjoy a longer history. ORAM is a generic technique that can make any algorithm RAM-oblivious by increasing its running time by an factor [11, 3]. Alternatively, custom RAM-oblivious algorithms have been designed for many problems, including permutation, sorting, and 0-1 sorting (a.k.a. compaction), with the former two in time [6, 2] and the latter in time [4, 10]. However, the hidden constants are still very large and far from optimal: The best oblivious sorting algorithm is randomized shell sort [12], which performs comparisons. This also motivates our assumption : when is close to and local memory is limited, communication-oblivious algorithms resemble RAM-oblivious algorithms, with communication cost corresponding to memory-access cost.
For example, consider the realistic model with and total local memory per processor. Each processor's state fits in a constant-size RAM block, and each word communicated can be simulated with RAM accesses. Conversely, a linear-space RAM algorithm with constant private workspace can be simulated by distributing its memory across the processors. These simulations preserve fixed oblivious patterns with constant overhead in data movement. For indivisible records, the resulting optimal deterministic oblivious communication bounds are for balanced permutation and general sorting, matching their RAM-access bounds [6, 2], and for unstable 0-1 sorting [4, 10].
Distributed oblivious analytics. Systems such as Opaque, SODA, and Jodes motivate communication-efficient primitives for oblivious distributed analytics [28, 17, 25]. Our algorithms provide building blocks for this setting when combined with RAM-oblivious local computation. Ngai et al. develop oblivious sorting and shuffling across multiple enclaves [18]. Our work establishes tight leading-order upper and lower bounds on total communication for permutation, sorting, and 0-1 sorting.
2 Preliminaries
2.1 Model of Computation
Throughout this work, denotes the number of input items and the number of processors. We assume that . For a nonnegative integer , write , with . We consider the bulk-synchronous parallel (BSP) model [23], in which the processors collaboratively execute an algorithm on input , where processor initially holds . We assume for every . For all the problems considered in this paper, the output is a permutation of .
The computation may take multiple rounds. Let denote the data distribution at the beginning of round ; in particular, for every . In round , processor sends to processor for , and retains locally. The items held by processor at the beginning of round are therefore given by , for every . The final output is .
We consider two versions of the model. In the ideal model, the algorithm is given complete knowledge of the data distribution; equivalently, an oracle provides the processors with routing instructions at no communication cost. In the realistic model, processors make routing decisions locally and may need to receive auxiliary information from other processors. We measure communication in words, assuming that each input item fits in one -bit word. All our lower bounds hold in the ideal model, whereas the upper bounds hold in the realistic model.
The communication pattern of on input is , where and is the total length, in words, of the message from processor to processor in round , including the items in and auxiliary words, possibly padded with dummy tuples for achieving obliviousness; for every , we set . Algorithms may be randomized, in which case is a random variable induced by the algorithm's internal randomness.
Algorithms in the BSP model are evaluated by three measures. The first is the number of rounds , ideally a constant. For a fixed pattern , define its communication cost by . The second measure is the communication cost , where the expectation is over the algorithm's internal randomness. The third is the load, defined by , where the maximum also ranges over internal random choices.
Communication obliviousness. For any problem in which is a permutation of , there is a trivial algorithm with communication cost at most in the ideal model: simply send each item to its target processor. Its communication pattern, however, depends on the input. We are interested in algorithms whose communication patterns are independent of, or oblivious to, the input. Formally, let be the leakage function, which specifies the information that an adversary is allowed to observe. An algorithm is -statistically communication-oblivious (or simply -oblivious) with respect to if, for every pair of inputs such that , we have , where is the statistical distance between the distributions of the random variables and . We also call the non-oblivious probability. A function is negligible if , i.e., if for every fixed , it satisfies for all sufficiently large . An algorithm with is perfectly oblivious; note that a deterministic oblivious algorithm must be perfectly oblivious.
2.2 Problems
This paper investigates the following three problems. In each problem, denotes the key of item x.
Permutation. In this problem, each item is given a key , and the algorithm is required to place on processor . The leakage function is the destination-count vector , where . We allow the final item counts to be revealed, while hiding the assignment of individual items beyond these counts. If only were revealed, any perfectly oblivious algorithm would require every processor to receive at least words in total, since any processor could be the destination of all items. This forces at least total communication, attained in one round by routing items directly to their destinations and padding every message between distinct processors to words. A special case, which we call balanced permutation, has for every . Since is then determined by and , its leakage function reduces to .
Sorting. Each item is given a unique key from a totally ordered domain, and the algorithm must place the items in nondecreasing key order: for every , all keys on processor are no greater than those on processor . We further require each processor to hold exactly items upon termination. The leakage function is . It should be clear that, in the ideal model, sorting is equivalent to balanced permutation, since the oracle knows the destination of each item.
0-1 sorting. The 0-1 sorting problem is the special case of sorting where every item has key . Note that ties can be broken arbitrarily, i.e., the sorting is allowed to be unstable. As will be seen later, our permutation lower bound also holds for stable 0-1 sorting, so stableness makes 0-1 sorting as hard as general sorting. Its leakage function is likewise .
2.3 General Reductions
We state two general reductions that simplify the classes of algorithms we must consider. They adapt standard arguments from the oblivious-algorithms literature [8] to our setting.
The first shows that there is little difference between Monte Carlo and Las Vegas algorithms in our setting.
Lemma 2.1 (Failure removal). Suppose there is an R-round, -oblivious algorithm that may fail with probability at most and outputs a failure flag upon failure. Let be an always-correct non-oblivious algorithm using at most rounds. Then there is an always-correct, -oblivious algorithm using at most rounds and having communication cost at most . This holds in both the realistic and ideal models.
Proof. We simply run first and invoke when announces failure; call the resulting algorithm . The round and communication bounds are immediate; we only need to show that is -oblivious. Fix two inputs , with . Let and be the communication-pattern distributions, and let and be the communication-pattern distributions of the wrapped algorithm. On the event that does not fail, the wrapped communication pattern is a deterministic postprocessing of the original communication pattern. On the failure event, whose probability is at most for each input, the fallback communication pattern may be arbitrary. Coupling the non-failure parts and union-bounding the two failure events gives
For all three problems, processors can detect failure with communication cost, and there are always-correct fallback algorithms using rounds and communication in the parameter regimes considered below. Sorting and 0-1 sorting have load at most via sample sort [21], while direct routing for permutation delivers at most words to any processor on an input with destination counts . Thus, when is negligible, failure removal adds only expected communication and rounds, with load bounded by the maximum of the original and fallback loads.
The second reduction shows that derandomization is possible in the ideal model when the inputs are restricted to a small family.
Lemma 2.2 (Derandomization in the ideal model). Consider the ideal model. Suppose there is a Las Vegas, -oblivious algorithm for a finite family of inputs with the same leakage value. If , then there exists a deterministic algorithm with communication cost at most .
Proof. Pick any and sample a communication pattern from . By definition, . For each , the definition of -obliviousness implies . By a union bound, the event has probability at least . Hence . Therefore there exists a communication pattern whose cost is at most . Since is always correct, for every there is an execution that produces a valid output while following . The ideal-model algorithm can deterministically select this execution for input .
By the two reductions above, to prove a lower bound it suffices to fix a finite family of inputs with the same leakage and analyze a deterministic perfectly communication-oblivious algorithm in the ideal model. The reduction incurs only an loss when and ; in particular, these conditions hold when is polynomial in and both the failure and non-obliviousness probabilities are negligible.
For such a deterministic algorithm, perfect communication obliviousness gives a common pattern for every input in . We use a static fractional relaxation: give each item mass , allow this mass to be split, and discard the timing of communication. Aggregate the pattern into the directed capacity graph , where , and define its normalized cost by .
For every , relaxing a correct execution yields a fractional routing from the normalized initial placement to a valid output, with flow at most on every arc . We say that supports when such a routing exists. Thus the fixed graph supports every input in , although the routing and, when the output is not unique, the terminal assignment may depend on . Consequently, the minimum of over all capacity graphs supporting is a lower bound on the normalized communication cost . This minimum-capacity problem is a directed variant of robust network design with dynamic routing [13]. Since divisibility and the removal of temporal constraints only relax the original model, multiplying this minimum by gives a communication-cost lower bound for the original indivisible BSP problem. Accordingly, all lower bounds below are established in this relaxed capacity model.
3 Permutation
3.1 Lower bound
For the lower bound, it suffices to consider balanced permutation. For , let . After normalization, a balanced input is represented by the demand matrix . Its -th row sums to , while its -th column sums to ; hence it is doubly stochastic. The direct-versus-detour argument of Keslassy et al. [15] yields the following bound; Appendix A gives the adaptation.
Theorem 3.1 (Permutation lower bound). Any normalized capacity matrix w supporting every divisible balanced-permutation demand satisfies . Consequently, even in the ideal model, every deterministic perfectly communication-oblivious algorithm for balanced permutation on n indivisible items has communication cost at least .
Combining the normalized deterministic bound with failure removal and finite-family derandomization gives the following extension to randomized algorithms.
Corollary 3.2. A randomized permutation algorithm whose failure probability and non-oblivious probability are negligible has communication cost at least .
Proof. The always-correct non-oblivious permutation algorithm has communication cost n, and the family defined in Appendix A has size . Plugging these facts into Lemma 2.1 and Lemma 2.2 yields the conclusion.
3.2 Upper bound
The following two-round construction is a deterministic implementation of Valiant load balancing [24].
Spray and count dissemination. Processor locally sorts its items by destination, using a fixed tie-breaking rule, and assigns them cyclically to the intermediate processors. For every , processor sends the items assigned to in a payload padded to positions and appends its local destination-count vector . Thus every processor reconstructs and receives words in this round.
Forward. Because the items in are consecutive in this local order, they contribute at most items to any intermediate processor. Hence every intermediate processor holds at most items destined for processor . Each intermediate processor sends its items for every in a payload padded to this bound. Every item therefore reaches its prescribed destination, and processor terminates with exactly items.
The first-round message lengths are , while the message from to in the second round has length . These lengths depend only on , and the authorized leakage . Together with the fixed local sorting and cyclic assignment, this makes the algorithm deterministic and perfectly communication-oblivious. Its communication cost satisfies . For an input with destination counts , write . Each processor receives at most words in the forward round. Together with the spray-round bound, this gives at most received words per processor per round.
Theorem 3.3 (Permutation upper bound). There is a deterministic perfectly communication-oblivious algorithm for the permutation problem in the realistic model. It uses two rounds and has communication cost at most . On every input with destination-count vector , each processor receives at most words in any round.
When , the communication overhead is and the additive per-round receive overhead is . In particular, balanced permutation has load at most .
4 Sorting
As argued earlier, sorting and balanced permutation are equivalent in the ideal model, so the lower bound in Theorem 3.1, as well as the randomized lower bound in Corollary 3.2, also holds for sorting. We therefore focus on the upper bound. We reduce sorting to a nearly balanced permutation problem and solve it using the permutation algorithm from Section 3.2. The basic idea follows classical sample sort [21], with additional care to ensure obliviousness and match the lower bound up to lower-order terms.
4.1 Algorithm
Fix parameters , whose values will be determined later. Let denote the following three-phase algorithm.
Sampling. Processor 1 first draws a sample (without replacement) of size ps obliviously, i.e., the communication pattern is fixed regardless of which items are sampled. To do so, each processor uniformly samples key copies from its local data, retains all original items, and sends the copies to processor 1. Processor 1 then generates a random vector from the multivariate hypergeometric distribution with parameters , , and ps. Here is the number of items taken from processor i in a uniform random sample of size ps. If for any i, processor 1 announces failure; otherwise, it uniformly draws of the key copies originating from processor i.
Next, processor 1 sorts the sample and lets be the key of sample rank for . It then broadcasts .
Permutation. Set and . For every , let . The processors then invoke the permutation procedure from Section 3.2 on this partition, with as the prescribed destination of every item in . After the spray-and-count dissemination round, every processor knows and checks whether for any . If so, they abort; otherwise, they complete the forward round.
Rebalancing. After the permutation step, processor holds the items in the -th pivot interval, but these items need not yet be locally ordered. Each processor first sorts its items locally. The distribution may be slightly out of balance, with processor holding items. In the last round, each processor sends the items whose ranks lie outside to their correct destinations to form the balanced sorting output.
4.2 Analysis
Theorem 4.1 (Sorting upper bound). For any , define
and suppose that . Then the sorting algorithm above uses five rounds, is -oblivious, correctly solves the sorting problem except with probability at most , has load at most , and incurs expected communication cost at most
For , choose and . Then , , and for all sufficiently large . Since and , the theorem gives expected communication and load at most , with negligible failure probability and obliviousness error.
The rest of this section proves Theorem 4.1.
The sampling procedure is the algorithm’s only randomized step. To analyze it, imagine drawing an unrestricted uniform sample of ps items, and let be its number of items from processor . The vector has the same distribution as the algorithm’s , and, conditional on it, the local samples are independent uniform -subsets. If every , each local sample can be extended uniformly to a local -subset; by symmetry, reversing these two choices gives exactly the implemented sampler. Thus the two samples can be coupled to agree outside . Let be the event that some pivot bucket of the unrestricted sample contains more than items.
Lemma 4.2 (Failure probability). Under the parameter choice of Theorem 4.1, and . Consequently, the sorting algorithm fails with probability at most .
Proof. Each is hypergeometric with mean . Since , the additive Chernoff bound at deviation , followed by a union bound, gives .
Now consider rank intervals of length whose starting ranks are and that lie in , where ranges over nonnegative integers. There are at most of them. Every interval longer than contains one: its first grid point is fewer than ranks from its left endpoint, while the length slack is at least . Each pivot bucket contains exactly sampled items, so implies that some test interval contains at most of them. For any fixed test interval, the sample count is hypergeometric with mean at least , so
The definition of makes this at most ; another union bound gives . On the two samples coincide, so the actual algorithm can fail only in .
Lemma 4.3 (Obliviousness). Under the parameter choice of Theorem 4.1, the sorting algorithm is -oblivious with respect to .
Proof. The sampling pattern is fixed: every noncollector sends exactly key copies, and processor 1 broadcasts either the pivots or a failure flag padded to the same length. Let be the pattern of the execution that uses the unrestricted sample and aborts on bucket overflow. Its distribution is input-independent: sampled ranks are uniform, the resulting bucket sizes determine , the permutation subroutine's pattern is determined by , and the bucket sizes also determine the overflow and rebalancing messages. Under the coupling above, the actual and reference patterns agree on . Hence Lemma 4.2 gives for every input ; for the triangle inequality gives
Lemma 4.4 (Resource bounds). The sorting algorithm uses five rounds and satisfies the load and expected communication bounds in Theorem 4.1.
Proof. Sample collection and pivot broadcast use two rounds, permutation uses two, and rebalancing uses one.
Sampling communicates at most words and has load at most . By Theorem 3.3, permutation communicates at most words. The spray round has load at most , and the bucket-size check bounds the forward-round load by . Rebalancing has load at most , giving an overall load bound of . This accounts for all communication except rebalancing.
Let be the global rank of the reference pivot , namely the -th unrestricted-sample order statistic. Exactly items cross logical boundary , so upper-bounds direct transmissions, since one transmission may cross several boundaries. The actual algorithm either uses these pivots or aborts with zero rebalancing cost, so this domination is unconditional.
Writing the unsampled ranks as gaps around the ps sampled ranks gives and
Thus and . Using , , and , we obtain
Uniformity of the sampled global ranks makes this expectation uniform over inputs.
Since and , adding the sampling, permutation, and expected rebalancing costs proves the communication bound.
If the algorithm does not abort, Theorem 3.3 guarantees that permutation gathers the ordered pivot intervals, local sorting orders them, and rebalancing places every rank on its prescribed processor. Together with Lemmas 4.2, 4.3, and 4.4, this proves Theorem 4.1.
5 0-1 Sorting
The cyclic-shift hard family underlying Theorem 3.1 can be encoded as stable 0-1-sorting instances. Hence stable 0-1 sorting inherits the lower bound for general sorting. We therefore focus on unstable 0-1 sorting, where equal-key items may exchange valid destinations; this flexibility is what permits a smaller communication coefficient.
Since equal-key items are interchangeable, we describe an input by the amount of zero mass on each processor. For an input , let be its normalized zero-count vector, where . Processor initially holds zero mass and one mass , and the total zero mass is .
In the sorted output, zero mass fills the processors from left to right. Its distribution is therefore the sorted zero profile , where and ; the entry is omitted when .
We call an input pure if every processor initially holds either all zeros or all ones, and write for these input vectors. We use pure inputs to establish the lower bound and later extend their routing schemes to arbitrary inputs.
5.1 The Cut-LP and the lower bound
Consider any set of processors. Its zero surplus must leave the set, while a zero deficit requires an equal amount of one mass to leave, since its total mass is unchanged by sorting. The common capacity graph must accommodate the largest such demand over all pure inputs. These necessary cut constraints yield the following LP lower bound.
Let be the common normalized capacity matrix, with cost . For , write , and let .
For an input vector , define the signed zero surplus at processor by , and its total over by . The largest cut demand over all pure inputs is . Since total zero mass is preserved, ; hence , while . Consider the following Cut-LP:
minimize
subject to ,
(Cut(p))
Let denote the optimal value of .
Theorem 5.1 (0-1 sorting lower bound). Any normalized capacity matrix w supporting every pure 0-1 sorting input in the divisible setting satisfies . Consequently, even in the ideal model, deterministic perfectly communication-oblivious 0-1 sorting on n indivisible items requires communication at least .
Proof. For the first statement, let be such a shared aggregate capacity matrix. Fix and a nontrivial cut . If , then zero mass of amount must leave . If , then one mass of amount must leave , because every processor has the same total mass initially and finally. Thus for every pure input; maximizing over gives . Hence is feasible for , whose objective is .
Corollary 5.2. Any randomized 0-1 sorting algorithm whose failure probability and non-oblivious probability are negligible must have communication cost at least .
Proof. By Lemma B.1, the proof of Theorem 5.1 yields the same deterministic lower bound on a family of at most inputs. The result then follows from Lemmas 2.1 and 2.2.
5.2 The Route-LP and the upper bound
5.2.1 The finite-round Route-LP
Fix . The LP Route( ) describes a public -round communication pattern that simultaneously supports every pure input. Its normalized public lengths are shared by all inputs; for each pure input, separate flow and state variables certify a correct routing under those lengths.
For and , let be the normalized public message length from processor to processor in round . For each and , let be the amount of key class sent on that arc, and let be the amount held by processor at the beginning of round , with denoting the terminal state. All length, flow, and state variables are nonnegative. Each constraint below is imposed for every choice of its free indices, where , , , , and . The objective and remaining constraints are
minimize
subject to
(Flow)
(Init)
(Route(p, R))
(Term)
(Avail)
(Len).
Constraints (Flow), (Init), and (Term) impose conservation and the prescribed initial and terminal states. Constraint (Avail) enforces local availability, whereas (Len) requires the two key classes to share the public message length. Unused message space may be filled with padding. For a feasible solution S, write for its objective value. The optimal value of is . The LP has size , because it contains one state-and-flow block for each pure input.
We measure receive load in units of n/p. For a feasible solution S, define its normalized load by
Lemma 5.3 (Extension from pure inputs). Every feasible solution of Route(p, R) extends to a correct divisible routing scheme for every input vector under the same communication pattern. The extension preserves normalized load.
Proof. Fix , write , and let , where for . The standard hypersimplex decomposition [29] gives coefficients such that
Choose the lexicographically first basic feasible coefficient vector; it has support at most . Superpose the corresponding pure-input routing schemes:
Linearity preserves (Flow), (Avail), and (Len), and gives the initial state . Moreover, for every , , because the coefficients from have total weight . The same calculation gives the terminal one-mass vector. The extension uses the same communication pattern and hence preserves normalized load. Thus the superposed scheme is correct and deterministic under the fixed choice of coefficients.
Lemma 5.3 routes every divisible input under the shared Route-LP lengths, giving the following forward construction.
Corollary 5.4 (Route-LP forward construction). Every feasible solution of Route induces a deterministic perfectly communication-oblivious -round algorithm for divisible 0-1 sorting in the ideal model. Its normalized communication is , and its normalized load is .
5.2.2 Finite-round bounds for small
We computed the Cut-LP and Route-LP for to compare the static lower bound with achievable finite-round communication costs. Table 1 reports these bounds alongside the general-sorting coefficient , together with the round count and normalized load of each route. The Cut-LP optima are certified by matching rational primal and dual solutions, and the Route-LP upper bounds by rational feasible solutions. All certificates are verified using exact arithmetic.
| Route-LP solution | |||||
|---|---|---|---|---|---|
| 2 | 1 | 1 | 1 | 1 | 1 |
| 3 | 4/3 | 1 | 1 | 3 | 1 |
| 4 | 3/2 | 1 | 1.0011 | 400 | 3/665 |
| 5 | 8/5 | 6/5 | 6/5 | 5 | 4/3 |
| 6 | 5/3 | 11/9 | 11/9 | 5 | 4/3 |
| 7 | 12/7 | 9/7 | 9/7 | 6 | 12/11 |
| 8 | 7/4 | 37/28 | 37/28 | 5 | 1.2659 |
| 9 | 16/9 | 451/342 | 451/342 | 6 | 1.0385 |
| 10 | 1.8000 | 1.3375 | 1.3441 | 4 | 1.1688 |
| 11 | 1.8182 | 1.3438 | 1.4062 | 3 | 1.5221 |
Table 1: Cut-LP lower bounds and finite-round Route-LP upper bounds for small . Bold route costs match the Cut-LP lower bound exactly. Cut-LP optima are displayed as fractions or rounded decimals; decimal route costs and loads are rounded upward.
For every , the displayed route cost is strictly below , showing that the communication advantage of 0-1 sorting can already be realized by finite-round algorithms. Moreover, for , the route cost matches exactly, attaining the Cut-LP lower bound in only one to six routing rounds. Our computations identify the reported as the minimum number of rounds needed to attain this optimum.
For , the 400-round route has cost at most 1.0011, within of , but none of the computed routes attains the lower bound. We conjecture that no finite-round Route-LP solution attains . The unmatched bounds for use only four and three rounds, respectively; larger horizons were not computed.
This raises the general question of whether increasing the number of rounds always closes the gap to the Cut-LP bound: for every , do we have
5.2.3 From cuts to finite-round routes
We answer this question affirmatively by converting any feasible Cut-LP solution into a finite-round Route-LP solution with vanishing communication-cost overhead.
Lemma 5.5 (Cut-to-route conversion). Let be a feasible solution of Cut(). For every integer , there is a feasible solution of Route() with objective value at most and normalized load at most .
Proof. Put , and replace each pair by its average. This preserves the objective. For every nontrivial , the new outgoing capacity is , so feasibility is preserved. We may therefore assume that is symmetric.
Fix . Feasibility of gives for every .
Paired bidirectional key flows. Since , max-flow/min-cut applied to the cut inequalities yields a nonnegative zero-flow satisfying and for every . Cancel antiparallel flow and directed cycles, and define the one-flow by . It has divergence at each processor . Moreover, antiparallel cancellation and symmetry give on every directed arc , so the capacities suffice to carry both key flows simultaneously. Decompose into simple surplus-to-deficit paths with amounts ; their reversals decompose . Routing zero mass along each and one mass along its reverse therefore produces the prescribed terminal states.
(a) Paired bidirectional flows

(b) Pipeline and cleanup

Figure 1: Cut-to-route schedule. (a) Pairing every zero-flow path with a reversed one-flow path gives combined key flow at most on arc . (b) The first cohorts are pipelined using public length per round; the remaining cohorts use two-round spray-and-forward.
Pipelining across rounds. For , set . Split each paired path amount into equal cohorts. Launch the first zero cohorts along , and their paired one cohorts along the reverse of , in rounds ; every launched cohort advances by one arc per round. Since every simple path has at most arcs, all launched cohorts arrive by round without violating temporal availability. In any round, their combined flow on is at most . The first rounds therefore form a feasible pipeline of cost at most . In each pipeline round, the normalized receive load is .
Residual cleanup. The unlaunched cohorts form an fraction of the paired transfer demand. Since , every processor has residual supply and demand at most . Split each residual source-destination transfer equally among all intermediate processors and then forward each share to its destination. Uniform splitting places at most on every directed arc in either round, so set for . These two rounds complete all residual transfers at additional cost .
Each cleanup round has normalized receive load . The cut separating the last all-zero processors from their disjoint sorted destinations and its complement give . Hence the cleanup load is also at most .
Appending an empty round preserves feasibility, so is nonincreasing in . Applying Lemma 5.5 to an optimal Cut-LP solution gives the matching asymptotic upper bound. Together with Theorem 5.1, letting yields the following corollary.
Corollary 5.6 (Cut/Route convergence). For and integer , . Moreover, if , then . Consequently, .
Thus, even when a finite-round upper bound in Table 1 does not match , the optimal Route-LP cost approaches as R grows.
5.2.4 Realization on indivisible items
It remains to realize the divisible upper bound on n indivisible items while preserving communication obliviousness. The following lemma compiles a finite-round Route-LP solution into a realistic algorithm. The time-expanded rounding argument is given in Appendix C.1.
Lemma 5.7 (Indivisible realization). Let S be a feasible solution of Route(p, R). Then there is a deterministic perfectly communication-oblivious 0-1 sorting algorithm in the realistic model with rounds, communication , and load at most .
The algorithm and analysis are given in Appendix C.2.
Let be the minimum communication cost of deterministic perfectly communication-oblivious 0-1 sorting in the realistic model.
Theorem 5.8 (Communication bound on indivisible items). For every and integer ,
The upper bound is achieved by a deterministic perfectly communication-oblivious algorithm in the realistic model using rounds and load at most .
Proof. Theorem 5.1 gives the lower bound. For the upper bound, choose an optimal Cut-LP solution. Lemma 5.5 gives a feasible solution of Route(p, R) with objective value at most and normalized load at most . Lemma 5.7 then gives the stated bounds.
Suppose , and choose an integer such that and ; such a choice exists because . Together with the bound in Theorem 5.9, Theorem 5.8 gives an algorithm using rounds, communication , and load . Increasing reduces the temporal-routing surcharge , whereas the indivisible-realization overhead grows with . For fixed , any with is admissible, and consequently .
5.3 Explicit bounds and separation from general sorting
Having established that is the exact asymptotic communication coefficient for fixed p, and more generally when , we now bound its value and compare it with the rigid-destination coefficient for general sorting.
Theorem 5.9 (Explicit bounds on the Cut-LP coefficient). For every , . For every , .
The lower and upper bounds follow from Lemmas D.1 and D.3, respectively.
In particular, , while for . Thus is uniformly smaller than the rigid-destination coefficient.
6 Conclusion
We establish tight leading-order communication bounds for communication-oblivious permutation, sorting, and 0-1 sorting when . The optimal costs are for permutation and general sorting, and for 0-1 sorting. Our constructive conversion from cut capacities to finite-round routes shows that the Cut-LP exactly characterizes the latter coefficient. For every , we prove , showing that the freedom to interchange equal-key items makes 0-1 sorting strictly cheaper than general sorting. Determining explicitly remains an open problem.
References
[1] Ravindra K. Ahuja, Thomas L. Magnanti, and James B. Orlin. Network Flows: Theory, Algorithms, and Applications. Prentice Hall, 1993.
[2] M. Ajtai, J. Komlós, and E. Szemerédi. An O(n log n) sorting network. In Proceedings of the Fifteenth Annual ACM Symposium on Theory of Computing, STOC '83, page 1–9, New York, NY, USA, 1983. Association for Computing Machinery.
[3] Gilad Asharov, Ilan Komargodski, Wei-Kai Lin, Kartik Nayak, Enoch Peserico, and Elaine Shi. OptORAMa: Optimal oblivious RAM. In Advances in Cryptology – EUROCRYPT 2020, volume 12106 of Lecture Notes in Computer Science, pages 403–432. Springer, 2020.
[4] Gilad Asharov, Ilan Komargodski, Wei-Kai Lin, Enoch Peserico, and Elaine Shi. Oblivious parallel tight compaction. In 1st Conference on Information-Theoretic Cryptography (ITC 2020), volume 163 of Leibniz International Proceedings in Informatics (LIPIcs), pages 11:1–11:23, Dagstuhl, Germany, 2020. Schloss Dagstuhl–Leibniz-Zentrum für Informatik.
[5] Paul Beame, Paraschos Koutris, and Dan Suciu. Skew in parallel query processing. In Proceedings of the 33rd ACM SIGMOD-SIGACT-SIGART Symposium on Principles of Database Systems, PODS '14, page 212–223, New York, NY, USA, 2014. Association for Computing Machinery.
[6] Václav E. Beneš. Permutation groups, complexes, and rearrangeable connecting networks. Bell System Technical Journal, 43(4):1619–1640, 1964.
[7] T-H. Hubert Chan, Kai-Min Chung, Wei-Kai Lin, and Elaine Shi. MPC for MPC: Secure Computation on a Massively Parallel Computing Architecture. In Thomas Vidick, editor, 11th Innovations in Theoretical Computer Science Conference (ITCS 2020), volume 151 of Leibniz International Proceedings in Informatics (LIPIcs), pages 75:1–75:52, Dagstuhl, Germany, 2020. Schloss Dagstuhl–Leibniz-Zentrum fuer Informatik.
[8] T.-H. Hubert Chan, Kai-Min Chung, Bruce Maggs, and Elaine Shi. Foundations of differentially oblivious algorithms. J. ACM, 69(4), August 2022.
[9] Jeffrey Dean and Sanjay Ghemawat. Mapreduce: Simplified data processing on large clusters. Commun. ACM, 51(1):107–113, jan 2008.
[10] Samuel Dittmer and Rafail Ostrovsky. Oblivious tight compaction in time with smaller constant. In Security and Cryptography for Networks, volume 12238 of Lecture Notes in Computer Science, pages 253–274, Cham, 2020. Springer.
[11] Oded Goldreich and Rafail Ostrovsky. Software protection and simulation on oblivious rams. J. ACM, 43(3):431–473, may 1996.
[12] Michael T. Goodrich. Randomized Shellsort: A simple data-oblivious sorting algorithm. Journal of the ACM, 58(6):1–26, 2011.
[13] Navin Goyal, Neil Olver, and F. Bruce Shepherd. Dynamic vs. oblivious routing in network design. Algorithmica, 61(1):161–173, 2011.
[14] Howard Karloff, Siddharth Suri, and Sergei Vassilvitskii. A model of computation for mapreduce. In Proceedings of the Twenty-First Annual ACM-SIAM Symposium on Discrete Algorithms, SODA '10, page 938–948, USA, 2010. Society for Industrial and Applied Mathematics.
[15] Isaac Keslassy, Cheng-Shang Chang, Nick McKeown, and Duan-Shin Lee. Optimal load-balancing. In Proceedings of the 24th Annual Joint Conference of the IEEE Computer and Communications Societies, volume 3 of IEEE INFOCOM 2005, pages 1712–1722. IEEE, 2005.
[16] Tom Leighton. Tight bounds on the complexity of parallel sorting. In Proceedings of the Sixteenth Annual ACM Symposium on Theory of Computing, STOC '84, page 71–80, New York, NY, USA, 1984. Association for Computing Machinery.
[17] Xiang Li, Nuozhou Sun, Yunqian Luo, and Mingyu Gao. Soda: A set of fast oblivious algorithms in distributed secure data analytics. Proc. VLDB Endow., 16(7):1671–1684, mar 2023.
[18] Nicholas Ngai, Ioannis Demertzis, Javad Ghareh Chamani, and Dimitrios Papadopoulos. Distributed & scalable oblivious sorting and shuffling. In 2024 IEEE Symposium on Security and Privacy (SP), pages 4277–4295, Los Alamitos, CA, USA, May 2024. IEEE Computer Society.
[19] Olga Ohrimenko, Manuel Costa, Cédric Fournet, Christos Gkantsidis, Markulf Kohlweiss, and Divya Sharma. Observing and preventing leakage in mapreduce. In Proceedings of the 22nd ACM SIGSAC Conference on Computer and Communications Security, CCS '15, page 1570–1581, New York, NY, USA, 2015. Association for Computing Machinery.
[20] Alexander Schrijver. Theory of Linear and Integer Programming. Wiley-Interscience Series in Discrete Mathematics and Optimization. John Wiley & Sons, Chichester, 1986.
[21] Hanmao Shi and Jonathan Schaeffer. Parallel sorting by regular sampling. J. Parallel Distributed Comput., 14(4):361–372, 1992.
[22] Yufei Tao, Ru Wang, and Shiyuan Deng. Parallel communication obliviousness: One round and beyond. Proceedings of the ACM on Management of Data, 2(5):1–24, 2024.
[23] Leslie G. Valiant. A bridging model for parallel computation. Commun. ACM, 33(8):103–111, Aug 1990.
[24] Leslie G. Valiant and Gordon J. Brebner. Universal schemes for parallel communication. In Proceedings of the Thirteenth Annual ACM Symposium on Theory of Computing, STOC '81, pages 263–277, New York, NY, USA, 1981. Association for Computing Machinery.
[25] Yilei Wang, Xiangdong Zeng, Sheng Wang, and Feifei Li. Jodes: Efficient oblivious join in the distributed setting. Proceedings of the VLDB Endowment, 18(5):1291–1304, 2025.
[26] Yuanzhong Xu, Weidong Cui, and Marcus Peinado. Controlled-channel attacks: Deterministic side channels for untrusted operating systems. In Proceedings of the 2015 IEEE Symposium on Security and Privacy, SP '15, page 640–656, USA, 2015. IEEE Computer Society.
[27] Matei Zaharia, Mosharaf Chowdhury, Tathagata Das, Ankur Dave, Justin Ma, Murphy McCauley, Michael J. Franklin, Scott Shenker, and Ion Stoica. Resilient distributed datasets: A fault-tolerant abstraction for in-memory cluster computing. In Proceedings of the 9th USENIX Conference on Networked Systems Design and Implementation, NSDI'12, page 2, USA, 2012. USENIX Association.
[28] Wenting Zheng, Ankur Dave, Jethro G. Beekman, Raluca Ada Popa, Joseph E. Gonzalez, and Ion Stoica. Opaque: An oblivious and encrypted distributed analytics platform. In Proceedings of the 14th USENIX Conference on Networked Systems Design and Implementation, NSDI'17, page 283–298, USA, 2017. USENIX Association.
[29] Günter M. Ziegler. Lectures on Polytopes, volume 152 of Graduate Texts in Mathematics. Springer-Verlag, New York, 1995.
A Proof of the Permutation Communication Lower Bound
The following is an adaptation of the direct-versus-detour counting argument in Keslassy et al. [15, Lemmas 13–15], rewritten for our normalized communication objective.
For , let , and let be the balanced permutation input in which every item has key . Define . Thus , all its inputs have the same leakage, and after normalization induces one unit of demand from to .
Proof of Theorem 3.1. Fix a normalized capacity matrix as in the theorem. For each , choose a fractional routing for , and let be the amount routed on arc . Since ,
Let be the total mass routed directly on the prescribed arcs , summed over . Since has no fixed point, all units must move. Each unit routed directly contributes one to the total arc flow, while every remaining unit contributes at least two. Hence
For every off-diagonal arc , there is a unique such that . Thus this arc carries directly routed mass for at most one cyclic-shift demand, and
Combining the three inequalities gives . Therefore , as claimed.
The inputs in are valid indivisible balanced-permutation inputs, so the preliminary relaxation transfers the bound to indivisible algorithms.
B Sparse cut and input families
For every nonempty family , define , and let be the optimum of after restricting the input family to , equivalently after replacing by in . Thus .
Lemma B.1 (Sparse cut and input families). For every , there exist a family of nontrivial cuts and a family such that
Retaining only the rows indexed by in preserves its optimal value, and .
Proof. The Cut-LP has capacity entries. After scaling the dual variables, its dual is
maximize
subject to
Reducing the dual support. Every nontrivial contains some and excludes some , so the corresponding constraint implies . Thus the feasible region is bounded and has an optimal basic feasible solution . After adding slacks, the inequalities above give equations, so the standard basic-solution theorem implies that [20].
Sparse cut and input families. Set . The restriction of is feasible for the dual of the Cut-LP containing only these cut rows and retains objective . Weak duality and the fact that rows were only deleted show that the reduced primal has the same optimal value.
For each , choose one vector in attaining , and let be the set of chosen vectors, discarding repetitions. Then and on . Consequently, has the same objective in the -restricted dual. Weak duality gives , while deleting input constraints gives the reverse inequality.
C Indivisible Realization of the 0-1 Sorting Algorithm
C.1 Integral realization of a divisible route
We now transfer a fixed feasible divisible routing to the BSP model. Its public message lengths are normalized divisible amounts; we enlarge each round-arc length by fewer than two words and use flow integrality to route the items.
Lemma C.1 (Flow integrality with prescribed rounding). Let a directed network have integral node demands and integral lower and upper arc bounds. If is a feasible fractional flow, then there is an integral feasible flow satisfying for every arc .
Proof. Tighten each arc's lower and upper bounds to and , respectively. The point remains feasible for this bounded transshipment instance. Since the node-arc incidence matrix is totally unimodular, the corresponding flow polyhedron has an integral vertex whenever the node demands and arc bounds are integral [1]. That vertex is the desired .
Lemma C.2 (Indivisible routing for a fixed input). Fix an input X and normalized public lengths . Suppose X admits a correct divisible routing with flows and states under these lengths, where . Then the integer lengths admit a correct routing of the items with communication at most
In each round r, processor j receives at most words.
Proof. Form a time-expanded network with a node for every and . For each , give communication arc capacity for , and storage arc capacity . Only communication arcs contribute to communication cost. The hat distinguishes these route-local lengths from the message lengths of Section 2.
Integral routing for each key class. Fix . In an independent copy of this network, assign supply to and demand to . These quantities are integral because they are the initial and prescribed terminal item counts. Scaling the divisible routing by gives a feasible fractional transshipment. Communication arc carries , while storage arc carries . The storage-arc value is nonnegative by (Avail), and (Flow) gives flow conservation. Applying Lemma C.1 separately for yields integral flows with the prescribed endpoints, each arc rounded to its floor or ceiling.
Shared messages. The two integral flows fit into the common public messages. On every communication arc, their combined integral flow is at most
Thus, in every round, the public messages can carry the prescribed 0-items and 1-items. Equal-key items may be assigned arbitrarily to the integral flow, and flow conservation ensures that no item is copied or discarded. The terminal counts are exactly the sorted output.
Since , summing over all communication arcs proves the communication bound. Summing the same inequality over proves the receive-load bound.
C.2 Compiling a Route-LP solution into an oblivious algorithm
Fix S as in Lemma 5.7 and use the rounded public lengths from Lemma C.2. The algorithm has three phases.
-
Count collection and route construction. In one fixed-length round, every other processor sends its local zero count to processor 1. From the resulting , the coordinator constructs a divisible route by Lemma 5.3 and integral flows by Lemma C.2.
-
Instruction distribution. In one fixed-length round, the coordinator sends each other processor a complete table of item counts, one for each round, outgoing destination, and key class. The entries follow a fixed public order and include zero counts.
-
Routing rounds. In each route round , which is global BSP round , processor sends exactly words to every , following its instructions. Thus the notation of Section 2 satisfies during this phase.
Analysis. Lemmas 5.3 and C.2 give an integral routing with the initial placement, exact sorted terminal counts, local availability in every round, and load at most . Thus no item is copied or discarded. The two coordination rounds have input-independent lengths, the route rounds use the public lengths , and fixed tie-breaking makes the construction deterministic and perfectly communication-oblivious.
The execution uses rounds and communicates words, by Lemma C.2 and the coordination cost. Count collection delivers words to the coordinator, and instruction distribution delivers words to each other processor. Taking the maximum with the routing load gives load at most , proving Lemma 5.7.
D Bounds for the Cut-LP
D.1 Cut-LP lower bound
Lemma D.1 (Cut-LP lower bound). For every , .
Proof. For , the constraints for the two singleton cuts give , and hence . Assume henceforth that .
Fix a feasible Cut-LP solution . Zeroing its diagonal preserves feasibility and can only decrease its cost. Choose an integer , and put . For each -subset , the pure input whose zero support is has sorted zero target , and hence both and . The cuts and similarly give .
Set and , so . Average both orientations of the preceding inequalities over all k-subsets . In either orientation, a cross arc is counted in cuts, and an arc internal to is counted in cuts. Therefore
Dividing by gives . Moreover, . Combining the two lower bounds on and minimizing over gives . The two values inside the minimum arise at the only relevant breakpoints: , which gives , and the point where the averaged lower bound on meets , which gives . The same formula also covers , when the averaged inequality is simply .
Finally, , so every feasible Cut-LP solution satisfies . Taking the minimum proves the bound on .
D.2 Exact demand of a cut
The ordered output has a particularly simple effect on cut demand. Recall that and . For , define the canonical left and right vertex subsets by and .
Lemma D.2 (Exact cut demand). For every nontrivial with ,
In particular, . Together with , this determines the demand of every nontrivial cut.
Proof. The pure input with zero support has , whereas the one with zero support has . Hence
Conversely, for a pure input , put . Then . Its positive part is at most . This expression is nondecreasing for and nonincreasing for , so it is at most . Similarly,
which is nondecreasing for and nonincreasing for , and is therefore at most . This proves (4).
Finally, and are disjoint, so , giving .
D.3 Cut-LP upper bound
Lemma D.3 (Cut-LP upper bound). For every , . Moreover, for every , .
Proof. Construction. Partition into the unit intervals for , and represent processor by . Put . Set , and for define
These capacities are nonnegative and symmetric.
Objective value. The processor intervals partition , so for every . Also, . Including the nonnegative diagonal terms in the objective would therefore give . Since those terms are omitted, .
Cut constraints. Next we verify the constraint for every nontrivial cut . By symmetry of and , we may take its cut size to satisfy . Let . For , define the mass of this cut in the -th unit interval by
The cut U remains fixed below, so we abbreviate to .
Write for the normalized cut size; it is also the length of . Set and . Thus .
Because the complement of occupies length in , summing the capacities across the cut gives
The first and last s processor intervals form and . By Lemma D.2,
Reflection of the processor order preserves both the construction and the demand. We may therefore assume that the left intersection is the smaller one.
If , at most of the first unit interval lies outside . If , this prefix contains the entire first unit interval, while at most of the second lies outside it. Consequently, using , we obtain
Feasibility. It remains to show . Put and consider the following ranges of .
- .
(a) Suppose . The applicable demand bound is , and completing squares gives
If , then , and this expression is at least . For , its first term is concave and positive at both endpoints. For , the constraint gives the lower bound
The numerator has positive leading coefficient and negative discriminant.
(b) Suppose . The applicable demand bound is . The quadratic has center , whose first coordinate is smaller than . Its minimum over the half-plane occurs at and gives the same positive lower bound as above.
- . The demand bound is at most . The quadratic has center . Since and , completing squares gives
The numerator is concave and positive at both endpoints of this range.
- . Put , the selected mass in the two outer unit intervals. Direct expansion gives
(a) If , every term on the right is nonnegative, since .
(b) If , the last two terms combine into . This is nonnegative because .
Thus for every nontrivial cut . Hence is Cut-LP feasible, and .
Uniform gap. For , the construction gives . For , the certified values 1, 1, 6/5 in Table 1 give the same claimed gap.