---
title: Deterministic Optimal Rounding
url: https://www.emergentmind.com/topics/deterministic-optimal-rounding
type: topic
---

# Deterministic Optimal Rounding

Deterministic optimal rounding refers to the process of converting a set of real values, typically subject to global constraints (such as integer-sum or feasibility in an integer program), into integers in a manner that minimizes a well-specified objective—most often an error norm—while abiding by the constraints. Unlike traditional threshold or stochastic approaches, deterministic optimal rounding guarantees both constraint satisfaction and minimization of overall rounding error via an efficiently computable, non-random procedure, and occupies a central role in numerical optimization, combinatorial optimization, and the theory of pseudodeterministic algorithms.

## 1. Problem Definition: Optimal Rounding under Integer Constraints

Let $y = (y_1, \dots, y_N) \in \mathbb{R}^N$ satisfy a global integer constraint $\sum_{i=1}^N y_i = S \in \mathbb{Z}$. For any $p > 1$, the **deterministic optimal rounding** problem seeks
\[
x^* = \arg\min_{x \in \mathbb{Z}^N,\, \sum_i x_i = S} \sum_{i=1}^N |x_i - y_i|^p
\]
That is, find integer vectors $x$ with $\sum_i x_i = S$ minimizing the $L^p$-norm error to $y$. The constrained $L^p$-error is denoted
\[
V_p(y) = \min_{x\in\mathbb{Z}^N,\, \sum x_i=S} \sum_{i=1}^N |x_i-y_i|^p
\]
A key structural result is that each $x_i^* \in \{\lfloor y_i\rfloor,\,\lceil y_i\rceil\}$, reducing the solution space to subsets of size $K = S - \sum_i \lfloor y_i\rfloor$ (the integer shortfall) [1501.00014]. The problem is thus combinatorial but amenable to efficient solution.

## 2. Structural Insights and the ORIC Algorithm

The main insight (Proposition 1 in [1501.00014]) is that in any minimizer, each coordinate is rounded either up or down. With $f_i = y_i - \lfloor y_i \rfloor$, let $m_i = \lfloor y_i \rfloor$, and set $K = S - \sum_i m_i$. The optimal integer vector rounds $K$ coordinates up to $\lceil y_i \rceil$ and the rest down. To minimize the $L^p$ error, select the $K$ largest $f_i$ to round up.

This yields the **Optimal Rounding under Integer Constraints (ORIC)** algorithm:
1. Compute $m_i = \lfloor y_i \rfloor$, $f_i = y_i - m_i$
2. Compute $K = S - \sum_i m_i$
3. Sort the $f_i$ in descending order (break ties by $m_i$ descending for a canonical minimizer)
4. Assign $x_i = m_i+1$ for the top $K$ indices and $x_i=m_i$ for the rest
5. Output $x \in \mathbb{Z}^N$ with $\sum x_i = S$, guaranteeing minimum $L^p$ error

The entire procedure runs in $O(N\log N)$ time due to the sort step. The algorithm is exact, deterministic, and its solution is unique minimizing the $L^p$ error among all feasible integer vectors [1501.00014].

## 3. Comparison to Stochastic and Heuristic Rounding

- **Classical threshold rounding** might round $i$ up if $f_i \ge q$ for some fixed $q \in [0,1]$, but in general this fails to achieve the sum constraint for arbitrary $y$.
- **Randomized rounding** independently rounds $i$ up with probability $f_i$, ensuring expectation but yielding only a probabilistic match to the sum and typically yielding biased estimators of the optimal $x^*$.
- In contrast, deterministic optimal rounding produces the *unique* unbiased minimizer of total $L^p$ error and always satisfies the sum constraint [1501.00014].

The following table captures key distinctions:

