Lower Bounds on Near Neighbor Search via Metric Expansion

Rina Panigrahy, Kunal Talwar, Udi Wieder

Introduction

In the Nearest Neighbor Problem we are given a data set of nn points x1,...,xnx_{1},...,x_{n} lying in a metric space VV. The goal is to preprocess the data set into a data structure such that when given a query point y∈Vy\in V, it is possible to recover the data set point which is closest to yy by querying the data structure at most tt times. The goal is to keep both the querying time tt and the data structure space mm as small as possible. Nearest Neighbor Search is a fundamental problem in data structures with numerous applications to web algorithms, computational biology, information retrieval, machine learning, etc. As such it has been researched extensively.

There is a substantial body of work on lower bounds covering various metric spaces and parameter settings; we discuss the known bounds in Section 1.3. Traditionally, cell probe lower bounds for data structures have been shown using communication complexity arguments . Pătraşcu and Thorup use a direct sum theorem along with the richness technique to obtain lower bounds for deterministic algorithms. Andoni, Indyk and Pătraşcu showed randomized lower bounds using communication complexity lower bounds for Lopsided Set Disjointness. In a previous work , the authors used a more direct geometric argument to show lower bounds for randomized algorithms for the search version of the problem.

In this work we strengthen and significantly generalize our previous results. We give a common framework that unifies almost all known cell probe lower bounds for near neighbor search. At one extreme, it gives us the communication complexity lower bounds, and implies e.g. the result of . At the other extreme, we get direct data structure lower bounds leading to a strengthening to the decision problem of our results in . Our work in fact shows that all near neighbor lower bounds follow from basic expansion properties of the metric space. Vertex expansion translates to lower bounds for deterministic data structures. Edge expansion can be translated to lower bounds for randomized data structures, and this lets us strengthen . We also identify a new (to our knowledge) graph parameter that interpolates between vertex and edge expansion, that we call robust expansion. We show that robust expansions suffices to prove NNS lower bounds. Additionally, for random inputs in highly symmetric metrics, robust expansion also translates to upper bounds in the cell probe model, that match our lower bounds for constant tt. Finally, we present a natural conjecture regarding the complexity of approximate near neighbor search and show tight bounds for dynamic low contention data structures.

The Near Neighbor Problem is parameterized by a number rr. As in the Nearest Neighbor Search Problem the input to the preprocessing phase is a data set of nn points in a metric space. Given a query point yy the goal is to determine whether the data set contains a point of distance at most rr from yy. In the approximation version (ANNS) the preprocessing phase receives as input also an approximation ratio cc. Given a query point yy the goal is to differentiate between the case where the closest data set point is of distance at most rr from yy, to the case where the closest data set point is of distance at least crcr from yy. Clearly a lower bound for these problems holds also for nearest neighbor search.

We prove lower bounds for a generalization we call Graphical Neighbor Search (GNS) which we define shortly. We then show that lower bounds on GNS imply ANNS lower bounds. In the GNS problem we are given an undirected bipartite graph G=(U,V,E)G=(U,V,E) where the data set comes from UU and queries come from VV. For a node uu the set N(u)N(u) denotes its neighbors in GG. In the preprocessing phase we are given a set of pairs (x1,b1),…,(xn,bn)(x_{1},b_{1}),\ldots,(x_{n},b_{n}) where xix_{i} is a vertex in UU and bi∈{0,1}b_{i}\in\{0,1\}. The goal is to build a data structure such that given a node y∈Vy\in V, if there is a unique ii such that y∈N(xi)y\in N(x_{i}) then it is possible to query the data structure tt times and output bib_{i}. If there is no such ii or it is not unique any output is considered correct.

We observe that ANNS reduces to GNS when assuming a query point is at distance at most rr from some xix_{i} and a least crcr from all other xjx_{j}. In this case we have the nodes of UU and VV correspond to the points in the metric space, and the set of edges consists of all pairs of nodes at distance at most rr. A formal reduction is proven in Section 4 where we also show that average instances of ANNS translate to average instances of GNS for which our lower bounds hold. The bounds we show depend only on the expansion properties of GG. We need the following definitions:

Let μ\mu be a probability measure over UU and ν\nu be a probability measure over VV. The δ−\delta-vertex expansion of the graph with respect to μ,ν\mu,\nu is defined as

The vertex-expansion Φv\Phi_{v} is defined as the largest kk such that for all δ≤12k\delta\leq\frac{1}{2k}, Φv(δ)≥k\Phi_{v}(\delta)\geq k.

Let A⊂VA\subset V, B⊂UB\subset U and δ=ν(A)\delta=\nu(A). Observe that if E(A,B)=E(A,U)E(A,B)=E(A,U) then μ(B)≥Φv(δ)ν(A)\mu(B)\geq\Phi_{v}(\delta)\nu(A). In other words Φv(δ)\Phi_{v}(\delta) bounds the measure of the sets that cover all the edges incident on a set of measure δ\delta. The notion of robust expansion relaxes this by requiring BB to cover at least a γ\gamma-fraction of the edges incident on AA. This idea is captured in the definition below. For simplicity we assume that V=UV=U and that μ\mu and ν\nu are the uniform distribution and that GG is regular. A more subtle definition which takes into account other measures is presented in Section 3.

