editors: nobody
letεε
allowdisplaybreaks[2]
# An FPRAS for Cell-Bounded Contingency Tables
maketitle
Abstract:
We give a fully polynomial randomized approximation scheme (FPRAS)
for counting nonnegative integer matrices with prescribed row sums,
column sums, and individual entry bounds. Both dimensions vary, all
numerical data are encoded in binary, and zero bounds (forbidden
entries) are allowed. The algorithm uses only independent unbiased
random bits, and a single fixed polynomial in the input length, in
1/ε, and in log(1/delta) bounds its total bit operations
on every execution, including executions whose numerical output
falls outside the requested relative interval. The same argument
yields an FPRAS and an almost-uniform sampler for bounded integral
single-commodity flows in arbitrary explicitly listed networks.
# Conventions
addcontentsline{toc}{section}{Conventions}
Three conventions recur. Every count is an integer; every capacity is
written in binary; every randomized procedure draws only independent
unbiased bits (``fair coins'') and runs for a deterministic number of
steps chosen in advance. A quantity of the form ``1-ε'' is a
relative error, not an absolute one.
# Introduction
The problem.:
A cell-bounded contingency table is a nonnegative integer matrix
with prescribed row sums, prescribed column sums, and prescribed
individual entry bounds. Formally, for positive integers m,n, margins
rinZ_{ge0}^m and cinZ_{ge0}^n of equal total, and
bounds binZ_{ge0}^{mtimes n}, let
Ω(r,c,b)&=Bigl{XinZ_{ge0}^{mtimes n}:;
sum_{j=1}^n X_{ij}=r_i,
sum_{i=1}^m X_{ij}=c_j,
X_{ij}le b_{ij} for all i,jBigr},
Z(r,c,b)&=|Ω(r,c,b)|.
Each table is counted once. A bound b_{ij}=0 forbids the entry; no
positivity is imposed on the support or the margins. In the binary
encoding model a capacity may be exponentially larger than its
description, and both m and n are part of the input. The problem is
to compute Z(r,c,b), or to approximate it well in this model.
A tiny example.:
Take m=n=2, r=(2,1), c=(1,2), and every b_{ij}=2. Writing
X=a&bc&d, the constraints read
a+b=2, c+d=1, a+c=1, b+d=2. Solving gives a=d, c=1-a,
b=2-a with ain{0,1}, so
[
0&21&0,
1&10&1,
]
and Z=2. Real inputs have many rows and columns and astronomically
large capacities.
Why it is hard.:
Deciding whether a feasible table exists is easy: build a directed
network with a source, the rows, the columns, and a sink; give the
source--row, row--column, and column--sink arcs capacities r_i,
b_{ij}, and c_j; then a feasible table is exactly an integral flow
of value N=sum_i r_i=sum_j c_j, and Edmonds--Karp decides
feasibility in time polynomial in the number of bits of the
input (see [cite]). Counting is different. Dyer, Kannan, and
Mount cite[Theorem~1]{DKM1997} proved that exact counting is
#P-completermP-complete already for two rows, so no exact
polynomial-time algorithm is expected. An approximation is still
possible; that is the object of an FPRAS.
What an FPRAS is.:
An FPRAS for Z receives the data together with rational
ε,deltain(0,1) and returns a nonnegative rational
ZZhat with
[
P((1-ε)ZleZZlehat(1+ε)Z)ge1-delta.
]
``Fully polynomial'' means the running time is bounded by a fixed
polynomial in the number of bits L of the input (including the
encodings of ε and delta), in 1/ε, and in
log(1/delta) -- never in 1/delta or in the numeric capacities
themselves. Bit complexity is the strict form of this demand: an input
that names a cap of 2^{100} must cost polynomial time in the roughly
100 digits, not 2^{100} steps. Most naive approaches fail exactly
here.
The main result.:
The paper proves the following.
There is one randomized algorithm with the following guarantee. Given
(r,c,b) as above and rational ε,deltain(0,1), it outputs
a nonnegative rational ZZhat such that
[
P((1-ε)Z(r,c,b)leZZhat
le(1+ε)Z(r,c,b))ge1-delta.
]
If Ω(r,c,b) is empty, the output is 0 on every execution. The
algorithm uses independent unbiased bits, and one fixed polynomial in
L, ε^{-1}, and log(delta^{-1}) bounds its total bit
operations on every execution, where L is the total binary input
length, including the accuracy parameters. No counting or sampling
oracle is required.
The theorem allows arbitrary cell bounds and margins: no fixed number of
rows or columns, no lower bound on positive capacities, no density or
balance assumption. Its running-time guarantee covers preprocessing,
random-bit generation, rational arithmetic, and output, even on
executions in the failure event. The polynomial exponents are
deliberately generous; the content is a uniform complexity guarantee,
not a practical running-time estimate.
A second result: flows.:
Section~sec:flows records a consequence for integer flows. For an
explicitly given directed multigraph with finite integer arc bounds and
prescribed vertex balances, a single bijection to a cell-bounded table
transfers Theorem~thm:main, yielding both an FPRAS for the number
of feasible integral flow vectors and a sampler that is within total
variation tau of uniform at cost polynomial in the input length and
tau^{-1}.
History and significance.:
The enumeration of fixed-margin arrays is classical in statistics and
combinatorics; Diaconis and Gangolli [cite] survey its methods.
Ordinary contingency tables are the special case of (eq:feasible-set)
in which the margins force X_{ij}lemin{r_i,c_j}; even these are
#P-completermP-complete to count exactly for two rows [cite].
Approximate counting is nevertheless efficient under broader conditions
than exact counting. For ordinary tables, Dyer, Kannan, and Mount
[cite] gave geometric sampling and counting for sufficiently
large margins, and Morris [cite] weakened the required margin
bounds. Dyer and Greenhill [cite] handled arbitrary two-row
margins. Cryan and Dyer [cite], and later Dyer [cite],
obtained an FPRAS for a fixed number of rows, and Gopalan, Klivans,
Meka, v{S}tefankoviv{c}, Vempala, and Vigoda [cite] gave a
deterministic FPTAS for a fixed number of rows. These results already
accept binary-encoded margins; their restriction is on the number of
rows or on the sizes of the margins, not on the encoding.
Individual caps connect the table problem to several other models. When
every cap is 0 or 1 the table is a subgraph of the allowed bipartite
graph with prescribed degrees; Jerrum, Sinclair, and Vigoda
[cite] give an FPRAS for this whole case, and all-one margins
give perfect matchings. Bez'akov'a, Bhatnagar, and Vigoda
[cite] gave a direct annealing algorithm for binary tables.
More generally, capped tables are integral flows in a bipartite network:
Cryan, Dyer, and Randall [cite] gave an FPRAS for integral flows
with sufficiently large tight capacities, and for cell-bounded tables
with a fixed number of rows and arbitrary positive margins and caps.
They identified unrestricted approximation as an open problem. Their
tight-capacity reduction and maximum-capacity spanning-tree
representation are the direct antecedents of the large-cell construction
here; a forest and soft constraints let us accommodate arbitrary
mixtures of small and large bounds, with both dimensions variable and
zero bounds permitted.
Convex optimization gives complementary estimates. Barvinok
cite[Theorem~1.3]{Barvinok2009} bounds ordinary weighted table counts,
including forbidden cells, within a factor N^{O(m+n)} where N is the
total margin; Barvinok, Luria, Samorodnitsky, and Yong [cite]
obtain relative approximations in complexity N^{O(log N)} for
specified smooth-margin classes. This scale is quasipolynomial in the
numeric total, not in its binary length. Br"and'en, Leake, and Pak
cite[Theorem~2.1]{BLP2021} give capacity bounds for arbitrary
individual caps with explicit multiplicative factors in the margins and
dimensions. Theorem~thm:main, by contrast, delivers any requested
relative tolerance in polynomial binary time with no smoothness
assumption. The geometric object here is the set of all integer points
of a transportation polytope, not only its vertices (for instance the
2times2 tables with every margin equal to two form a segment with
three integer points and two vertices); Guo and Jerrum
cite[Proposition~4.2]{GJ2023} treat vertices of promised 0/1
polytopes from network matrices, a different scope. Counting also
yields sampling by self-reduction cite[Theorem~6.3]{JVV1986}, which
Section~sec:flows carries out by bisecting cell intervals with
exact feasibility tests at every branch.
Organization.:
Section~sec:scales performs the deterministic reductions, splits
cells into small and large, builds the maximum-capacity forest and the
soft penalty D, and defines the softened counts h_j and C(j), with
the contamination bound as its goal. Section~sec:integer-signatures
proves the integer summation lemma and the log-concavity of tree
marginals, and thereby completes the proof of the contamination bound.
Section~sec:signatures introduces the paired binary encoding, the
two factorial lifts f_j and widetilde f_j, their quadratic
signature properties, and the defect-mass ineualities.
Section~sec:transport builds the enlarged Metropolis chain and
proves the one-hole transport, transversal-variance, defect-mean,
observable-variance, time-average, and trace-mixing bounds.
Section~sec:evaluation gives the bounded weight-evaluation
procedure via bins, the Pr'ekopa--Leindler interpolation ineuality, the
bin conductance bound, and the finite-bit uniform-draw lemma.
Section~sec:algorithm assembles the annealing algorithm, proves
the reference-experiment accuracy, couples the bounded implementation to
it, and proves Theorem~thm:main by amplification.
Section~sec:flows proves the flow corollary.
Conventions.:
All logarithms with subscript 2 are binary; log without a subscript
in exponent estimates is natural. A symmetric matrix has
at most one positive eigenvalue when its positive inertia index
is at most one, counting multiplicity; this property of quadratic forms
is preserved by restriction and by limits. A sum over edges in a
Dirichlet form is over unordered edges unless stated otherwise. Every
lceil·rceil and floor(·) of a binary logarithm used
for parameters or bit counts is computable by integer shifts and
comparisons. The large matrices, conditioning trees, and transport
flows that appear in proofs are analytic devices: the algorithm never
forms them.
# Tight capacities and two scales
This section performs the deterministic reductions and sets every
polynomial parameter that the rest of the proof uses. The plan is
fixed once and for all: first make each cell bound tight (its
two endpoints attained), then split the remaining cells by size into a
polynomially bounded small part and a large part handled
by a spanning forest, then attach a soft penalty that measures how far
a candidate completion is from being a genuine table. The use of tight
capacities and a maximum-capacity spanning forest follows the
representation of integral flows in [cite], but the estimates
below allow both dimensions and all capacities to vary.
## Feasibility, tightening, and parameters
Feasibility is a flow question.:
Form a directed network with a source sigma, the row vertices, the
column vertices, and a sink tau. Give the source--row arcs
capacities r_i, the row--column arcs capacities b_{ij}, and the
column--sink arcs capacities c_j. An integral flow of value
N=sum_i r_i=sum_j c_j is exactly a feasible table: at that value
every arc incident to the source or the sink is saturated, and the
row--column values are the table entries. The shortest-augmenting-path
algorithm of Edmonds and Karp cite[Theorem~1]{EK1972} uses O(VE)
augmentations, where V and E are the numbers of vertices and arcs;
the present network is simple, so E=O(V^2) and the augmentation count
is O(V^3), independent of the numerical capacities. Each augmenting
path is found by breadth-first search in O(V+E) operations, and
starting from the zero flow, augmentation by the minimum residual
capacity preserves integrality. All flow and residual-capacity values
have polynomial binary length, so this is a deterministic
polynomial-bit feasibility test for the present network. If the input
is infeasible the final algorithm returns zero; we now suppose it is
feasible.
Tightening.:
For a feasible input let ell_s and u_s be the minimum and the
maximum feasible integer values of cell s=(i,j). Each extremum is
computable by binary search using flow feasibility with one additional
upper or lower bound: a lower bound is subtracted from its cell and
from the two incident margins before the flow test, and a negative
# ^C interrupted by user!