| Scheme         | Sum-Constraint Satisfied | Minimizes $L^p$ error | Bias                | Complexity   |
|----------------|-------------------------|----------------------|---------------------|--------------|
| Threshold      | No (in general)         | No                   | Yes (to $y$)        | $O(N)$       |
| Randomized     | In expectation          | No                   | Yes (in mean)       | $O(N)$       |
| Deterministic Optimal (ORIC) | Always            | Yes                  | No (to $y$), but unbiased among minimizers | $O(N\log N)$ |

## 4. Relationship to High-Dimensional and Geometric Rounding

Deterministic rounding admits a geometric interpretation: For $y \in \mathbb{R}^d$, rounding can be viewed as a partitioning of $\mathbb{R}^d$ (“secluded partitions”) such that no small $\ell_\infty$-ball intersects too many cells. A $(k,\varepsilon)$-secluded partition associates every $y$ to a cell (rounded value), so any ball of radius $\varepsilon$ hits at most $k$ values. Explicit, efficiently computable $(d{+}1, 1/2d)$-secluded partitions exist and are optimal up to constants [2304.04837, 2211.02694]. The design of deterministic rounding schemes in high dimension is therefore closely tied to geometric bounds on partitions.

Lower bounds show any deterministic, bounded-diameter rounding scheme with $k$ outputs must have granularity $\varepsilon=O(1/d)$. Constructions using reclusive matrices yield matching upper bounds [2211.02694].

## 5. Algorithmic Variants and Extensions

- **Generalization to arbitrary $p>1$**: The ORIC approach relies on convexity and extends to any strictly convex norm; the greedy selection of largest $f_i$ remains optimal [1501.00014].
- **Ties in $f_i$**: Any subset among tied $f_i$ yields the same $L^p$ error; for a canonical (e.g., minimum relative-error) output, sort also by $m_i$ decreasing.
- **Edge cases**: When $y$ is already integer, $K=0$ and the original vector is optimal.

Other extensions appear in high-dimensional rounding for pseudodeterministic or distributed settings (see [2209.11651, 2105.01615]).

## 6. Applications and Context

**Integer Programming**: For solving relaxed LPs and rounding back to feasible integral points while controlling $L^p$ error, deterministic optimal rounding provides a critical rounding step without sacrificing the global constraint.

**Apportionment and Resource Allocation**: Problems such as apportioning seats by proportional votes or distributing budget subject to integer constraints are solved optimally with ORIC (recovering the Hare–Niemeyer largest-remainders rule, but now with $L^p$-optimality) [1501.00014].

**Statistical Rounding**: Used in financial settings for rounding floating-point numbers to fixed denominators (e.g., cents) while maintaining overall totals and accuracy.

**Distributed and Dynamic Graph Algorithms**: Deterministic rounding underpins distributed algorithms for matching, independent sets, and set cover, with polylogarithmic round-complexity matching randomized methods in several regimes [1703.00900, 2209.11651, 2105.01615, 2306.11828].

**High-Dimensional Clustering and Pseudodeterminism**: Geometric interpretations lead to derandomization tradeoffs and bounds for pseudodeterministic algorithms in estimation and learning [2304.04837, 2211.02694].

## 7. Limitations and Theoretical Barriers

The tradeoff between granularity and number of outputs is inherent: No deterministic rounding scheme with output degree $k$ and cell diameter $\le1$ can ensure any $\ell_\infty$-ball of radius $\varepsilon$ meets fewer than $k \ge (1+2\varepsilon)^d$ outputs [2304.04837]. For $k$ polynomial in $d$, $\varepsilon = O((\log d)/d)$. In the integer-sum constraint setting, deterministic optimal rounding is subject to these lower bounds when generalized to high dimension.

Randomized or pseudodeterministic schemes can achieve coarser granularity but only in expectation and with increased complexity or with non-deterministic output. In contrast, deterministic optimal rounding yields tight $L^p$-error minimization and is computationally efficient, but faces hard lower bounds on output granularity and degree in high dimensions [2304.04837, 2211.02694].

Source: https://www.emergentmind.com/topics/deterministic-optimal-rounding