GG has robust-expansion Φr(δ,γ)\Phi_{r}(\delta,\gamma) if ∀A,B⊆V\forall A,B\subseteq V satisfying ∣A∣≤δ∣V∣,∣B∣≤Φ(δ,γ)∣A∣|A|\leq\delta|V|,|B|\leq\Phi(\delta,\gamma)|A|, it is the case that ∣E(A,B∣∣E(A,V)∣≤γ\frac{|E(A,B|}{|E(A,V)|}\leq\gamma. Note that Φr(δ,1)=Φv(δ)\Phi_{r}(\delta,1)=\Phi_{v}(\delta).

2 Our Contributions

In this section we require that the algorithm always output the correct answer. We show time space tradeoffs based on the vertex expansion properties of GG. Our lower bounds are in the average case. Given a distribution μ\mu over UU, a data set is built by sampling nn data set points independently from μ\mu.

Note that in order for the problem to be interesting we must have that N(xi)N(x_{i}) and N(xj)N(x_{j}) are likely to be disjoint. We thus have the following definition:

A distribution μ\mu over UU is said to be strongly independent for GG if

Note that if μ\mu is strongly independent and x1,…,xnx_{1},\ldots,x_{n} are sampled independently by μ\mu then with probability at least 0.990.99 N(xi)∩N(xj)=∅N(x_{i})\cap N(x_{j})=\emptyset for all i≠ji\neq j. In the following mm denotes the number of cells in the data structure and ww denotes the word size in bits, tt is the number of cell probes used by the algorithm.

For a given GG, let μ,ν\mu,\nu be probability measures such that μ\mu is strongly independent, and the vertex expansion with respect to μ,ν\mu,\nu is Φv(⋅)\Phi_{v}(\cdot). Then any deterministic algorithm solving GNS must satisfy the following inequalities

These theorems, combined with known isoperimetric inequalities yield most known cell probe lower bounds for near neighbor problems, and generalize them to general expanding metrics. To see this consider for example the d−d-dimensional hypercube equipped with the Hamming distance. It is shown in , that any deterministic solution for ANNS with approximation 1/ϵ1/\epsilon must satisfy t≥dϵ3/log⁡(mwd/n)t\geq d\epsilon^{3}/\log(mwd/n). This bound can be slightly improved by creating the following GNS instance: Let UU and VV both equal the set of nodes of the hypercube, and let E={(u,v) : ∣u−v∣1≤ϵd}E=\{(u,v)~{}:~{}|u-v|_{1}\leq\epsilon d\}. Let μ\mu and ν\nu be the uniform distribution. Chernoff bounds implies that for d=Ω(log⁡n)d=\Omega(\log n), ∣u−v∣1≥0.49d|u-v|_{1}\geq 0.49d with overwhelming probability, so (G,μ)(G,\mu) is a strongly independent instance. A lower bound on this instance of GNS implies a lower bound on ANNS with approximation 1/ϵ1/\epsilon.

Now we use known isoperimetric properties: Harper’s theorem (see e.g. ) implies that there is a constant a>1a>1 such that Φv≥aϵ2d\Phi_{v}\geq a^{\epsilon^{2}d}. Plugging this in (1) we have that t≥dϵ2log⁡a/log⁡(mwd/n)t\geq d\epsilon^{2}\log a/\log(mwd/n). In Section 4 we discuss how to apply these theorems in greater length.

2.2 Bounds for Randomized Algorithms

Assume that GG is regular. Let xx and zz be vertices drawn uniformly at random, and yy be a random neighbor of xx. We say GG has the property of being weakly independent if Pr⁡[y∈N(z)]≤γ/n\Pr[y\in N(z)]\leq\gamma/n for a small enough constant γ\gamma.

There exists an absolute constant γ\gamma such that the following holds. Any randomized algorithm for a weakly independent instance of GNS which is correct with probability at least half (where the probability is taken over the sampling of the input and the algorithm), satisfies the following inequalities:

As an example, we show in Section 4 that for the Hypercube with E={(u,v) : ∣u−v∣1≤(12−ϵ)d}E=\{(u,v)~{}:~{}|u-v|_{1}\leq(\frac{1}{2}-\epsilon)d\}, the robust expansion Φr(1mt,o(1))≥1mt(1−4ϵ2)\Phi_{r}(\frac{1}{m^{t}},o(1))\geq\frac{1}{m^{t(1-4\epsilon^{2})}}. For d=Ω(log⁡n/ϵ2)d=\Omega(\log n/\epsilon^{2}), the weak independence property is easy to verify. Plugging this into Equations 4, we conclude that m4tϵ2w≥nm^{4t\epsilon^{2}}w\geq n so that m≥(nw)14tϵ2m\geq(\frac{n}{w})^{\frac{1}{4t\epsilon^{2}}}. This result was previously shown by for slightly larger dd.

Our framework suggests a natural conjecture on the complexity of approximate near neighbor problems.

Any randomized tt-probe datastructure for a weakly independent GNS instance must satisfy mwnt≥Φr(1m,12t)Ω(1)\frac{mw}{n}t\geq\Phi_{r}(\tfrac{1}{m},\tfrac{1}{2t})^{\Omega(1)}.

We point out that for some interesting metric spaces such as the Hamming cube and Euclidean space, the known upper bound matches the lower bound in the conjecture for a wide range of parameters. We next present some evidence in support of this conjecture.

2.3 An Upper Bound

There are cases where the bounds above are known to be tight when t=O(1)t=O(1). We show that this is no coincidence: In Section 5 we show that if GG is symmetric, there is an algorithm in the cell probe model that solves random instances of GNS using space that matches the lower bound in equation (4) for t=1t=1.

2.4 Dynamic Data Structure

In the dynamic version of the problem we want the data structure to support the operation of inserting and deleting a point in the data-set. Let tUt_{U} denote the update time. A weaker version of the conjecture is the following:

For any dynamic randomized tt-probe data-structure for weakly independent GNS on nn points, it holds that tUt≥Φr(1ntU,12t)Ω(1)t_{U}t\geq\Phi_{r}(\tfrac{1}{nt_{U}},\tfrac{1}{2t})^{\Omega(1)}

To see why this conjecture follows from the stronger one, observe that a data structure with update time tUt_{U} uses space mw≤ntUmw\leq nt_{U} after nn inserts. We show that this weaker conjecture holds for a restricted family of algorithms which we call low contention; i.e., on those where no memory location of the data structure is accessed by too many query points (see Section 6 for a formal definition). While this may seem like a severe limitation, we remark that known LSH data structures, and our upper bound in Section 5, are in fact dynamic and low contention under our definition.

For any low contention, dynamic tt-probe datastructure for GNS on nn points, the update time is at least Ω(Φr(τ,14t2)/32t4)\Omega\left(\Phi_{r}(\tau,\frac{1}{4t^{2}})/32t^{4}\right).

Plugging in the expansion of the hypercube, we see that for a wide range of parameters Locality Sensitive Hashing is optimal for the class of the low contention dynamic data structures over the hypercube.

3 Related Work

We are aware of only two papers which prove time-space lower bounds for near neighbor problems where both randomization and approximation are allowed.

Andoni, Indyk and Pătraşcu show that for small ϵ>0\epsilon>0, any O(1)O(1)-probe algorithm for (1+ϵ)(1+\epsilon)-approximate near neighbor problem must use space nΩ(1ϵ2)n^{\Omega(\frac{1}{\epsilon^{2}})}. This bound is tight for small enough ϵ>0\epsilon>0 . Panigrahy et al. show that space n1+Ω(1ϵt)n^{1+\Omega(\frac{1}{\epsilon t})} is needed for any algorithm with tt queries and ϵ\epsilon approximation, for the search version of the problem. This bound is tight for constant tt.

With the exception of all previous bounds were proven using communication complexity framework , and in particular the richness lemma.

4 Notation and Preliminaries

A data structure for Graph neighbor search is defined as follows. Given a database of nn points x1,…,xn∈Ux_{1},\ldots,x_{n}\in U, and b1,…,bn∈{0,1}b_{1},\ldots,b_{n}\in\{0,1\} the preprocessing algorithm computes a set of tt tables T1,…,TtT_{1},\ldots,T_{t}, where each table stores mm words of ww bits each. We often call each such word a cell of the table. In practice there is only one table, but for notational convenience and with out loss of generality we let the data structure construct a different table for each query.

The query algorithm is specified by tt lookup functions F1,…,FtF_{1},\ldots,F_{t}, where FiF_{i} takes in the query point yy and (i−1)(i-1) words of ww bits each, and outputs an integer in [m][m], and function F∗:V×(2w)t→{0,1}F_{*}:V\times(2^{w})^{t}\rightarrow\{0,1\}. On a query yy, the data structure looks up c1=T1[F1(y)]c_{1}=T_{1}[F_{1}(y)], c2=T2[F2(y,c1)],…,ct=Tt[Ft(y,c1,…,ct−1)]c_{2}=T_{2}[F_{2}(y,c_{1})],\ldots,c_{t}=T_{t}[F_{t}(y,c_{1},\ldots,c_{t-1})]. Finally it computes F∗(y,c1,…,ct)F_{*}(y,c_{1},\ldots,c_{t}). Note that the lookup functions, FiF_{i}’s and F∗F_{*} are fixed independent of the database, only the tables T1,…,TtT_{1},\ldots,T_{t} can depend on x1,…,xt,b1,…,btx_{1},\ldots,x_{t},b_{1},\ldots,b_{t}. We say the algorithm is non adaptive if the lookup functions are independent of the content of the tables, i.e. of the cc values.

5 Overview of Techniques

The core idea behind our approach is quite simple. We demonstrate it by showing a simple argument that the vertex expansion of GG provides a lower bound on the space of 11-probe data structures for deterministic algorithms. By the definition of vertex expansion, every set of ∣V∣/Φv|V|/\Phi_{v} nodes is incident to at least half of the nodes of GG. Let LL be a uniformly random sample of a 1/Φv1/\Phi_{v} fraction of the cells of the table TT, and let QQ be the set of nodes in VV for which the algorithm probes a cell in LL. Clearly QQ is expected to contain a 1/Φv1/\Phi_{v} fraction of the nodes in GG. Now consider a sample data set (x1,b1),…,(xn,bn)(x_{1},b_{1}),\ldots,(x_{n},b_{n}) where x1,…,xnx_{1},\ldots,x_{n} are randomly sampled nodes in the graph and b1,…,bnb_{1},\ldots,b_{n} are random bits. With overwhelming probability at least a quarter of the xix_{i}’s have a neighbor in the set QQ, and thus the random bits associated with these points should be retrievable from the contents of LL alone. We conclude that the total number of bits in LL is at least n/4n/4 and thus the space of the data structure is at least nΦv/4n\Phi_{v}/4 bits.

This basic sampling approach for 11-probe data structures can be extended to tt-probe data structures in two different ways.

Cell Sampling: Here we sample a Φv−1t\Phi_{v}^{-\frac{1}{t}} fraction of the cells in each table. Thus a 1/Φv1/\Phi_{v} fraction of VV is expected to access only the sampled cells. This immediately gives bound (1) for non-adaptive algorithms.

Path Sampling: Here we sample a path as follows: we pick a cell randomly from the first table so that a 1m\frac{1}{m} fraction of the vertices Q1Q_{1} lookup this cell. Then we sample a cell from the second table in such a way that a 1m\frac{1}{m} fraction of Q1Q_{1} looks up this cell in the second read, and so on. This immediately leads to the lower bound in (2) for non-adaptive algorithms.

We remark that the path sampling approach actually leads to communication complexity lower bounds for the 2-player version of the problem where Alice has the query point and Bob has the database. Any tt-probe data structure with mm cells of ww words each implies the existence of a tt-round communication protocol where Alice sends log⁡m\log m bits, and Bob sends ww bits, in each round. A communication protocol has more freedom however; unlike in a data structure, where the same table T2T_{2} is used to answer any second query, in a communication protocol, the message Bob sends in the second round may depend not just on the second message from Alice, but also on the first. Path sampling can be immediately translated to a “transcript sampling” technique and thus gives lower bounds for communication protocols. There is no similarly obvious translation for cell sampling.

We can extend these ideas and provide lower bounds for adaptive algorithms by observing the following two facts. Firstly, for a fixed data structure, the probability over a random data set that the data structure succeeds is exponentially small in nn. On the other hand, the number of bits read by the sampling procedures above is sublinear, thus the number of all possible non-adaptive algorithms is sub exponential. Informally, this allows us to do a union bound over all possible values of the bits read.

In randomized algorithms not all points in N(x)N(x) are good query points for xx. In particular, the specific query point that queries the cells that are sampled may be a point on which the algorithm errs. The notion of shattering plays a major role in extending the bound for this case: Given any fixed partitioning A1,…,AmA_{1},\ldots,A_{m} of VV such that each set is of cardinality O(∣V∣/m)O(|V|/m), a randomly chosen xx has (with high probability) the property that max⁡i∣N(x)∩Ai∣\max_{i}|N(x)\cap A_{i}| is at most ∣N(x)∣/K|N(x)|/K, for a KK that depends on the edge expansion. In other words, N(x)N(x) is shattered by the partitioning. Given that the lookup algorithm is correct for a large fraction of N(x)N(x), shattering suffices to show that the algorithm still gives the right answer for a majority of the points in N(x)N(x) which can be looked up from the cell sample (or the path sample).

In order to prove lower bounds for randomized adaptive algorithms we need to combine the ideas outlined in the two previous paragraphs, which requires more work. Intuitively, for every xx such the N(x)N(x) is shattered, and for any fixed subset N′(x)N^{\prime}(x) on which the algorithm succeeds, the sampling is very likely to recover the correct answer. Moreover, for every collection of bits read, almost all points shatter. While it would be tempting to use a union bound at this point, that does not quite work. Informally, there are dependencies everywhere: the part of N(xi)N(x_{i}) that the algorithm gets right depends on all the other xjx_{j}’s, the bits that are read depend on the sampled cells, etc. The proof carefully defines a notion of shattering that depends only on the xx’s and not on N′(x)N^{\prime}(x)’s and argues (over the randomness in picking the xix_{i}’s) that most points get shattered. Separately, we argue that for a point that gets shattered, and for any fixed N′(x)N^{\prime}(x), the majority answer is correct with high probability (over the sampling procedure alone).

The notion of edge expansion does not quite suffice: for the hypercube when r=(12−ϵ)dr=(\frac{1}{2}-\epsilon)d, for fixed partitioning A1,…,AmA_{1},\ldots,A_{m} of VV into cells of size ∣V∣/m|V|/m, the largest ∣N(x)∩Ai∣/∣N(x)∣|N(x)\cap A_{i}|/|N(x)| is likely to be quite large (≈1mϵ\approx\frac{1}{m^{\epsilon}}), whereas we would need it to be 1mϵ2\frac{1}{m^{\epsilon^{2}}} to get the correct bound. The definition of robust expansion Φr\Phi_{r} comes to our rescue here. We can show that while the largest ∣N(x)∩Ai∣|N(x)\cap A_{i}| is usually large, the large pieces account for a very small fraction of N(x)N(x). In fact, after removing a vanishingly small fraction of ∣N(x)∣|N(x)|, every other piece is only about 1mϵ2\frac{1}{m^{\epsilon^{2}}}. We show that our lower bound proofs are robust enough to handle this weaker notion of shattering.

Deterministic Lower bounds

In this section we prove Theorem 1.4. The analysis of deterministic algorithms involves node expansion and does not require shattering. It allows us to demonstrate the techniques of cell sampling and path sampling in a simple setting.

The following theorem is a restatement of inequality (1)

Let μ\mu be such that (G,μ)(G,\mu) is a strongly independent instance, and Φv\Phi_{v} be the vertex expansion with respect to μ,ν\mu,\nu. Then any deterministic algorithm solving GNS must satisfy (8mwtn)t≥Φv(\frac{8mwt}{n})^{t}\geq\Phi_{v}.

Recall that TiT_{i} represents a table with mm cells, from which the i′thi^{\prime}th query reads, and Fi:V→TiF_{i}:V\rightarrow T_{i} denotes the ii’th lookup function. We will state a procedure that obtains a set of at most tm/Φv1/ttm/\Phi_{v}^{1/t} cells so that at least a 1/Φv1/\Phi_{v} fraction of the query points only access these cells. We call this procedure cell sampling. Note that here this procedure is entirely deterministic. A probabilistic variant is used in the next section.

Cell sampling procedure: The cells are obtained iteratively in tt phases, each phase corresponds to a query of the table. In each phase at most m/Φv1/tm/\Phi_{v}^{1/t} cells are chosen. The first lookup function F1F_{1} induces a partition over VV. The set L1L_{1} is chosen to be the m/Φv1/tm/\Phi_{v}^{1/t} cells in T1T_{1} that maximize ν(F1−1(L1))\nu(F_{1}^{-1}(L_{1})). In other words, the first lookup function partitions VV according to its image in T1T_{1}. We choose L1L_{1} to be the cells corresponding to the m/Φv1/tm/\Phi_{v}^{1/t} largest partitions, as measured by ν\nu. Set Q1⊂VQ_{1}\subset V to be those vertices; i.e. F1−1(L1)F_{1}^{-1}(L_{1}). The selection process continues iteratively in a similar manner. Let LiL_{i} denote the set of cells obtained in the ii’th phase and let Qi⊆VQ_{i}\subseteq V denote the set of vertices that (if given as a query) access only cells in L1,…,LiL_{1},\ldots,L_{i} In the (i+1)(i+1)’th phase we consider Fi+1F_{i+1} and set Li+1L_{i+1} to be the m/Φv1/tm/\Phi_{v}^{1/t} cells with highest measure, where we restrict ν\nu to QiQ_{i}. In other words, when measuring Fi−1(Li+1)F_{i}^{-1}(L_{i+1}) we assign a measure of for vertices outside QiQ_{i}. It is easy to inductively argue that ν(Qi)≥Φv−i/t\nu(Q_{i})\geq\Phi_{v}^{-i/t}, so that ν(Qt)≥1/Φv\nu(Q_{t})\geq 1/\Phi_{v} and thus μ(N(Qt))≥12\mu(N(Q_{t}))\geq\frac{1}{2}.

Intuitively, the set of cells in L1,…,LtL_{1},\ldots,L_{t} encode half of the bib_{i} bits and therefore must contain Ω(n)\Omega(n) bits, which would imply the lower bound. Of course, L1,…,LtL_{1},\ldots,L_{t} depends upon the content of the table which depends upon the points in the data set. These dependencies can be handled by using a union bound over all the possible values of LtL_{t}: To see this, fix the values written in the cells L1,…,LtL_{1},\ldots,L_{t} to some string ω\omega and sample the nn data set points from UU independently according to μ\mu. Let AωA_{\omega} denote the event that when the value of the cells L1,…,LtL_{1},\ldots,L_{t} is ω\omega, an algorithm reading ω\omega succeeds in guessing the bib_{i} bits for the data set points that fall in N(Qt)N(Q_{t}). Note that QtQ_{t} depends only upon ω\omega and that since the procedure of obtaining LtL_{t} is deterministic, the locations of the cells obtained also depends only on ω\omega. Vertex expansion implies that μ(N(Qt))≥12\mu(N(Q_{t}))\geq\frac{1}{2}. Also, since μ\mu is strongly independent and the algorithm is assumed to be correct, Pr⁡[∪ωAω]≥12\Pr[\cup_{\omega}A_{\omega}]\geq\frac{1}{2}. By Chernoff’s bound, the probability that less than n/8n/8 points fall in N(Qt)N(Q_{t}) is at most 2−n/82^{-n/8}. Note that the bib_{i}’s are chosen independently, therefore, for a fixed table, if n/8n/8 points indeed fall in N(Qt)N(Q_{t}), then the probability that the sampled bib_{i}’s match the output of the algorithms is 2−n/82^{-n/8}. We conclude that Pr⁡[Aω]≤2−n/8+2−n/8\Pr[A_{\omega}]\leq 2^{-n/8}+2^{-n/8}. Now, let K=1/Φv1/tK=1/\Phi_{v}^{1/t}. There are 2Kmtw2^{Kmtw} ways of choosing ω\omega, so we must have 21−n/82Kmtw≥122^{1-n/8}2^{Kmtw}\geq\frac{1}{2}. We conclude that Kmtw≥n/8Kmtw\geq n/8 which implies the theorem. ∎

2 Path Sampling

Let μ\mu be strongly independent, and Φv\Phi_{v} be the vertex expansion with respect to μ,ν\mu,\nu, then any data structure with a deterministic querying algorithm must satisfy 9mtwtn≥Φv(1/mt)\frac{9m^{t}wt}{n}\geq\Phi_{v}(1/m^{t}).

The proof is similar to that of Theorem 2.1 with a different choice of parameters. We present it here separately because the two approaches diverge in the next section when we deal with the randomized case. We use the cell sampling technique to select a set of cells from the tables, only this time, each phase we select a single cell from the table (as opposed to selecting mΦv−1/tm\Phi_{v}^{-1/t} cells in Theorem 2.1). We call the approach of sampling a single cell from each table path sampling because we sample a single possible “query path” along the tt tables. We also observe that lower bounds based on this approach imply communication complexity lower bounds.

Now the contents of L1,…,LtL_{1},\ldots,L_{t} are twtw bits, and ν(Qt)≥m−t\nu(Q_{t})\geq m^{-t} so that μ(N(Qt))≥Φv(m−t)m−t\mu(N(Q_{t}))\geq\Phi_{v}(m^{-t})m^{-t}. When fixing the bits of LtL_{t} to be the string ω\omega, the expected number of data set points that fall in N(Qt)N(Q_{t}) is at least nΦv(m−t)m−tn\Phi_{v}(m^{-t})m^{-t}. Define AωA_{\omega} as before and recall that we have Pr⁡[∪Aω]≥12\Pr[\cup A_{\omega}]\geq\frac{1}{2}. Let ZωZ_{\omega} be the number of data set points falling in N(Qt)N(Q_{t}). Chernoff’s bound implies that Pr⁡[Zω≤12nΦv(m−t)m−t]≤2−Φv(m−t)m−t/8\Pr[Z_{\omega}\leq\frac{1}{2}n\Phi_{v}(m^{-t})m^{-t}]\leq 2^{-\Phi_{v}(m^{-t})m^{-t}/8}. Since the string ω\omega now encodes ZωZ_{\omega} random bits, Pr⁡[Aω]≤2−Φv(m−t)m−t/8+2−Φv(m−t)m−t/2\Pr[A_{\omega}]\leq 2^{-\Phi_{v}(m^{-t})m^{-t}/8}+2^{-\Phi_{v}(m^{-t})m^{-t}/2}. There are 2tw2^{tw} ways of choosing ω\omega, so we have 2tw⋅2−Φv(m−t)m−t/8≥122^{tw}\cdot 2^{-\Phi_{v}(m^{-t})m^{-t}/8}\geq\frac{1}{2} which implies the theorem. ∎

Randomized Lower bounds

To prove lower bounds for randomized data structure, we will use Yao’s minimax theorem, and instead show a distribution over instances such that for some constant δ>0\delta>0, any deterministic tt-probe data structure that succeeds with probability (1−δ)(1-\delta) needs large space.

We consider the following randomized version of the Graph Neighbor Search (GNS) problem on a bipartite graph G=(U,V,E)G=(U,V,E). We are given a set of nn tuples (x1,b1),…,(xn,bn)(x_{1},b_{1}),\ldots,(x_{n},b_{n}), where xi∈Ux_{i}\in U and bi∈{0,1}b_{i}\in\{0,1\} to preprocess into a data structure. Then given a query y∈Vy\in V, the query algorithm makes tt probes into the data structure, and is expected to return bib_{i} if xix_{i} is the unique neighbor in GG of yy in {x1,…,xn}\{x_{1},\ldots,x_{n}\} (if there is no unique neighbor, any output is considered valid).

Let G=(U,V,E)G=(U,V,E) be a bipartite graph and let ee be a probability distribution over EE. Let μ(u)=e(u,V)=∑v∈Ve(u,v)\mu(u)=e(u,V)=\sum_{v\in V}e(u,v) be the induced distribution on UU, and let ν(v)=e(U,v)\nu(v)=e(U,v) be the induced distribution on VV. For x∈Ux\in U, we denote by νx\nu_{x} the conditional distribution of the endpoints in VV of edges incident on uu, i.e. νx(y)=e(x,y)/e(x,V)\nu_{x}(y)=e(x,y)/e(x,V).

Suppose we have a graph G=(U,V,E)G=(U,V,E), and the distribution ee on EE. Then (G,e)(G,e) define a distribution over instances of GNS as follows. We select nn points x1,…,xnx_{1},\ldots,x_{n} independently from the distribution μ\mu uniformly at random and pick b1,…,bnb_{1},\ldots,b_{n} independently and uniformly from {0,1}\{0,1\}. This defines the database distribution. To generate the query, we pick an i∈[n]i\in[n] uniformly at random, and sample yy independently from νxi\nu_{x_{i}}.

We say the tuple (G,e)(G,e) satisfies γ\gamma-weak independence (WI) if Pr⁡x,z∼μ,y∼νx[(y,z)∈E]≤γn\Pr_{x,z\sim\mu,y\sim\nu_{x}}[(y,z)\in E]\leq\frac{\gamma}{n}. In other words, WI ensures that with probability (1−γ)(1-\gamma), for the instance generated as above, xx is indeed the unique neighbor in GG of yy in {x1,…,xn}\{x_{1},\ldots,x_{n}\}.

We next define the notion of expansion that we use. Recall that the vertex expansion of a set A⊆VA\subseteq V in an unweighted graph GG is the ratio ∣B∣∣A∣\frac{|B|}{|A|}, where B=N(A)B=N(A) is the smallest set such that all edges incident on AA are captured by BB, i.e. ∣E(B,A)∣=∣E(U,A)∣|E(B,A)|=|E(U,A)|. A relaxation of this definition, which we call γ\gamma-robust expansion, is the ratio ∣B∣∣A∣\frac{|B|}{|A|} where BB is now the smallest set that captures a γ\gamma fraction of the edges incident on AA, i.e. e(B,A)≥γe(U,A)e(B,A)\geq\gamma e(U,A). The following definition generalizes this notion to weighted bipartite graphs.

The γ\gamma-robust expansion of a set A⊆VA\subseteq V is defined as ϕr(A,γ)=defmin⁡B⊆U:e(B,A)≥γe(U,A)μ(B)/ν(A)\phi_{r}(A,\gamma)\stackrel{{\scriptstyle def}}{{=}}\min_{B\subseteq U:e(B,A)\geq\gamma e(U,A)}\mu(B)/\nu(A).

Let ww be an auxiliary weight function on UU with ∑u∈Uw(u)=1\sum_{u\in U}w(u)=1. The γ\gamma-robust expansion with respect to ww is defined as ϕrw(A,γ)=defmin⁡B⊆U:e(B,A)≥γe(U,A)w(B)/ν(A)\phi^{w}_{r}(A,\gamma)\stackrel{{\scriptstyle def}}{{=}}\min_{B\subseteq U:e(B,A)\geq\gamma e(U,A)}w(B)/\nu(A).

We say that (G,e)(G,e) has (β,γ)(\beta,\gamma)-robust expansion ϕrw=ϕrw(β,γ)\phi^{w}_{r}=\phi^{w}_{r}(\beta,\gamma) at least KK if for every subset A⊆VA\subseteq V such that ν(A)≤β\nu(A)\leq\beta, we have ϕrw(A,γ)≥K\phi^{w}_{r}(A,\gamma)\geq K.

For intuition, consider the setting where G=(U,V,E)G=(U,V,E) is derived naturally from an undirected graph H=(VH,EH)H=(V_{H},E_{H}) by making two copies of VHV_{H} and for each edge (u,v)∈EH(u,v)\in E_{H}, placing the edges (u1,v2)(u_{1},v_{2}) and (v1,u2)(v_{1},u_{2}). Formally, UG=VH×{1},VG=VH×{2}U_{G}=V_{H}\times\{1\},V_{G}=V_{H}\times\{2\}, and EH={((u,1),(v,2))∈UG×VG:(u,v)∈EH}E_{H}=\{((u,1),(v,2))\in U_{G}\times V_{G}:(u,v)\in E_{H}\}. Then for any set A⊆VA\subseteq V, we have ϕrw(A,1)=w(N(A))/ν(A)\phi^{w}_{r}(A,1)=w(N(A))/\nu(A), which is the vertex expansion of AA in HH under ν\nu, for w=νw=\nu. Similarly, if a set AA has conductance e(A,Ac)/e(A,VH)e(A,A^{c})/e(A,V_{H}) at most 1−γ1-\gamma, then e(A,A)≥γe(A,V)e(A,A)\geq\gamma e(A,V) so that ϕrw(A,γ)≤w(A)/ν(A)\phi^{w}_{r}(A,\gamma)\leq w(A)/\nu(A). A similar correspondence holds for directed graphs.

A collection A1,…,AkA_{1},\ldots,A_{k} of disjoint subsets of VV is said to be β\beta-sparse with respect to (G,e)(G,e) if max⁡iν(Ai)≤β\max_{i}\nu(A_{i})\leq\beta.

We now recall the notion of strong shattering.

Given (G,e)(G,e) and a collection A1,…,AkA_{1},\ldots,A_{k} of disjoint subsets of VV, we say the collection {Ai}i\{A_{i}\}_{i} KK-strongly shatters a point x∈Vx\in V if max⁡iνx(Ai)≤1K\max_{i}\nu_{x}(A_{i})\leq\frac{1}{K}.

We shall in fact show our lower bounds using a weaker notion of shattering, which allows a small probability mass from νx\nu_{x} to be in AiA_{i}’s with νx\nu_{x} measure larger than 1K\frac{1}{K}. For a real number aa, let (a)+=defmax⁡(a,0)(a)^{+}\stackrel{{\scriptstyle def}}{{=}}\max(a,0) denote the positive part of xx. Note that strong shattering says that each of the νx(Ai)\nu_{x}(A_{i})’s is at most 1K\frac{1}{K} so that ∑i(νx(Ai)−1K)+\sum_{i}(\nu_{x}(A_{i})-\frac{1}{K})^{+} is zero. We relax this condition.

Given (G,e)(G,e) and a collection A1,…,AkA_{1},\ldots,A_{k} of disjoint subsets of VV, we say the collection {Ai}i\{A_{i}\}_{i} (K,γ)(K,\gamma)-weakly shatters a point x∈Vx\in V if ∑i(νx(Ai)−1K)+≤γν(∪iAi)\sum_{i}(\nu_{x}(A_{i})-\frac{1}{K})^{+}\leq\gamma\nu(\cup_{i}A_{i}).

We say a tuple (G,e)(G,e) satisfies the (K,β,γ)(K,\beta,\gamma)-weak shattering (WS) property if for every β\beta-sparse collection A1,…,AkA_{1},\ldots,A_{k} of disjoint subsets of VV,

We record the following implication of weak shattering.

If (G,e)(G,e) satisfies (K,β,γ)(K,\beta,\gamma)-weak shattering property, then it also satisfies (K/⌈β′β⌉,β′,γ)(K/\lceil\frac{\beta^{\prime}}{\beta}\rceil,\beta^{\prime},\gamma)-weak shattering for any β′>0\beta^{\prime}>0.

For β′<β\beta^{\prime}<\beta, there is nothing to prove since every β′\beta^{\prime}-sparse collection is also β\beta-sparse. For β′>β\beta^{\prime}>\beta, we can arbitrarily break each set AiA_{i} into s=⌈β′β⌉s=\lceil\frac{\beta^{\prime}}{\beta}\rceil pieces to derive a β\beta-sparse collection; the shattering follows using the identity (∑i=1sai)+≥∑i=1s(ai)+(\sum_{i=1}^{s}a_{i})^{+}\geq\sum_{i=1}^{s}(a_{i})^{+}. ∎

Let A1,…,AkA_{1},\ldots,A_{k} be a collection of disjoint subsets of VV. Then for any x∈Vx\in V, there is a measure ν^x\hat{\nu}_{x} such that (a) νx\nu_{x} dominates ν^x\hat{\nu}_{x}, i.e. ν^x(A)≤νx(A)\hat{\nu}_{x}(A)\leq\nu_{x}(A) for all A⊆VA\subseteq V, (b) ν^x(Ai)≤1K\hat{\nu}_{x}(A_{i})\leq\frac{1}{K} for all i∈[k]i\in[k], and (c) If xx is (K,γ)(K,\gamma)-weakly shattered, then ν^x(∪Ai)≥νx(∪Ai)−γν(∪Ai)\hat{\nu}_{x}(\cup A_{i})\geq\nu_{x}(\cup A_{i})-\gamma\nu(\cup A_{i}).

Note that ν^\hat{\nu} is not necessarily a probability measure. Intuitively, ν^\hat{\nu} is a part of the measure ν\nu that gets shattered. Such a measure can be obtained by shaving the mass on yy that fall in clusters with large νx\nu_{x} mass.

For each AiA_{i} with νx(Ai)≥1K\nu_{x}(A_{i})\geq\frac{1}{K}, we set ν^x(y)=1Kνx(Ai)νx(y)\hat{\nu}_{x}(y)=\frac{\frac{1}{K}}{\nu_{x}(A_{i})}\nu_{x}(y) for each y∈Aiy\in A_{i}. ν^x(y)\hat{\nu}_{x}(y) is set νx(y)\nu_{x}(y) for the remaining AiA_{i}’s. The dominance is immediate, and the small loss property follows from the fact that ν^x(Ai)=1K\hat{\nu}_{x}(A_{i})=\frac{1}{K} for every AiA_{i} of the first type so that νx(Ai)−ν^x(Ai)=(νx(Ai)−1K)+\nu_{x}(A_{i})-\hat{\nu}_{x}(A_{i})=(\nu_{x}(A_{i})-\frac{1}{K})^{+}. ∎

Finally, we shall use the following simple information-theoretic lemma:

Let δ<14\delta<\frac{1}{4}, and let Enc:{0,1}n→{0,1}NEnc:\{0,1\}^{n}\rightarrow\{0,1\}^{N} and Dec:{0,1}N→{0,1}nDec:\{0,1\}^{N}\rightarrow\{0,1\}^{n} be functions such that ∣b−Dec(Enc(b))∣1<δn|b-Dec(Enc(b))|_{1}<\delta n with probability at least 12\frac{1}{2} when bb is drawn at random. Then there exists a constant r=r(δ)>0r=r(\delta)>0 such that N≥rnN\geq rn, where lim⁡δ→0r(δ)=1\lim_{\delta\rightarrow 0}r(\delta)=1.

Let C⊆{0,1}nC\subseteq\{0,1\}^{n} be a binary error correcting code with positive rate and minimum distance 2δ<122\delta<\frac{1}{2}. Then for a random v∈{0,1}nv\in\{0,1\}^{n}, Cv^={b∈v+C:∣Dec(Enc(b))−b∣1<δn}\hat{C_{v}}=\{b\in v+C:|Dec(Enc(b))-b|_{1}<\delta n\} has expected size 2rn2^{rn} for an r=r(δ)>0r=r(\delta)>0. Since the minimum distance of Cv^\hat{C_{v}} is 2δn2\delta n, the values Enc(b):b∈Cv^Enc(b):b\in\hat{C_{v}} are all distinct, leading to the claim bound. ∎

The lemma can be extended to the setting where the encoder and the decoder share some randomness.

2 Main Result

The main result of this section is the following.

There exists an absolute constant γ\gamma such that the following holds. Let (G,e)(G,e) satisfy γ\gamma-weak independence (WI). Then for t≤n14t\leq n^{\frac{1}{4}}, any deterministic tt-probe data structure for the distribution over GNS instances defined by (G,e)(G,e) that succeeds with probability (1−γ)(1-\gamma) must satisfy

where ww is an arbitrary auxiliary weight function, and tt is o(n14)o(n^{\frac{1}{4}}).

The theorem will follow from Lemma 3.11, and Theorems 3.12 and 3.22 that we prove next.

3 Expansion to Shattering

Let A1,…,AkA_{1},\ldots,A_{k} be a β\beta-sparse collection of disjoint subsets of VV. Then

for K=Φr(β,γ24)γ3/16K=\Phi_{r}(\beta,\frac{\gamma^{2}}{4})\gamma^{3}/16

We will show that if Pr⁡x∼μ[x      \mboxis      (K,γ)\mbox−weaklyshattered]≤(1−γ)\Pr_{x\sim\mu}[x\;\;\;{\mbox{i}s}\;\;\;(K,\gamma){\mbox{-}weaklyshattered}]\leq(1-\gamma), then one of the AiA_{i}’s does not expand enough, thus deriving a contradiction.

Suppose that Pr⁡x∼μ[x      \mboxis      (K,γ)\mbox−weaklyshattered]≤(1−γ)\Pr_{x\sim\mu}[x\;\;\;{\mbox{i}s}\;\;\;(K,\gamma){\mbox{-}weaklyshattered}]\leq(1-\gamma). Thus for at least γ2\frac{\gamma}{2} fraction of xx’s (drawn from μ\mu), νx(∪Ai)≤2ηγ\nu_{x}(\cup A_{i})\leq\frac{2\eta}{\gamma} and yet xx is not (K,γ)(K,\gamma)-weakly shattered. Let BB be the set of such xx’s. In other words, the set BB satisfies

For each x∈Bx\in B, νx(∪Ai)≤2ηγ\nu_{x}(\cup A_{i})\leq\frac{2\eta}{\gamma}.

For each x∈Bx\in B, ∑i(νx(Ai)−1K)+≥γη\sum_{i}(\nu_{x}(A_{i})-\frac{1}{K})^{+}\geq\gamma\eta.

Construct an weighted graph H0H_{0} on B×[k]B\times[k], where we put an edge between (x,i)(x,i) with weight μ(x)νx(Ai)=e(x,Ai)\mu(x)\nu_{x}(A_{i})=e(x,A_{i}) if νx(Ai)≥1K\nu_{x}(A_{i})\geq\frac{1}{K}. Thus eH0(x,i)≤e(x,Ai)e_{H_{0}}(x,i)\leq e(x,A_{i}) so that eH0(B,i)≤ν(Ai)e_{H_{0}}(B,i)\leq\nu(A_{i}).

The (unweighted) degree of each node x∈Bx\in B in H0H_{0} is at most νx(∪Ai)1K≤2ηK/γ\frac{\nu_{x}(\cup A_{i})}{\frac{1}{K}}\leq 2\eta K/\gamma, since each edge incident on xx in H0H_{0} contributes at least 1K\frac{1}{K} to νx(∪Ai)\nu_{x}(\cup A_{i}). Moreover, by the properties of BB above the total edge weight in H0H_{0} eH0(B,[k])e_{H_{0}}(B,[k]) is at least (γ2)(γη)=γ2η2(\frac{\gamma}{2})(\gamma\eta)=\frac{\gamma^{2}\eta}{2}.

Let H1H_{1} be the subgraph of H0H_{0} formed by deleting all nodes i∈[k]i\in[k] such that the total edge weight eH0(B,i)e_{H_{0}}(B,i) incident on ii is at most γ24ν(Ai)\frac{\gamma^{2}}{4}\nu(A_{i}). The total edge weight deleted in the process is at most γ24η\frac{\gamma^{2}}{4}\eta so that the total edge weight in H1H_{1} eH1(B,[k])e_{H_{1}}(B,[k]) is at least γ2η4\frac{\gamma^{2}\eta}{4}.

Let R⊆[k]R\subseteq[k] be the set of nodes on the right surviving in H1H_{1}. Since each node in BB has unweighted degree at most 2ηK/γ2\eta K/\gamma in H1H_{1}, ∑i∈Rw(NH1(i))≤(2ηK/γ)∑x∈Bw(x)≤2ηK/γ\sum_{i\in R}w(N_{H_{1}}(i))\leq(2\eta K/\gamma)\sum_{x\in B}w(x)\leq 2\eta K/\gamma. On the other hand, ∑i∈Rν(Ai)\sum_{i\in R}\nu(A_{i}) is at least the total weight eH1(B,R)e_{H_{1}}(B,R) of edges in H1H_{1} which is lower bounded by γ2η4\frac{\gamma^{2}\eta}{4}. It follows by an averaging argument that there is a node i∗∈Si^{*}\in S such that

Let Bi∗=NH1(i∗)B_{i^{*}}=N_{H_{1}}(i^{*}). Since i∗∈Ri^{*}\in R, we have e(Bi∗,Ai∗)≥γ24ν(Ai∗)e(B_{i^{*}},A_{i^{*}})\geq\frac{\gamma^{2}}{4}\nu(A_{i^{*}}). Since ν(Ai∗)≤β\nu(A_{i^{*}})\leq\beta by assumption,

which contradicts the definition of KK. ∎

4 Path Sampling

In this section, we show the following theorem

There exists a constant γ>0\gamma>0 such that the following holds. Let (G,e)(G,e) satisfy γ\gamma-weak independence (WI) and (K,1mt,γt)(K,\frac{1}{m^{t}},\frac{\gamma}{t})-weak shattering property. Then for t≤n14t\leq n^{\frac{1}{4}}, any deterministic tt-probe data structure for the distribution over GNS instances defined by (G,e)(G,e) that succeeds with probability (1−γ)(1-\gamma) must use space mm at least Ω((nK2/w)1t)\Omega((nK^{2}/w)^{\frac{1}{t}}).

Proof Sketch: Suppose that a datastructure with m<(γ6nK/4t4w)1tm<(\gamma^{6}nK/4t^{4}w)^{\frac{1}{t}} exists that succeeds with probability (1−γ3)(1-\gamma^{3}). We use it construct a randomized encoding and decoding algorithm for a random binary vector b∈{0,1}nb\in\{0,1\}^{n}. We sample x1,…,xnx_{1},\ldots,x_{n} from μ\mu, and build the data structure for the database (x1,b1),…,(xn,bn)(x_{1},b_{1}),\ldots,(x_{n},b_{n}) to get tt tables T1,…,TtT_{1},\ldots,T_{t} where each TiT_{i} contains mm cells of ww bits each.

We show how to sample ss cells from each table, for a suitable ss and let Enc(b,z)Enc(b,z) be the contents of those cells (where zz is used as the randomness to pick the xix_{i}’s and in the sampling process). The decoding algorithm essentially takes the majority answer in νxi\nu_{x_{i}}, restricted to queries that the data structure can answer based on the sampled cells, as its guess for bib_{i}. The success of the data structure, and the WI property, imply that the answer on νxi\nu_{x_{i}} is equal to bib_{i} with probability (1−γ)(1-\gamma), for most xix_{i}’s. We show that the weak shattering property is sufficient to guarantee (using Chernoff bounds) that the majority answer on the restriction of νxi\nu_{x_{i}} is still equal to bib_{i} with high probability. For suitably small γ\gamma, this violates corollary 3.9.

Intuitively, the tt lookup functions break GG into mtm^{t} pieces. We could sample ss of these pieces. If all xix_{i}’s were strongly shattered, each piece has little influence on measure in νxi\nu_{x_{i}} that can be looked up from the sample. For large enough ss, Chernoff bounds would then imply that the restricted measure has a large probability of answering bib_{i} as well, completing the proof.

The proof below, while following the above intuition, is made complicated by several factors. The lookup functions are adaptive so that the mtm^{t} pieces that VV breaks into depends on the table contents. Thus the shattering itself depends on the table contents sampled, making a one-shot sampling argument untenable. We instead give an inductive proof, that handles these dependencies. The weaker shattering assumption forces us to slightly change the decoding algorithm, to take a majority under a modified measure. Additionally, the pieces may be of different sizes, and we need to break large pieces to ensure sparseness.

We are now ready to present a detailed proof.

We assume the contrary so that for m<(γ6nK/4t4w)1tm<(\gamma^{6}nK/4t^{4}w)^{\frac{1}{t}}, there is tt-probe space mm data structure that succeeds with probability 1−γ41-\gamma^{4} on the distribution defined by (G,e)(G,e). We use this data structure to construct functions EncEnc and DecDec violating corollary 3.9. We use the auxiliary input zz as shared randomness between EncEnc and DecDec throughout this proof.

We first sample points x1,…,xnx_{1},\ldots,x_{n} from μ\mu and use (x1,b1),…,(xn,bn)(x_{1},b_{1}),\ldots,(x_{n},b_{n}) as the database. Note that when bb and zz are random, (xi,bi)(x_{i},b_{i}) are distributed according to (G,e)(G,e), and hence for a random yy drawn from the appropriate distribution, the data structure will return the right answer for yy with probability 1−γ31-\gamma^{3}. By Markov’s inequality with probability (1−γ)(1-\gamma), it is the case that except for (1−γ)(1-\gamma) of the ii’s, the data structure answers correctly with probability (1−γ)(1-\gamma) when yy is drawn from νxi\nu_{x_{i}}. By WI, except with probability γ\gamma, yy has a unique neighbor in x1,…,xnx_{1},\ldots,x_{n} so that the correct answer is bib_{i}. Thus except for a γ\gamma fraction of the ii’s, with probability (1−2γ)(1-2\gamma), the data structure returns bib_{i} on a random yy from νxi\nu_{x_{i}}. Thus the tables T=T1,…,TtT=T_{1},\ldots,T_{t} are a valid, albeit long, encoding that can be decoded appropriately by taking the majority answer on νxi\nu_{x_{i}} as a guess for bib_{i}. In the rest of the proof, we argue that in fact a random sample of the tables suffices.

Sampling Procedure: We will sample ss “paths” in the table, where ss is set to s=defγ2n4tws\stackrel{{\scriptstyle def}}{{=}}\frac{\gamma^{2}n}{4tw}. Further we assume that w≥2log⁡mw\geq 2\log m.

Let F1=F1(y)F_{1}=F_{1}(y), F2=F2(y,α1)F_{2}=F_{2}(y,\alpha_{1}), F3=F3(y,α1,α2)F_{3}=F_{3}(y,\alpha_{1},\alpha_{2}) etc. be adaptive lookup functions that the data structure uses. The jjth path consists of tt cells Λj1,…,Λjt\Lambda_{j1},\ldots,\Lambda_{jt}, one from each of the tt tables sampled sequentially. We will also get a telescoping sequence of subsets V⊇A(1)⊇,…,A(t)V\supseteq A^{(1)}\supseteq,\ldots,A^{(t)} where A(k)A^{(k)} denotes the set of queries that access the sampled cells at locations Λj1,…,Λj(k−1)\Lambda_{j1},\ldots,\Lambda_{j(k-1)} in the first k−1k-1 tables, for some j∈[s]j\in[s]. Observe that the cells accessed in TkT_{k} depends on the contents of the cells accessed in the previous table.

We first describe how to sample a single path Λ11,…,Λ1t\Lambda_{11},\ldots,\Lambda_{1t}. To sample from the first table we look at the partition of VV into mm parts induced by the value of F1(y)F_{1}(y) over all y∈Vy\in V. Let A1(10),…,A2m(10)A^{(10)}_{1},\ldots,A^{(10)}_{2m} be a 1m\frac{1}{m}-sparse partition of VV that refines {F−1(l):l∈[m]}\{F^{-1}(l):l\in[m]\}. Such a partitioning can be obtained by starting with {F−1(l):l∈[m]}\{F^{-1}(l):l\in[m]\} and repeatedly splitting parts larger than 1m\frac{1}{m} into smaller pieces. This splitting can be done arbitrarily, and results in a 1m\frac{1}{m}-sparse partitioning containing at most 2m2m parts; we pad this with empty parts to get exactly 2m2m sets A1(10),…,A2m(10)A^{(10)}_{1},\ldots,A^{(10)}_{2m}. This corresponds to a table T1T_{1} of size 2m2m where the cells corresponding the partitions that were split are replicated appropriately. The first cell of the path is simply obtained by picking a random index Λ11\Lambda_{11} into this table. Let A(11)=defAΛ11(10)A^{(11)}\stackrel{{\scriptstyle def}}{{=}}A^{(10)}_{\Lambda_{11}} be the sampled part and let C11C_{11} denote the contents of the corresponding cell.

Inductively, suppose that we have defined Λ11,…,Λ1k\Lambda_{11},\ldots,\Lambda_{1k}, cell contents C11,…,C1kC_{11},\ldots,C_{1k}, and set A(11),…,A(1k)A^{(11)},\ldots,A_{(1k)}, so that all for points in A(1k)A^{(1k)}, the query algorithm looks up Λ(11),…,Λ(1k)\Lambda_{(11)},\ldots,\Lambda_{(1k)} in the first kk lookups, given the contents C11,…,C1(k−1)C_{11},\ldots,C_{1(k-1)}. Inductively, we ensure that ν(A(1k))≤1mk\nu(A^{(1k)})\leq\frac{1}{m^{k}}. The (k+1)(k+1)th lookup function, given the contents C11,…,C1kC_{11},\ldots,C_{1k} partitions the set A(1k)A^{(1k)} into mm parts, and as above, we can refine this partition to get a 1mk+1\frac{1}{m^{k+1}} sparse partitioning Al(1k):l∈[2m]A^{(1k)}_{l}:l\in[2m]. We sample Λ1(k+1)\Lambda_{1(k+1)} uniformly from [2m][2m], and denote by C1(k+1)C_{1(k+1)} the contents of the corresponding cell. We define A(1(k+1))A^{(1(k+1))} to be AΛ1(k+1)(1k)A^{(1k)}_{\Lambda_{1(k+1)}}. Clearly A1(k+1)A^{1(k+1)} has the desired inductive properties. Continuing in this fashion, we get Λ11,…,Λ1t\Lambda_{11},\ldots,\Lambda_{1t}, C11,…,C1tC_{11},\ldots,C_{1t} and A(11),…,A(1t)A^{(11)},\ldots,A^{(1t)}.

We repeat the above process ss times to get ss such paths. The matrix Λjk\Lambda_{jk} (j∈[s],k∈[t]j\in[s],k\in[t]) denotes the sampled cell locations for the ss paths, the matrix CjkC_{jk} denotes the contents of these cells, and the sets A(jk)A^{(jk)} denotes the telescoping sequence of subsets for each of the ss paths.

For a technical reason, each entry in the first column of the Λ\Lambda matrix is drawn independently without replacement from [2m][2m], thus ensuring that this column consists of ss random distinct values from [2m][2m]. For a matrix UU and sets I,JI,J of indices, let U(I,J)U(I,J) denote the submatrix of UU indexed by II and JJ.

The measure of ∪j∈[s]A(jk)\cup_{j\in[s]}A^{(jk)}: We first show that the measure ν(∪j∈[s]A(jk))\nu(\cup_{j\in[s]}A^{(jk)}) is concentrated around s(2m)k\frac{s}{(2m)^{k}}.

ν(∪j∈[s]A(jk))\nu(\cup_{j\in[s]}A^{(jk)}) is at most (1+2klog⁡(t/γ)s)s(2m)k(1+2k\sqrt{\frac{\log(t/\gamma)}{s}})\frac{s}{(2m)^{k}}, except with probability kγ2t2\frac{k\gamma^{2}}{t^{2}}.

We argue inductively. For k=1k=1, the expected value of Y1=defν(∪j∈[s]A(j1))Y_{1}\stackrel{{\scriptstyle def}}{{=}}\nu(\cup_{j\in[s]}A^{(j1)}) is exactly s2m\frac{s}{2m}. Moreover, by 1m\frac{1}{m}-sparsity of A1,…,A2mA_{1},\ldots,A_{2m}, and using Chernoff bounds (for negatively correlated r.v.’s), the deviation from the mean is at most 2slog⁡(t/γ)/m\sqrt{2s\log(t/\gamma)}/m, except with probability γ2t2\frac{\gamma^{2}}{t^{2}}.

Inductively, the expected value of Yk+1=defν(∪j∈[s]A(j(k+1)))Y_{k+1}\stackrel{{\scriptstyle def}}{{=}}\nu(\cup_{j\in[s]}A^{(j(k+1))}) is exactly 12mYk≤(1+8klog⁡(t/γ)s)s(2m)k+1\frac{1}{2m}Y_{k}\leq(1+8k\sqrt{\frac{\log(t/\gamma)}{s}})\frac{s}{(2m)^{k+1}} by the induction hypothesis. A Chernoff bound argument implies that the deviation from the mean is at most 2slog⁡(t/γ)/mk+1\sqrt{2s\log(t/\gamma)}/m^{k+1}, except with probability γ2t2\frac{\gamma^{2}}{t^{2}}. The claim follows. ∎

For the rest of the proof, we will assume that for all k≤tk\leq t, ν(∪j∈[s]A(jk))\nu(\cup_{j\in[s]}A^{(jk)}) is indeed at most (1+2klog⁡(t/γ)s)s(2m)k≤32s(2m)k(1+2k\sqrt{\frac{\log(t/\gamma)}{s}})\frac{s}{(2m)^{k}}\leq\frac{3}{2}\frac{s}{(2m)^{k}} for as long at t,wt,w are o(n14)o(n^{\frac{1}{4}}).

The Encoder: The encoding is simply set to be the matrix CC. Note that the matrix CC, along with Λ\Lambda, which is part of the shared randomness, is enough to compute the answer computed by the data structure for every y∈∪j∈[s]A(jt)y\in\cup_{j\in[s]}A^{(jt)}.

In the rest of the proof, we argue that there is a good decoding algorithm that recovers most of the bib_{i}’s. We do so in two steps. We first argue that if xix_{i} shatters at all levels, then the decoding algorithm succeeds with high probability. We then argue that in fact most xix_{i}’s must shatter at all levels.

If every xix_{i} shatters, the sampled cell contents are sufficient to estimate bib_{i}’s:

We first argue that the sampling process ensures that the majority vote on the sample agrees with the true majority, if the appropriate shattering happens at each level. For ease of notation, for k≥1k\geq 1, let Kk=Kmk−tK_{k}=Km^{k-t}. Note that by Observation 3.6, the (K,1mt)(K,\frac{1}{m^{t}})-weak shattering implies (Kk,1mk)(K_{k},\frac{1}{m^{k}})-weak shattering. We start by defining the shattering event formally.

We will say that WShatterk+1(x,Λ([s],[k]),C([s],[k]))WShatter_{k+1}(x,\Lambda([s],[k]),C([s],[k])) occurs if the collection {Al(jk):j∈[s],l∈[m]}\{A^{(jk)}_{l}:j\in[s],l\in[m]\} (Kk+1,γ2/t)(K_{k+1},\gamma^{2}/t)-weakly shatters xx. We use the notation WShatter(x,Λ,C)WShatter(x,\Lambda,C) to denote the event ∧k≤tWShatterk(x,Λ([s],[k]),C([s],[k]))\wedge_{k\leq t}WShatter_{k}(x,\Lambda([s],[k]),C([s],[k])).

When Λ\Lambda and CC are obvious from context, we will simply abbreviate these events as WShatterk(x)WShatter_{k}(x) and WShatter(x)WShatter(x).

Let V0V_{0} (resp. V1V_{1}) denote the set of vertices for which the query algorithm, given the table population, outputs (resp. 11). So VbV_{b} and VbcV_{b^{c}} are the set of queries for which the query algorithm outputs the bits bb and its complement bcb^{c} respectively.

For k≥1k\geq 1, we let Repk(x,Λ([s],[k]),C([s],[k−1]))Rep_{k}(x,\Lambda([s],[k]),C([s],[k-1])) be the event

For k≥1k\geq 1, we let Smallk(x,b,Λ([s],[k]),C([s],[k]))Small_{k}(x,b,\Lambda([s],[k]),C([s],[k])) denote the event

By the discussion above, except with probability γ\gamma, Small0(xi,bic)Small_{0}(x_{i},b_{i}^{c}) occurs for (1−γ)(1-\gamma) of the ii’s. We assume that this is indeed the case.

With the definitions in place, we are now ready to argue that each of these events happens for most xix_{i}’s. For brevity, we use Repk(x),Smallk(x,b)Rep_{k}(x),Small_{k}(x,b) when the other arguments are obvious from context. It is immediate from the definitions that

If Rept(xi)Rep_{t}(x_{i}) and Smallt(xi,bic)Small_{t}(x_{i},b_{i}^{c}) occur, then the decoding bi^\hat{b_{i}} agrees with bib_{i}.

We argue that assuming WShatterk(x)WShatter_{k}(x) for each kk, the events Rept(x)Rep_{t}(x) and Smallt(x)Small_{t}(x) indeed happen with high probability. The following two lemmas form the base case, and the induction step of such an argument.

An identical Chernoff bound argument suffices to show Smallk+1(x,b)Small_{k+1}(x,b). ∎

If for most xix_{i}, WShatter(xi)WShatter(x_{i}) occurred, this would imply that the decoding algorithm succeeds with high probability. However, the event WShatterk+1(xi)WShatter_{k+1}(x_{i}) depends on the contents C([s],[k])C([s],[k]), which are determined by the table population, which depends on xix_{i} itself.

Proving that weak shattering happens for most xix_{i}’s:

The weak shattering property implies that for any kk, for a fixed table population T=T1,…,TtT=T_{1},\ldots,T_{t} (which determines C([s],[k])C([s],[k]) via Λ([s],[k])\Lambda([s],[k])),

Thus for any fixed TT and Λ\Lambda, it is the case that

Let ManyShatter(T,Λ,x)ManyShatter(T,\Lambda,{\mathbf{x}}) be the event that WShatter(x)WShatter(x) occurs for all but a 2γ2\gamma fraction of the xix_{i}’s in the instance x{\mathbf{x}}, i.e. ∑i1(WShatter(xi,Λ([s],[k]),C(T,Λ)([s],[k])))≥(1−2γ)n\sum_{i}\mathbf{1}(WShatter(x_{i},\Lambda([s],[k]),C(T,\Lambda)([s],[k])))\geq(1-2\gamma)n.

First consider a fixed T,ΛT,\Lambda. Since the xix_{i}’s are drawn independently, Chernoff bounds imply that

Further, note that the event ManyShatter(T,Λ,x)ManyShatter(T,\Lambda,{\mathbf{x}}) depends on TT only through the contents C(T,Λ)([s],[t])C(T,\Lambda)([s],[t]). Thus doing a union bound over all possible values of CC and Λ\Lambda,

The claim follows since s=γ2n4t(w+log⁡2m)s=\frac{\gamma^{2}n}{4t(w+\log 2m)}. ∎

We assume for the rest of the proof that the database x=x1,…,xn{\mathbf{x}}=x_{1},\ldots,x_{n} indeed has this property; this changes the failure probability by a negligible amount.

Let T(x,b)T({\mathbf{x}},{\mathbf{b}}) be the table population built by the data structure. Lemma 3.21 implies that

Since Dec(Enc(b,z),z)i=biDec(Enc(b,z),z)_{i}=b_{i} whenever Rept(xi)∧Smallt(xi)Rep_{t}(x_{i})\wedge Small_{t}(x_{i}), it follows that

The rare events ignored during the rest of the proof add an additional O(γn)O(\gamma n) to this expectation.

For small enough γ\gamma, the size of the encoding stwstw is smaller than (γ2/4)n<rn(\gamma^{2}/4)n<rn (since lim⁡δ→0r(δ)=1\lim_{\delta\rightarrow 0}r(\delta)=1), contradicting Corollary 3.9. Hence the claim. ∎

5 Cell Sampling

In this section, we show a different sampling technique, which gives a different lower bound. The main theorem is:

There exists a constant γ>0\gamma>0 such that the following holds. Let (G,e)(G,e) satisfy γ\gamma-weak independence (WI) and (K,1m,γt)(K,\frac{1}{m},\frac{\gamma}{t})-weak shattering property. Then for t≤n14t\leq n^{\frac{1}{4}}, any deterministic tt-probe data structure for the distribution over GNS instances defined by (G,e)(G,e) that succeeds with probability (1−γ)(1-\gamma) must use space mm at least Ω(γ3nK12t/wt3log⁡(t/γ))\Omega(\gamma^{3}nK^{\frac{1}{2t}}/wt^{3}\log(t/\gamma)).

The proof is analogous to that for theorem 3.12. We define Encoding and Decoding procedures that compress a random string. The primary difference is in the sampling procedure; instead of sampling “paths” as in the previous section, we sample cells from each table, and argue that the set of points that can be looked up only using paths in the sample is sufficient to recover the bits bib_{i}. Specifically, we define events analogous to RepRep and SmallSmall in the previous section, and show that they occur for many points.

We assume the contrary so that for m<γ3nK12t/wt3log⁡(t/γ))m<\gamma^{3}nK^{\frac{1}{2t}}/wt^{3}\log(t/\gamma)), there is tt-probe space mm data structure that succeeds with probability 1−γ31-\gamma^{3} on the distribution defined by (G,μ,{νx}x∈V)(G,\mu,\{\nu_{x}\}_{x\in V}). We use this data structure to construct functions EncEnc and DecDec violating corollary 3.9. We use the auxiliary input as shared randomness between EncEnc and DecDec throughout this proof. The database (x1,b1),…,(xn,bn)(x_{1},b_{1}),\ldots,(x_{n},b_{n}) is defined as before.

