Multi-pass streaming algorithms give protocols #
A deterministic multi-pass streaming algorithm (Cslib.Streaming.MultiPass σ α β) reads the
stream s several times from left to right. It is a one-pass algorithm
(Cslib.Streaming.Algorithm) whose memory state is kept from one pass to the next, with
endPass applied at the end of each pass, so that it can for instance count its passes; after p
passes it reports the output of its state (Cslib.Streaming.MultiPass.run). Its memory is
measured as for one pass: A.SpaceLE p m b says that the states it holds between items during
p passes over streams of at most m items have an injective b-bit encoding. The state after
endPass of the last pass is not counted: it is only used for the answer. A one-pass algorithm is
the case p = 1 (Cslib.Streaming.Algorithm.run_toMultiPass,
Cslib.Streaming.Algorithm.spaceLE_toMultiPass_iff).
Simulation. For $p \ge 1$ passes, with the stream split as u x ++ v y, Alice runs each pass
on u x and sends the b-bit encoding of the memory state to Bob, who continues the pass on v y
and, except after the last pass, sends the encoding of the resulting state back
(Cslib.Streaming.MultiPass.toProtocol). This takes p messages from Alice and $p-1$ from Bob, so
if the answer on u x ++ v y determines f x y, then f has a deterministic protocol with
$(2p-1)b+1$ bits
(Cslib.Streaming.MultiPass.ecomplexityFun_le_of_spaceLE), and, for randomized multi-pass
algorithms with public randomness, a public-coin protocol with the same error
(Cslib.Streaming.MultiPass.Randomized.ecomplexityFun_le_of_spaceLE). This extends the one-pass
reduction of Alon, Matias and Szegedy [AlonMatiasSzegedy1999, Section 3]
(CslibFrontier.Computability.Streaming.Communication) to p passes. The p-pass simulation
itself is standard: Bar-Yossef, Jayram, Kumar and Sivakumar carry it out for several players
[BarYossefJayramKumarSivakumar2004, proof of Theorem 3.1], Chang and Kannan describe it with
$2p-1$ messages of at most $b$ bits each [ChangKannan2006, proof of Theorem 5.1], and Abboud,
Censor-Hillel, Khoury and Paz state it as a theorem, with the asymptotic bound
$pb = \Omega(\mathrm{CC}(f))$ [AbboudCensorHillelKhouryPaz2021, Theorem 14]. The exact constants
here are proved directly. Since later passes depend on
the whole stream, the whole stream u x ++ v y must have at most m items, whereas one pass only
needs this of u x; so for p = 1 the one-pass theorem is slightly stronger.
Main definitions #
Cslib.Streaming.MultiPass: deterministic multi-pass streaming algorithms, withCslib.Streaming.MultiPass.passesandCslib.Streaming.MultiPass.run.Cslib.Streaming.MultiPass.reachable,Cslib.Streaming.MultiPass.SpaceLE: the states reached duringppasses, and memory bounds.Cslib.Streaming.Algorithm.toMultiPass: a one-pass algorithm as a multi-pass one.Cslib.Streaming.MultiPass.toProtocol: the protocol simulatingppasses, for $p \ge 1$.Cslib.Streaming.MultiPass.Randomized,Cslib.Streaming.MultiPass.Randomized.SpaceLE: randomized multi-pass algorithms with public randomness, and their memory.
Main results #
Cslib.Streaming.Algorithm.spaceLE_toMultiPass_iff: the memory of a one-pass algorithm is its memory as a multi-pass algorithm making one pass.Cslib.Streaming.MultiPass.SpaceLE.mono: memory bounds for longer streams and more passes give memory bounds for shorter streams and fewer passes.Cslib.Streaming.MultiPass.depth_toProtocol_le,Cslib.Streaming.MultiPass.run_toProtocol: the simulation of $p \ge 1$ passes sends $(2p-1)b+1$ bits and answers as the algorithm.Cslib.Streaming.MultiPass.ecomplexityFun_le_of_spaceLE,Cslib.Streaming.MultiPass.Randomized.ecomplexityFun_le_of_spaceLE:p-pass streaming memory bounds deterministic and public-coin communication, for $p \ge 1$.
References #
- N. Alon, Y. Matias, M. Szegedy, The space complexity of approximating the frequency moments, Section 3
- Z. Bar-Yossef, T. S. Jayram, R. Kumar, D. Sivakumar, An information statistics approach to data stream and communication complexity, proof of Theorem 3.1, pp. 708–709
- K. L. Chang, R. Kannan, The space complexity of pass-efficient algorithms for clustering, proof of Theorem 5.1, p. 1165
- A. Abboud, K. Censor-Hillel, S. Khoury, A. Paz, Smaller cuts, higher lower bounds, Theorem 14
A deterministic multi-pass streaming algorithm: a one-pass algorithm whose memory state is
kept from one pass over the stream to the next, with endPass applied at the end of each pass.
Memory bounds for longer streams and more passes give memory bounds for shorter streams and fewer passes.
One pass of A.toMultiPass is a run of A.
In one pass, A.toMultiPass reaches the states that A reaches.
A.toMultiPass uses b bits of memory in one pass exactly when A does.
The protocol simulating the last n + 1 passes, starting from the state q that both players
know. Alice continues the pass from q on u x and sends the encoded state; Bob decodes it and
finishes the pass on v y. After the last pass Bob announces d of the answer; otherwise he sends
the encoded state, and the simulation continues from its decoding.
The protocol in which Alice and Bob simulate p passes of A over u x ++ v y, exchanging the
b-bit encoding of the memory state, and Bob announces d of the answer. This is meant for
$p \ge 1$, which Cslib.Streaming.MultiPass.run_toProtocol and
Cslib.Streaming.MultiPass.depth_toProtocol_le assume: for p = 0 the truncated subtraction
p - 1 = 0 makes it the protocol for one pass, so it does not simulate A.run 0.
The simulation of p passes sends $(2p-1)b+1$ bits.
When enc is injective on the states reachable during p passes over streams of length at most
m, and the stream u x ++ v y has length at most m, the simulation answers as the algorithm.
Multi-pass streaming space bounds communication (deterministic): if, for $p \ge 1$, a
p-pass streaming algorithm with b bits of memory on streams of length at most m decides
f x y from its answer on the stream u x ++ v y, which has length at most m, then f has a
deterministic protocol with $(2p-1)b+1$ bits.
Randomized multi-pass algorithms #
A randomized multi-pass streaming algorithm with public randomness: a distribution over
deterministic ones. As for one pass (Cslib.Streaming.Randomized), the random choices are not
charged to the memory.
Every algorithm that μ can draw uses at most b bits of memory during p passes over streams
of length at most m.
Multi-pass streaming space bounds communication (public coins): if, for $p \ge 1$, a
randomized p-pass streaming algorithm μ whose algorithms use at most b bits of memory on
streams of length at most m decides f x y with error ε from its answer on u x ++ v y, which
has length at most m, then f has a public-coin protocol with error ε and $(2p-1)b+1$ bits.