Cell Sampling Procedure: Let s=8t2mlog⁡(t/γ)/γ2K12ts=8t^{2}m\log(t/\gamma)/\gamma^{2}K^{\frac{1}{2t}}. Let F1=F1(y)F_{1}=F_{1}(y), F2=F2(y,α1)F_{2}=F_{2}(y,\alpha_{1}), F3=F3(y,α1,α2)F_{3}=F_{3}(y,\alpha_{1},\alpha_{2}) etc. be adaptive lookup functions that the data structure uses. The sampling is done in tt steps one for each table. At each step we will get subsets V=A0⊃A1⊃A2,…,AtV=A^{0}\supset A^{1}\supset A^{2},\ldots,A^{t} so that all the queries in AiA^{i} only access the sampled cells for the first ii lookups.

Let A0=VA^{0}=V and let Al0A^{0}_{l} for l∈[2m]l\in[2m] be a 1m\frac{1}{m}-sparse partition obtained by refining {F1−1(l):l∈[m]}\{F_{1}^{-1}(l):l\in[m]\}; this can be done as before by arbitrarily breaking up cells larger than 1m\frac{1}{m}. Let Λ11,…,Λs1\Lambda_{11},\ldots,\Lambda_{s1} be a random subset of [2m][2m] of size ss. Let the contents of the respective cells in a table population TT be denoted by C11,…,Cs1C_{11},\ldots,C_{s1}. Thus the sample from the first table consists of ss rows Λ11,…,Λs1∈[2m]\Lambda_{11},\ldots,\Lambda_{s1}\in[2m] whose contents are C11,…Cs1∈{0,1}wC_{11},\ldots C_{s1}\in\{0,1\}^{w}. We set A1=∪j∈[s]AΛj10A^{1}=\cup_{j\in[s]}A^{0}_{\Lambda_{j1}}.

Let Al1:l∈[2m]A^{1}_{l}:l\in[2m] be a 1m\frac{1}{m}-sparse partitioning obtained by refining {A1∩F2−1(l):l∈[m]}\{A^{1}\cap F_{2}^{-1}(l):l\in[m]\} as above. We pick a random subset Λ12,…,Λs2\Lambda_{12},\ldots,\Lambda_{s2} of [2m][2m] of size ss, and let C12,…,Cs2C_{12},\ldots,C_{s2} denote the relevant set of contents from TT. We set A2=∪j∈[s]AΛj21A^{2}=\cup_{j\in[s]}A^{1}_{\Lambda_{j2}} be the set of queries y∈Vy\in V that look up one of the sampled cells in the first two tables.

Repeating this process, we get s×ts\times t matrices Λ\Lambda and CC, and sets A1,…,AtA_{1},\ldots,A_{t}. Note that in any execution of the procedure, the set AkA^{k} depends only on the samples Λ\Lambda and the contents CC read from the table population.

The measure of AkA^{k}. We first show that the measure ν(Ak)\nu(A^{k}) is concentrated around (s2m)k(\frac{s}{2m})^{k}.

ν(∪j∈[s]Ak)\nu(\cup_{j\in[s]}A^{k}) is at most (1+2klog⁡(t/γ)s)(s2m)k(1+2k\sqrt{\frac{\log(t/\gamma)}{s}})(\frac{s}{2m})^{k}, except with probability kγ2t2\frac{k\gamma^{2}}{t^{2}}.

We argue inductively. For k=1k=1, the expected value of Y1=defν(A1)Y_{1}\stackrel{{\scriptstyle def}}{{=}}\nu(A^{1}) is exactly s2m\frac{s}{2m}. Moreover, by 1m\frac{1}{m}-sparsity of A1,…,A2mA_{1},\ldots,A_{2m}, and using Chernoff bounds (for negatively correlated r.v.’s), the deviation from the mean is at most 2slog⁡(t/γ)/m\sqrt{2s\log(t/\gamma)}/m, except with probability γ2t2\frac{\gamma^{2}}{t^{2}}.

Inductively, the expected value of Yk+1=defν(Ak+1)Y_{k+1}\stackrel{{\scriptstyle def}}{{=}}\nu(A^{k+1}) is exactly s2mYk≤(1+2klog⁡(t/γ)s)(s2m)k+1\frac{s}{2m}Y_{k}\leq(1+2k\sqrt{\frac{\log(t/\gamma)}{s}})(\frac{s}{2m})^{k+1} by the induction hypothesis. A Chernoff bound argument identical to the one above completes the proof. ∎

For the rest of the proof, we will assume that for all k≤tk\leq t, ν(Ak)\nu(A^{k}) is indeed at most (1+2klog⁡(t/γ)s)(s2m)k≤32(s2m)k(1+2k\sqrt{\frac{\log(t/\gamma)}{s}})(\frac{s}{2m})^{k}\leq\frac{3}{2}(\frac{s}{2m})^{k}.

The Encoder: The encoding is set as before to be the matrix CC. Note that the matrix CC, along with Λ\Lambda, which is part of the shared randomness, is enough to compute the answer computed by the data structure for every y∈Aty\in A^{t}.

If every xix_{i} shatters, the sampled cell contents are sufficient to estimate bib_{i}’s:

We argue that the sampling process ensures that the majority vote on the sample agrees with the true majority, if the appropriate shattering happens at each level. We start by defining the shattering event formally.

We will say that WShatterk+1(x,Λ([s],[k]),C([s],[k]))WShatter_{k+1}(x,\Lambda([s],[k]),C([s],[k])) occurs if the collection {Alk:l∈[m]}\{A^{k}_{l}:l\in[m]\} (K,γ2/t)(K,\gamma^{2}/t)-weakly shatters xx. We use the notation WShatter(x,Λ,C)WShatter(x,\Lambda,C) to denote the event ∧k≤tWShatterk(x,Λ([s],[k]),C([s],[k]))\wedge_{k\leq t}WShatter_{k}(x,\Lambda([s],[k]),C([s],[k])).

When Λ\Lambda and CC are obvious from context, we will simply abbreviate these events as WShatterk(x)WShatter_{k}(x) and WShatter(x)WShatter(x).

Let V0V_{0} (resp. V1V_{1}) denote the set of vertices for which the query algorithm, given the table population, outputs (resp. 11). So VbV_{b} and VbcV_{b^{c}} are the set of queries for which the query algorithm outputs the bits bb and its complement bcb^{c} respectively.

For k≥1k\geq 1, we let Repk(x,Λ([s],[k]),C([s],[k−1]))Rep_{k}(x,\Lambda([s],[k]),C([s],[k-1])) be the event

For k≥1k\geq 1, we let Smallk(x,b,Λ([s],[k]),C([s],[k]))Small_{k}(x,b,\Lambda([s],[k]),C([s],[k])) denote the event

As in the path sampling case, except with probability γ\gamma, Small0(xi,bic)Small_{0}(x_{i},b_{i}^{c}) occurs for (1−γ)(1-\gamma) of the ii’s. We assume that this is indeed the case.

With the definitions in place, we are now ready to argue that each of these events happens for most xix_{i}’s. For brevity, we use Repk(x),Smallk(x,b)Rep_{k}(x),Small_{k}(x,b) when the other arguments are obvious from context. It is immediate from the definitions that

If Rept(xi)Rep_{t}(x_{i}) and Smallt(xi,bic)Small_{t}(x_{i},b_{i}^{c}) occur, then the decoding bi^\hat{b_{i}} agrees with bib_{i}.

We argue that assuming WShatterk(x)WShatter_{k}(x) for each kk, the events Rept(x)Rep_{t}(x) and Smallt(x)Small_{t}(x) indeed happen with high probability. The following two lemmas form the base case, and the induction step of such an argument.

except with probability exp⁡(−γ22t2K(s2m))\exp(-\frac{\gamma^{2}}{2t^{2}}K(\frac{s}{2m})). The claim follows by an easy calculation.

An identical Chernoff bound argument suffices to show Smallk+1(x,b)Small_{k+1}(x,b). ∎

If for most xix_{i}, for all kk, WShatterk(x)WShatter_{k}(x) occurred, this would imply that the decoding algorithm succeeds with high probability.

The rest of the proof is identical to that for Theorem 3.12, since once again, the event WShatter(x)WShatter(x) depends on the table population only through the contents CC.

Applications

We show how lower bounds on GNS imply lower bounds for ANNS. We stress that these bounds hold for the average case where the nn data-set points are sampled randomly from a distribution over ∣V∣|V|. Thus, if with high probability the distance between all pairs of points in the data set is at least crcr, then the bounds above hold also for the approximate nearest neighbor within factor cc. The following table lists all these bounds and how they follow from our work.

In the decisional version of the (c,r)(c,r)-ANNS problem we have a metric space M\mathcal{M} and parameters cc and rr. We preprocess nn points x1,...,xnx_{1},...,x_{n} into a data structure. When given a query point yy the goal is to distinguish between the case where d(xi,y)≤rd(x_{i},y)\leq r for some i∈[n]i\in[n], and the case where for all ii d(xi,y)≥crd(x_{i},y)\geq cr. The query algorithm is required to output 11 in the former case, in the latter case, and may report anything if neither of the two cases hold.

We show that if we have appropriate distributions over M\mathcal{M}, we can derive lower bounds for (c,r)(c,r)-ANNS by simply computing the relevant expansion parameter.

Let c≥1c\geq 1 and let μ\mu be a distribution over a metric M=(V,d){\mathcal{M}}=(V,d) satisfying:

Let Gr=(V,{(u,v):d(u,v)≤r})G_{r}=(V,\{(u,v):d(u,v)\leq r\}). Then GNS on (Gr,μ)(G_{r},\mu) reduces to (c,r)(c,r)-approximate GNS on M\mathcal{M}.

Given a GNS instance (x1,b1),…,(xn,bn)(x_{1},b_{1}),\ldots,(x_{n},b_{n}), we consider the dataset D1={xi:bi=1}D_{1}=\{x_{i}:b_{i}=1\} as our input for the (c,r)(c,r)-ANNS problem. It is easy to see that when xi∼μx_{i}\sim\mu and bi∼{0,1}b_{i}\sim\{0,1\}, this set D1D_{1} is a uniformly random dataset from μ\mu. The cc-Strong independence implies strong independence for the GNS instance. Whenever d(xi,xj)>(c+1)rd(x_{i},x_{j})>(c+1)r, and d(xi,y)≤rd(x_{i},y)\leq r, we have d(xj,y)>crd(x_{j},y)>cr so that for the cc-approximate NNS instance, the answer is 11 if and only xix_{i} is in D1D_{1}, i.e. if and only if bi=1b_{i}=1. The claim follows. ∎

Thus to prove deterministic data structure lower bounds for cc-approximate NNS, it suffices to exhibit rr and a distribution μ\mu which satisfies cc-strong independence and has large expansion.

Let c≥1c\geq 1 and let ee be a distribution over pairs of points in a metric M=(V,d){\mathcal{M}}=(V,d). Let μ(x)=e(x,V)\mu(x)=e(x,V) and ν(y)=e(V,y)\nu(y)=e(V,y). Suppose that for small enough γ\gamma

Then GNS on (G,e)(G,e) reduces to (c,r)(c,r)-approximate GNS on M\mathcal{M}.

As before, given a GNS instance (x1,b1),…,(xn,bn)(x_{1},b_{1}),\ldots,(x_{n},b_{n}), we consider the dataset D1={xi:bi=1}D_{1}=\{x_{i}:b_{i}=1\} as our input for the (c,r)(c,r)-ANNS problem. It is easy to see that when xi∼μx_{i}\sim\mu and bi∼{0,1}b_{i}\sim\{0,1\}, this set D1D_{1} is a uniformly random dataset from μ\mu. The properties above imply weak independence for the GNS instance. Finally, except with small probability, we have d(xj,y)>crd(x_{j},y)>cr for all j≠ij\neq i, so that for the cc-approximate NNS instance, the answer is 11 if and only xix_{i} is in D1D_{1}, i.e. if and only if bi=1b_{i}=1. The claim follows. ∎

Thus to prove randomized data structure lower bounds for cc-approximate NNS, it suffices to exhibit rr and a distribution ee which satisfies the above properties and has large expansion.

2 Computing Expansion

We will set μ\mu to be the uniform distribution over the hypercube. For a set A⊆HA\subseteq H, we let a=μ(A)a=\mu(A). Observe that if we take nn uniformly random points from a dd dimensional hypercube then with high probability all pairs of points are at least d/2−O(dlog⁡n)d/2-O(\sqrt{d\log n}) apart. Using bounds for the expansion for the (GrG_{r} corresponding to the) dd-dimensional hypercube, we will derive lower bounds for the near neighbor problem on the hypercube.

Let H={0,1}dH=\{0,1\}^{d} be the boolean hypercube, and let GrG_{r} be the graph with the edge set Er={(u,v):∣u−v∣1≤r}E_{r}=\{(u,v):|u-v|_{1}\leq r\}. Let hi=12d∑j=0i(dj)h_{i}=\frac{1}{2^{d}}\sum_{j=0}^{i}{d\choose j}. Then the vertex expansion Φv(hi)≥hi+r\Phi_{v}(h_{i})\geq{h_{i+r}}

For randomized lower bounds, we will use the distribution defined by the noise operator TρT_{\rho} where ρ=(1−2rd)\rho=(1-\frac{2r}{d}). I.e. to sample from ee, we sample xx from the uniform distribution μ\mu and sample yy by flipping each bit of xx independently with probability (1−ρ)2=rd\frac{(1-\rho)}{2}=\frac{r}{d}. It is easy to check that for any r≤(12−ϵ)dr\leq(\frac{1}{2}-\epsilon)d and dd being Ω(log⁡n/ϵ2)\Omega(\log n/\epsilon^{2}), we indeed have Pr⁡(x,y)∼e[d(x,y)≤(1+ϵ10)r]≥1−γn\Pr_{(x,y)\sim e}[d(x,y)\leq(1+\frac{\epsilon}{10})r]\geq 1-\frac{\gamma}{n}. Moreover, since μ=ν\mu=\nu, by the discussion above, Pr⁡y∈ν,z∈μ[d(y,z)≤d2−O(dlog⁡n)]≤γn2\Pr_{y\in\nu,z\in\mu}[d(y,z)\leq\frac{d}{2}-O(\sqrt{d\log n})]\leq\frac{\gamma}{n^{2}}. Thus it remains to compute the expansion for appropriate rr.

It will be convenient to work with the edge expansion.

We define the edge expansion Φe(δ)\Phi_{e}(\delta) for a (G,e)(G,e) as Φe(δ)=minμ(A)≤δe(A,V)e(A,A)\Phi_{e}(\delta)=min_{\mu(A)\leq\delta}\frac{e(A,V)}{e(A,A)}. Thus for any set of size measure δ\delta, at most 1Φe(δ)\frac{1}{\Phi_{e}(\delta)} mass of edges incident on AA stay within AA.

For any (G,e)(G,e), if μ\mu is uniform, then Φr(δ,γ)=Ω(γΦe(2δ))\Phi_{r}(\delta,\gamma)=\Omega(\gamma\Phi_{e}(2\delta))

First we will argue that for any sets AA and BB where μ(A)=μ(B)≤δ\mu(A)=\mu(B)\leq\delta, e(A,B)≤2e(A,V)/Φe(2δ)e(A,B)\leq 2e(A,V)/\Phi_{e}(2\delta). To see this note that e(A,B)≤e(A∪B,A∪B)≤1Φe(μ(A∪B))e(A∪B,V)=1Φe(2δ)2e(A,V)e(A,B)\leq e(A\cup B,A\cup B)\leq\frac{1}{\Phi_{e}(\mu(A\cup B))}e(A\cup B,V)=\frac{1}{\Phi_{e}(2\delta)}2e(A,V)

Now consider any set AA of measure at most δ\delta, and let BB by any other set of measure δγΦe(2δ)/2\delta\gamma\Phi_{e}(2\delta)/2. We wish to argue that e(A,B)≤γe(A,V)e(A,B)\leq\gamma e(A,V) which would imply the claim.

Let B1,…,BkB_{1},\ldots,B_{k} be a partition of BB into k=⌈δγΦe(2δ)2δ⌉k=\lceil\frac{\delta\gamma\Phi_{e}(2\delta)}{2\delta}\rceil pieces of measure δ\delta each. e(A,B)≤∑ie(A,Bi)≤k1Φe(μ(A∪B))≤γe(A,B)\leq\sum_{i}e(A,B_{i})\leq\frac{k}{\frac{1}{\Phi_{e}(\mu(A\cup B))}}\leq\gamma. The claim follows.

Let H={0,1}dH=\{0,1\}^{d} be the boolean hypercube, and (G,e)(G,e) be as above for r<d4r<\frac{d}{4}. Then the edge expansion Φe(a)≥a−Ω(r/d)\Phi_{e}(a)\geq a^{-\Omega(r/d)}.

For sets A,BA,B, it is easy to see that e(A,B)=⟨Tρ1A,1B⟩e(A,B)=\langle T_{\rho}\mathbf{1}_{A},\mathbf{1}_{B}\rangle. But by the Hypercontractive inequality,

Also e(A,V)=ae(A,V)=a. The claim follows by substituting the value of ρ\rho. ∎

Setting r=ϵd/2r=\epsilon d/2, we get that for constant γ\gamma, Φr(a,γ)≥a−Ω(ϵ)\Phi_{r}(a,\gamma)\geq a^{-\Omega(\epsilon)}. From theorem 1.5 (first inequality) it follows that (mw/n)t≥m−Ω(ϵ)(mw/n)^{t}\geq m^{-\Omega(\epsilon)} implying m≥(n/w)1+Ω(ϵ/t)m\geq(n/w)^{1+\Omega(\epsilon/t)}.

Let H={0,1}dH=\{0,1\}^{d} be the boolean hypercube, and let (G,e)(G,e) be as above for r=(12−ϵ)dr=(\frac{1}{2}-\epsilon)d Then for any sets AA and BB such that μ(B)≤μ(A)4(1−2rd)2\mu(B)\leq\mu(A)^{4(1-\frac{2r}{d})^{2}}, e(A,B)≤μ(A)(1−2rd)2de(A,V)e(A,B)\leq\mu(A)^{(1-\frac{2r}{d})^{2}}de(A,V).

As in the proof of lemma 4.6, we use the hypercontractive inequality.

For any β≥0\beta\geq 0, and r≤d2r\leq\frac{d}{2}, setting ρ=1−2rd\rho=1-\frac{2r}{d}, Φav(β,βρ2)≥β1−4ρ2\Phi_{av}(\beta,\beta^{\rho^{2}})\geq\beta^{1-4\rho^{2}} for GrG_{r} as above.

Setting r=(1−ϵ)d/2r=(1-\epsilon)d/2, we see that from theorem 1.5 that any randomized algorithm must use space m≥(nwt5)4tϵ2m\geq(\frac{n}{wt^{5}})^{\frac{4}{t\epsilon^{2}}}.

A Matching Upper Bound

We already know that the lower bound is tight in many specific cases. Here we show that the tightness holds more generally, for highly symmetric graphs. For such graphs, we show that the notion of robust expansion correctly captures the complexity of GNS for the regime with a constant number of queries.

Let GG be an undirected Cayley graphWe need the graph to be highly symmetric and the symmetries of Cayley graphs are convenient for the claims we need., and assume that it has the weak independence property for the uniform distribution. Let mm be such that m=nΦr(1m,γ)m=n\Phi_{r}(\tfrac{1}{m},\gamma) (denoted by Φ\Phi for brevity) where γ≥34\gamma\geq\tfrac{3}{4}. Below we describe a data structure with mm cells and word size O(log⁡n)O(\log n) which can solve GNS in a single query with constant probability for the hard distribution of inputs. This matches the lower bound of Theorem 1.5 for the case t=1t=1.

Let GG be an undirected Cayley graph that has the weak independence property for the uniform distribution. Let mm be such that m=nΦr(1m,γ)m=n\Phi_{r}(\tfrac{1}{m},\gamma) (denoted by Φ\Phi for brevity) where γ≥34\gamma\geq\tfrac{3}{4}. Then there is a 11-probe data structure that uses mm words of w=log⁡∣G∣w=\log|G| bits each that succeeds with constant probability when the data-set points x1,…,xnx_{1},\ldots,x_{n} are drawn randomly and independently, and the query point is a random neighbor of a random xix_{i}.

We observe that this is the distribution for which we show the lower bound.

The main idea is to use the low expanding sets in order to construct something similar to a Locality Sensitive Hashing solution. We stress that the upper bound is in the cell probe model, which allows us to ignore the (practically very important) issue of actually computing the LSH efficiently.

Let A⊂VA\subset V be a set of measure 1/m1/m for which the robust expansion is Φ\Phi and m=nΦm=n\Phi. By the definition of robust expansion, we know that there is a set BB of measure Φ/m\Phi/m such that ∣E(A,B)∣≥γ∣E(A,V)∣|E(A,B)|\geq\gamma|E(A,V)|. We take mm random translations of AA and BB, denoted by A1,…,AmA_{1},\ldots,A_{m} and B1,…,BmB_{1},\ldots,B_{m}, formally, we sample uniformly mm elements a1,...,ama_{1},...,a_{m} from the group underlying the Cayley graph, and set Ai={u:u=ai+v,v∈A}A_{i}=\{u:u=a_{i}+v,v\in A\} and similarly Bi={u:u=ai+v,v∈B}B_{i}=\{u:u=a_{i}+v,v\in B\}. The translation by aia_{i} is an automorphism that maps AA to AiA_{i} and BB to BiB_{i} so for each ii ∣E(Ai,Bi)∣≥γ∣E(Ai,V)∣|E(A_{i},B_{i})|\geq\gamma|E(A_{i},V)|.

We construct a table TT with mm cells as follows: Given a data set point xx, we check for each i≤mi\leq m whether x∈Bix\in B_{i}, and if so we place xx in TiT_{i}. Note that the measure of each BiB_{i} is Φ/m\Phi/m so that the expected number of data set points xjx_{j} that fall in BiB_{i} is nΦ/mn\Phi/m which is 11. For random data sets, most BiB_{i}’s will contain at most (say) 1010 data-set points. In order to keep the word size small we store at most 1010 data set points in each table cell TiT_{i}, and assuming that O(log⁡n)O(\log n) bits suffice to represent a data-set point, we have w=O(log⁡n)w=O(\log n).

Now, given a query point yy we find an ii for which y∈Aiy\in A_{i} and output the data-set point in T[i]T[i] which is closest to yy. Note that with constant probability, such an ii exists and is unique.

Recall that the data set x1,…,xnx_{1},\ldots,x_{n} is obtained by sampling nn points uniformly and independently from VV. Further, we assume that this distribution is weakly independent; i.e. if xx and yy are random nodes and zz is a random neighbor of xx, then Pr⁡[z∈N(y)]≤1/100n\Pr[z\in N(y)]\leq 1/100n. Further, the query point is obtained by sampling a random neighbor of a random data set point. Assume that the correct answer is xx. Now if y∈Aiy\in A_{i} (which happens with a constant probability), then the lookup succeeds if x∈Bix\in B_{i} and there were less than 1010 data set points in BiB_{i}. The first event occurs with probability γ≥34\gamma\geq\tfrac{3}{4} and the second event occurs independently with probability at least 34\tfrac{3}{4} as well. We conclude that the data structure succeeds with constant probability. ∎

Low Contention Dynamic Data Structures

Let QlQ_{l} denote the set of queries that read cell T[l]T[l] from the table.

A data structure is said to have contention τ\tau if ν(Ql)≤τ\nu(Q_{l})\leq\tau for all ll.

Say we insert a new point xx. After the insertion there would be a subset of N′(x)⊆N(x)N^{\prime}(x)\subseteq N(x) such that the query algorithm outputs the correct answer for any y∈N′(x)y\in N^{\prime}(x). We say the insertion xx is successful if the measure of this set under νx\nu_{x} is at least 1−γ1-\gamma.

We remark that we look at contention only for the part of the data structure that depends on the database; accesses to any randomness are free.

We prove Theorem 1.8, which states that in such data structures, the update time is at least Ω(Φr(τ,O(1t2))/t4)\Omega(\Phi_{r}(\tau,O(\frac{1}{t^{2}}))/t^{4}).

Consider the state of a tt-probe data structure just before we insert a point. The tt lookup functions each give a partitioning of VV such that each part in the partitioning has measure at most τ\tau under ν\nu. Let Q1i,…,QmiQ^{i}_{1},\ldots,Q^{i}_{m} be the iith partitioning.

Let LL be the set of locations in TT that are updated when one inserts xx. Thus ∣L∣≤tU|L|\leq t_{U}. Further, note that for the answer for yy to be correct both before and after the insertion, LL must intersect with at least one of the locations that are queried on yy, i.e. y∈QLiy\in Q^{i}_{L} for some ii.

By assumption each of the ii partitions is τ\tau-sparse. Lemma 3.11 implies that except with small probability, xx is (K,γ/2t)(K,\gamma/2t) shattered where K=Φr(τ,γ24t2)γ3/16t3K=\Phi_{r}(\tau,\frac{\gamma^{2}}{4t^{2}})\gamma^{3}/16t^{3} by each of the partitions. Strong shattering would imply that for each ll, the measure νx(Qli)≤1K\nu_{x}(Q^{i}_{l})\leq\frac{1}{K} so that ∣L∣|L| changes can account for at most a t∣L∣/Kt|L|/K measure being affected, which would imply the result.

Thus tU≥∣L∣≥K/2t=Φr(τ,γ24t2)γ3/32t4t_{U}\geq|L|\geq K/2t=\Phi_{r}(\tau,\frac{\gamma^{2}}{4t^{2}})\gamma^{3}/32t^{4}. ∎

References