This paper was converted on www.awesomepapers.org from LaTeX by an anonymous user.
Want to know more? Visit the Converter page.

Online matching games in bipartite expanders and applications

Bruno Bauwens National Research University Higher School of Economics, Faculty of Computer Science, Moscow, Russia; This research was funded by RSF grant number 20–11–20203.    Marius Zimand Department of Computer and Information Sciences, Towson University, Baltimore, MD.
Abstract

We study connections between expansion in bipartite graphs and efficient online matching modeled via several games. In the basic game, an opponent switches on and off nodes on the left side and, at any moment, at most KK nodes may be on. Each time a node is switched on, it must be irrevocably matched with one of its neighbors. A bipartite graph has ee-expansion up to KK if every set SS of at most KK left nodes has at least e#Se\#S neighbors. If all left nodes have degree DD and ee is close to DD, then the graph is a lossless expander. We show that lossless expanders allow for a polynomial time strategy in the above game, and, furthermore, with a slight modification, they allow a strategy running in time O(DlogN)O(D\log N), where NN is the number of left nodes. Using this game and a few related variants, we derive applications in data structures and switching networks. Namely, (a) 1-query bitprobe storage schemes for dynamic sets (previous schemes work only for static sets), (b) explicit space- and time-efficient storage schemes for static and dynamic sets with non-adaptive access to memory (the first fully dynamic dictionary with non-adaptive probing using almost optimal space), and (c) non-explicit constant depth non-blocking NN-connectors with poly(logN)(\log N) time path finding algorithms whose size is optimal within a factor of O(logN)O(\log N) (previous connectors are double-exponentially slower).

1 Introduction

A bipartite graph has offline matching up to KK elements if every set of KK left nodes can be covered by KK pairwise disjoint edges. A graph has ee-expansion up to KK if every subset SS with at most KK left nodes has at least e#Se\cdot\#S right neighbors.111As usual, left and right are used to indicate the corresponding side of the bipartition containing the node. The classical Hall’s theorem establishes the relation between expansion and matching: a graph has offline matching up to KK elements if and only if it has 11-expansion up to KK. A matching can be found very efficiently (using algorithms that find a maximum matching, such as [HK73] or [CKL+22]).

Is there anything similar for online matching? We show Hall-type results (but only in one direction), namely we establish expansion properties that are sufficient to guarantee online matching with efficient algorithms, and we do this in different settings modeled by different games. Moreover, we show that results of this kind have interesting applications.

Let us introduce the basic model, which is the cleanest among the types of online matching we consider,222The other models are used as intermediate steps in some proofs, and some also show up in the applications. They are introduced close to the place where they are used. and also the most challenging for the design of an efficient matching algorithm.

The basic online matching game

For the sake of this discussion, let us interpret left nodes of a graph as clients and right nodes as servers. The bipartite relation models the fact that a client can only be satisfied by certain servers. If the graph has offline matching up to KK elements, then for every set of at most KK clients, one can assign unique servers. In incremental matching up to KK, irrevocable assignments must be made on-the-fly as clients arrive and request access to a server. The condition is that at most KK clients arrive. In online matching up to KK, each client may in addition, release the assigned match. The condition is that at most KK clients may simultaneously need access to a server. We also allow a relaxed notion, in which a server may be assigned to up to \ell clients. As mentioned, the formal definition uses a game.

Online matching game. The game with parameters KK and \ell is played on a fixed graph. Two players, called Requester and Matcher, know this graph and alternate turns. Together they maintain a subset MM of edges, which is initially empty. Requester starts. At his turn, he may remove zero or more edges from MM. After this, MM should contain at most K1K-1 edges. Also, he must select a left node xx. At her turn, Matcher may add an edge to MM. After this, xx should be incident on an edge of MM, and each right node must be incident on at most \ell edges from MM. If these conditions are not satisfied, then Matcher loses.

Definition.

A graph has online matching up to KK elements with load \ell, if Matcher has a strategy in the above game in which she never loses. If the load \ell is omitted, then =1\ell=1 is assumed.

A fully connected bipartite graph with right size KK has online matching up to KK. Both graphs below have offline matching up to 22 elements, but neither has online matching up to 22 elements333 Requester wins the game on the right graph above with the following sequence of requests and retractions. He first adds the middle left element. Matcher has to assign to it the top right neighbor (otherwise the Requester wins at the next step by adding the bottom left node). Requester next adds the top left node, which can only be matched with the right bottom node. At next step he retracts the left middle node and adds the bottom left node. At each moment at most 22 left nodes have active matching requests and we conclude that the right graph does not have online matching up to 22. The right one has incremental matching up to 2 and the left one does not.

Remark.

The objective in the game is different from the extensively studied dynamic and online matching problems in the literature, in which the graph is not fixed and the request consists of a left node with its edges (adversarially chosen). In dynamic matching, matches may be revoked. In both areas, the objective is to maintain a matching for as many active requests as possible, see for example [HKPS20, LMSVW22]. Our definition is incomparable to this. On one side, the definition is weaker because the graph is fixed and known to the players. On the other side, it is stronger because we require a matching for all requested nodes and we may not change previously assigned matches. See appendix D for more related results.

Feldman, Friedman, and Pippenger [FFP88, proposition 1] have shown that if a graph has 22-expansion up to 2K2K, then it has online matching up to KK. By a similar argument, 11-expansion up to KK implies online matching up to KK with load 33, see appendix A. Unfortunately, matches are computed in time exponential in KK.

In applications, parameters NN and KK are given, and a graph is needed with left size NN and online matching up to KK. It is desirable that the graph has:

– few right nodes, (ideally, close to KK),

– few edges, (ideally, close to NN), and

– fast matching time (ideally, the algorithm should be “local,” i.e., it should inspect only the neighborhoods of a few left nodes).

Therefore, an important open question implicitly formulated in [FFP88] is to find graphs that achieve the above 3 objectives. We come close to this goal.

We show that a graph with expansion factor equal to a large fraction of the left degree (i.e., a lossless expander) has polynomial-time online matching and, moreover, if we allow small load, it has logarithmic time online matching.

Proposition 1.1.

If a graph with NN left elements and left degree DD has (23D+2)(\tfrac{2}{3}D+2)-expansion up to KK, then it has online matching up to KK and each match of the strategy is computed in time poly(N)\operatorname{poly}(N).

Theorem 1.2.

If a graph with NN left elements and left degree DD has (23D+2)(\tfrac{2}{3}D+2)-expansion up to KK, then it has online matching up to KK with load O(logN)O(\log N), and the matching strategy requires O(DlogN)O(D\log N) amount of computation to compute each match and process each retraction.444 The runtimes are expressed assuming the Word RAM model with cell size = 1 bit. If the cell size is Θ(logN)\Theta(\log N), which is common in the graph algorithms literature, then the runtime for each match is O(D)O(D).

The algorithms receive the game state in the most natural way, see the first paragraphs of section 2 and the definition in section 4 below for details. The algorithms use a datastructure to store information for faster computation of future matches. The load =O(logN)\ell=O(\log N) can be reduced to 11, by making \ell clones of the right side connected to the left side as in the original graph. This yields a graph in which the left degree and the right size increase only by a factor of \ell and the runtime remains O((left-degree)logN)O(\text{(left-degree)}\cdot\log N).

In theorem 1.2, the running time for computing a match is double exponentially faster than in [FFP88]. There exist non-explicit constructions of lossless expanders (see lemma 5.2) in which the right size is O(KlogN)O(K\log N) and the number of edges is O(NlogN)O(N\log N). Hence, the 3 objectives (the right size, number of edges, and matching time) are simultaneously optimal up to a O(logN)O(\log N) factor. Known explicit constructions of lossless expanders (see theorem 6.2) provide graphs with online matching in which the right size, number of edges, and matching time are optimal up to quasipoly(logN)\operatorname{quasipoly}(\log N).

These results add a new entry to the list of wonderful properties of lossless expanders (for an overview, see [HLW06, Chapter 10] or [CRVW02, section 1.3]). The power of the main theorem and of various related online matching games that are used in its proof will be illustrated in 3 applications below.

Proof ideas

Proposition 1.1 is proven in section 2. The idea is to assign arbitrary free neighbors for all requested nodes, with the exception of left nodes that have 1/3 of their neighbors already assigned to other nodes. Such a node is said to be critical and is “protected” by receiving a carefully chosen virtual match. This match is converted into a real match if the node is requested and it is released if the fraction of busy neighbors decreases below 1/3. The large expansion and the unique neighbor property of lossless expanders are used to show that not too many nodes can be simultaneously critical and to find the virtual matches.

For theorem 1.2, the idea is to combine 2 matching strategies. The first one is the slower procedure from proposition 1.1. The second one, presented in section 3, is a greedy procedure that runs in time O(DlogN)O(D\log N) as required, but can not assign matches for a few problematic left nodes. Fortunately, a small subset containing these nodes can be identified well in advance, i.e., many requests before such a problematic request might happen, and handled by the slower procedure on a separate copy of the graph. In particular, this implies that there are not too many of such bad requests, and this leads to a small amortized runtime. We next interlace the two procedures on further copies of the graph. This allows de-amortization and leads to the claimed fast worst-case running time.

Application 1: one bitprobe storage schemes for dynamic sets.

The goal is to store a subset SS of a large set {1,,N}\{1,\ldots,N\} to answer membership queries “Is xx in SS?”. Let K=#SK=\#S be the size. A simple way is to store SS in a sorted list. This requires KlogNK\lceil\log N\rceil bits of memory, and given xx, one can determine whether xx is in SS by reading (logK+1)logN(\lceil\log K\rceil+1)\cdot\lceil\log N\rceil bits from the table. An alternative is to have a table of NN bits and set bit xx equal to 11 if and only if xSx\in S. Now the query “Is xSx\in S?” can be answered by reading a single bit. Also, one can insert or delete an element by modifying a single bit. The cost is that the table is long, since typically NKN\gg K. We show that the advantages of the latter approach can be obtained with a data structure whose size is close to KlogNK\log N.

A 1-bitprobe storage scheme (also called a bit vector) is a data structure that answers a membership query “Is xx in SS?” by reading a single bit. It is a fundamental data structure introduced by Minsky and Papert in their book on perceptrons [MP69]. See [BMRV00, Rom14, GR17, DPR22] for historic and recent references. In [BMRV00], lossless expanders are used to build 1-bitprobe storage schemes with short tables in which membership queries are answered probabilistically with small error ε\varepsilon.555Such 1-bitprobe storage schemes are different from Bloom filters which store an approximation of the set. More precisely, a Bloom filter stores a superset S’ of the intended S. Thus for every xx in SSS^{\prime}-S (the false positives) the error probability of the query “Is xx in SS?” is 1, and for xx in SS or in USU-S^{\prime} the error probability is 0 (and the probability over the choice of the hash functions used by the Bloom filter that an element is in SSS^{\prime}-S is ε\varepsilon). Using a non-explicit expander they obtain storage size O(1ε2KlogN)O(\tfrac{1}{\varepsilon^{2}}K\log N). Note that this is close to the lower bound KlogNO(1)K\log N-O(1) for any set data structure. They also have an explicit construction achieving storage size O((1εKlogN)2)O((\tfrac{1}{\varepsilon}K\log N)^{2}). Ta-Shma [Ta-02] and Guruswami, Umans, and Vadhan [GUV09, Theorem 7.4] give explicit constructions with smaller storage size. In all these schemes, making a membership query (i.e., finding the location in the data structure of the bit that is probed) takes time poly(log(N/ε))\operatorname{poly}(\log(N/\varepsilon)).

These 1-bitprobe storage schemes work for static sets, in the sense that any updating of SS requires the recomputation of the entire data structure, which takes time poly(Klog(N/ε))\operatorname{poly}(K\log(N/\varepsilon)). We obtain explicit 1-bitprobe storage schemes for dynamic sets. Membership queries also take time poly(log(N/ε))\operatorname{poly}(\log(N/\varepsilon)). Insertion and deletion of an element takes time quasipoly(log(N/ε))\operatorname{quasipoly}(\log(N/\varepsilon)). The storage size is smaller than in the previous explicit schemes for static sets provided ε1/K1/log2logK\varepsilon\geq 1/K^{1/\log^{2}\log K}, see table 1. Full definitions are given in section 7. The proofs only depend on sections 3 and 6.

storage size reference
O(KlogN(1/ε)2)O(K\cdot\log N\cdot(1/\varepsilon)^{2}) [BMRV00]
O((KlogN1/ε)2)O((K\cdot\log N\cdot 1/\varepsilon)^{2}) [BMRV00]
Kexp(O((loglogNε)3))K\cdot\exp(O((\log\frac{\log N}{\varepsilon})^{3})) [Ta-02]
Kpoly((logN)/ε)exp(log((logN)/ε)logK)K\cdot\operatorname{poly}((\log N)/\varepsilon)\cdot\exp(\sqrt{\log((\log N)/\varepsilon)\cdot\log K}) [GUV09]
Kpoly(logN)exp(O((log(1εlogK)loglogK))K\cdot\operatorname{poly}(\log N)\cdot\exp(O((\log(\tfrac{1}{\varepsilon}\log K)\cdot\log\log K)) Theorem 7.1
Table 1: 1-bitprobe storage schemes. The first scheme is non-explicit, the others explicit. The last is for dynamic sets, the others for static sets.

All previous explicit 1-bitprobes required lossless expanders with a special “list-decoding” property (see [GUV09, theorem 7.2]), while our approach works with any lossless expander. Thus future improvements in explicit lossless expanders will give better dynamic 1-bitprobes. This feature of our method also opens the possibility of implementations that are attractive in practice by using constructions based on tabulation hashing [Tho13] or empirical hashing methods, see the remark on page 7.


Proof idea. This result does not follow directly from theorem 1.2 or proposition 1.1. It follows from a related but incomparable result. Let SS be a subset of left nodes of a graph with left degree DD. An ε\varepsilon-rich matching for SS is a set of edges so that each node in SS is covered at least (1ε)D(1-\varepsilon)D times. We also want that, for some small number \ell, that each right node is incident to at most \ell edges. If every set SS of size at most KK has this property, we say that the graph has ε\varepsilon-rich matching up to KK with load \ell. This is stronger if (1ε)D>1(1-\varepsilon)D>1. On the other hand, we consider a weaker version of the online matching game by adding the restriction of TT-expiration: Requester must retract an edge at most TT rounds after being added to the matching.

We show that a graph with ((1ε)D)((1-\varepsilon)D)-expansion up to 2K2K has (2ε)(2\varepsilon)-rich online matching up to KK with load O(logK)O(\log K) in the game with KK-expiration. This follows by a modification of the greedy algorithm in section 3. The modification is given in section 6 (sections 2 and 4 are not needed for this application). Next, composing such a graph with a certain graph based on simple hashing, we obtain explicit graphs with the same type of matching but with load 11. Moreover, the right size is Kquasipoly(log(NT))K\cdot\operatorname{quasipoly}(\log(NT)), which is almost optimal, see corollary 6.3. A slightly weaker result is proven in [BZ23, corollary 2.13], without explicitly referring to matching.

For the 1-bitprobe, we use a graph GG that has ε\varepsilon-rich matching (with load 11) up to K+1K+1 for the game with 2K2K expiration. To each right node we associate 1 bit of the bitvector and initially all these bits are set to 0. When an element xx is inserted in SS, it is matched with (1ε)(1-\varepsilon) fraction of its neighbors and the associated bits are set to 11. When we query some xSx\not\in S, we can still match xx with (1ε)(1-\varepsilon) fraction of its neighbors (because GG has matching up to K+1K+1 and there exist only at most KK matches for the elements in SS) which means that the associated bits are set to 0. Therefore for every xx, (1ε)(1-\varepsilon) fraction of its neighbors indicate if xx is in SS or not. This assumes that the game has 2K2K-expiration, but this requirement can be easily satisfied by periodically refreshing the matches of nodes with old assignments.

Application 2: static and dynamic dictionaries with non-adaptive probes

A dictionary is a datastructure for storing a set SS of items, where an item is a pair (key, value) and no two items have the same key. The keys are elements of a large ambient set, called the Universe. We ignore in our discussion the value component because in most implementations from the location of the item in the datastructure, the associated value can be retrieved in constant time. Therefore we view the datastructure as a table of cells, where each cell can store a key xx. The static dictionary supports the operation query(x)x), which returns the index of the cell containing xx if xSx\in S, and NIL, otherwise. Note that this is stronger than the membership query from Application 1 with bitprobe storage, which only had to return 1 bit indicating if xx is in SS or not. The dynamic dictionary supports in addition the operations insert(xx) and delete(xx) for updating the dictionary.

The standard implementations use hash functions and various strategies for handling collisions such as chaining, linear probing, cuckoo chaining, and so on. The perfect hashing scheme for static dictionaries of Fredman, Komlós and Szemerédi [FKS84] does the query operation in O(1)O(1) time. Dietzfelbinger at al. [DKM+94] have a scheme for dynamic dictionaries with update operations running in expected amortized O(1)O(1) time. There are various improvements in various aspects but it is not in our scope to present this vast and important area. We refer the reader to [LPPZ23, PY20, LPP+24] for discussions of the literature that is relevant for our application.

An operation(xx) (where operation is one of query, insert or delete) is non-adaptive if the locations in the datastructure that are accessed during its execution are a function (possibly probabilistic) of xx only (so, they are independent of previous operations).

Note that all the schemes based on hash functions are adaptive: first a description of the hash function hh stored in the datastructure has to be retrieved in order to calculate h(x)h(x), and next the cell with address h(x)h(x) in the hash table must be probed. In many schemes, subsequent additional adaptive probes are required to handle collisions. Binary search and binary search trees (which are stronger than hash tables because they also support predecessor search) also have adaptive access to the memory.

Are there efficient schemes with non-adaptive operations? This is an interesting theoretical question. It also has practical implications because non-adaptive probing is suitable for parallel algorithms which can reduce the overall response latency. Persiano and Yeo [PY20, LPP+24] have shown lower bounds implying that query cannot be done non-adaptively with O(1)O(1) probes. However, if the probes are done in parallel the query time can still be constant.

As in Application 1, let NN be the size of the Universe and KK the size of SS (for the dynamic version, the set SS has during its entire history at most KK items).666Many papers (for instance [LPPZ23, LPP+24]) in the datastructure literature use uu for the size of the Universe and nn for the size of SS. Typically, NKN\gg K. The lower bound in [PY20] is in the standard cell probe model in which computation is free of charge and the data structure consists of ss memory cells, each cell having size ww bits. The lower bound in [PY20] is more general, but in the particular and natural setting w=Θ(logN)w=\Theta(\log N), it states that for a static dictionary with non-adaptive query (which can be randomized, but with error probability 0) the expected number of probes is t=Ω(log(N/K)/log(s/K))t=\Omega(\log(N/K)/\log(s/K)). Recently, Larsen et al. [LPPZ23, LPP+24] have shown that this lower bound is tight, improving upon [BHP+06]. Their construction is non-explicit (more precisely, they build using the probabilistic method a graph with 11-expansion up to KK which is assumed to be available to query) and they ask for an efficient explicit scheme. We present such schemes for both static and dynamic dictionaries (note that the result in [LPPZ23, LPP+24] is only for the static case).

Our static dictionary has s=5Ks=\color[rgb]{1,0.4,0.4}\definecolor[named]{pgfstrokecolor}{rgb}{1,0.4,0.4}5\color[rgb]{0,0,0}\definecolor[named]{pgfstrokecolor}{rgb}{0,0,0}\pgfsys@color@gray@stroke{0}\pgfsys@color@gray@fill{0}K (with cell size w=logNw=\log N)777For simplicity, we did not optimize ss. In fact, for any ε>0\varepsilon>0, one can achieve s=(4+ε)Ks=(4+\varepsilon)K (with w=logNw=\log N), with easy adjustments in the proof. and the number of non-adaptive probes is t=Θ(log5N)t=\Theta(\log^{5}N). It is explicit and deterministic and the runtime for computing one probe (i.e., computing the location in the datastructure that is read) is poly(logN)\operatorname{poly}(\log N). The dictionary in [LPPZ23, LPP+24] achieves the better parameters s=2Ks=2K (with w=logNw=\log N) and t=log(N/K)+5t=\log(N/K)+5 but, as mentioned, is non-explicit (we note that their scheme also works for larger ss in which case tt is smaller).

For the dynamic version, we have two schemes which are similar, however one is probabilistic, and the other one is deterministic. Since we use an explicit graph, in both schemes the runtime for doing one probe in the datastructure is poly(logN)\operatorname{poly}(\log N). In the probabilistic version, all operations are non-adaptive, the datastructure size is s=O(KlogN)s=O(K\log N) (with cell size w=Θ(logN)w=\Theta(\log N)) and the number of probes is t=O(log6N)t=O(\log^{6}N). The operations query and delete succeed with probability 1, and each execution of insert(xx) fails to insert xx with probability at most 2Ω(N)2^{-\Omega(N)}, where the probability is over the randomness of the previous N3N^{3} update operations. As far as we know, this is the first dynamic dictionary in which all operations are non-adaptive (if we ignore the trivial solution of using a bitvector of length NN). In the deterministic version, query and delete are non-adaptive but insert is adaptive.888If the history of the dictionary is limited to O(N)O(N) operations (for instance, if the dictionary is reconstructed after every batch of O(N)O(N) operations), then all operations can be made non-adaptive. The advantage is that s=O(K)s=O(K) (with w=Θ(logN)w=\Theta(\log N)) is optimal (up to the constant in O()O()) and t=O(log5N)t=O(\log^{5}N).

Östlin and Pagh [ÖP02] and Berger et al. [BHP+06] have also used a type of online matching in expanders to implement dynamic dictionaries in which query is non-adaptive and insert and delete are adaptive. Compared to our approach, the main difference is that they allow the Matcher to change previous matches. This makes the matching strategy easier but causes the dictionary updates to be adaptive. Also, they use lossless expanders whereas we use graphs with 1-expansion and for this reason we obtain smaller ss.

Proof ideas. For the static dictionary we present here the entire proof. Exactly as in [LPPZ23], we take a bipartite expander that has the set of left nodes = Universe and 11-expansion up to KK. Each right node is associated with a memory cell in which elements of the Universe can be written (recall that cell size w=Θ(logN)w=\Theta(\log N)). By Hall’s theorem for any subset SS of the left side of size at most KK, there is an injective mapping ff from SS to the right side. We store every element xx in SS at the memory cell f(x)f(x). When we do query(x)(x) for an arbitrary xx in Universe, we inspect every right neighbor of xx to see if one of them contains xx. [LPPZ23] obtains the graph with the probabilistic method. Instead, we use the explicit 11-expander in proposition 1.3 and we obtain the static dictionary with the parameters claimed above.

Proposition 1.3.

For each NN and KNK\leq N there exists an explicit graph with left size NN, right size 5K5K, left degree O(log5N)O(\log^{5}N), and 11-expansion up to KK.

The proof is given in section C. It relies on the dispersers in [TSUZ07] and it improves similar constructions in [BMVZ18, section 3.2], [Teu14], and [Zim14, Lemma 4].

For the dynamic dictionary (both the probabilistic and the deterministic versions) the proof is similar but instead of using offline matching guaranteed by Hall’s theorem, we do online matching in the game with the TT-expiration restriction (recall that this means that no match is allowed to last more than TT rounds). The key fact is that in section 3 we design a Matcher strategy for these games that finds a match for a left node only by inspecting its neighbors, and so it is non-adaptive. As in the static case, we associate to each right node a memory cell and when xx is inserted it is written in the cell matching it. To do query(xx), we check if the cell associated to some neighbor of xx contains xx or not. By proposition 3.1, the Matcher strategy wins in graphs with 1-expansion and then, essentially, by instantiating with the graph in LABEL:{t:constexpander} we obtain small ss and tt.

Like in 1-bitprobes, it remains to satisfy the expiration restriction by refreshing the matches of some elements. The choice of which element is refreshed is essentially the difference between the probabilistic and the deterministic versions. In the probabilistic version, we play the online matching game with N3N^{3}-expiration. When we do an insert we also refresh a random element of Universe (which, recall, has size NN). Note that insert remains non-adaptive. The probability that some matching is not refreshed for more than N3N^{3} rounds is 2Ω(N)2^{-\Omega(N)}. In the deterministic version, we play the online matching game with KK-expiration, and now when we do an insert, we refresh the oldest element in the dictionary. This causes insert to be adaptive. The advantage is that the expiration parameter is smaller (KK compared to N3N^{3}) and therefore we can win the game in a graph with a smaller number of clones, implying a smaller ss in the deterministic version.

Application 3: non-blocking networks.

Switching networks are used for the transfer of information between a large number of nodes. For example, in the early days of telephone networks, when there were only a few phones in a town, people made pairwise connections between all phones. When the number of phones grew, this was no longer feasible, and switching stations were introduced. Their theoretical study was initiated by Shannon [Sha50] and was the motivation for introducing expander graphs [BP73, Mar73]. Currently there is a large literature, both in the engineering and the theoretical computer science fields. See the book [Hwa04] for more history.

Nowadays, switching networks are important in various engineering applications where a large number of components need to communicate. Unlike telephone networks, these applications mainly concern a bipartite variant with inputs on one side and outputs on the other side, see [Hwa04]. In such graphs, the aim is to connect all output nodes to any permutation of input nodes using node disjoint paths.

An NN-network is a directed acyclic graph in which NN nodes are called inputs and NN nodes are called outputs. Its size is the number of edges. A rearrangeable NN-network is such a network in which for every 1-to-1 function ff from outputs to inputs, there exist NN node disjoint paths that connect each output node f(i)f(i) to the input node ii.

For example, a fully connected bipartite graph with left and right sets of size NN defines a rearrangeable NN-network with N2N^{2} edges. Another example is given in figure 1. The goal is to construct networks with a minimal number of edges. Since there are N!N! different mappings, the minimum is at least logN!\log N!, which is at least N(logN2)N(\log N-2) by Stirling’s formula.

We use a generalized variant of rearrangeability, in which several output nodes may be connected to the same input, but each output is connected to at most 1 input. In terms of broadcasting, this means that several outputs can listen to the same input. Moreover, the connection problem needs to be solved dynamically. For this, 2 closely related requirements exist, which are called strict-sense non-blocking connector and wide-sense non-blocking connector, see [Hwa04]. We use the second one, which is weaker, and is defined by a game.

Connection game. The game is played on an NN-network. Two players, called Requester and Connector, both know the network and alternate turns. They maintain a set of at most NN trees. The root of each tree must be an input and the leaves must be outputs. The trees must be node disjoint. Initially, the set of trees is empty. Requester starts.

At his turn, Requester may remove zero or more trees. Afterwards, he may select an input xx and an output yy such that yy does not lay on any of the trees.

At her turn, Connector may create or extend a tree so that the above conditions are satisfied. Afterwards, there should be a tree in which xx is the root and yy is a leaf. If this is not true, she looses.

Definition.

A wide-sense non-blocking generalized NN-connector is an NN-network in which Connector has a strategy in which she never looses. We refer to such a network simply as NN-connector.

Figure 1: A connector with 3 inputs (the nodes in the first column) and 3 outputs (the nodes in the last column), depth 3, and size 24.

A fully connected bipartite graph is an NN-connector. An NN-connector was given in [FFP88] that has O(NlogN)O(N\log N) edges. This is optimal within a constant factor. The graph is explicit but the path finding algorithm (which is the algorithm that computes Connector’s reply) is very slow. Afterwards, in [ALM96] an explicit NN-connector is constructed of size O(NlogN)O(N\log N) in which also the runtime of the path finding algorithm is O(logN)O(\log N), and this is optimal within a constant factor. See [ALM96] or [Hwa04, chapter 2].

The depth of a network is the length of the longest path between an input and an output. We focus on constant depth NN-connectors. In [PY82] it is shown that NN-connectors of depth tt have at least tN1+1/ttN^{1+1/t} edges. In [FFP88] non-explicit constructions of NN-connectors are given of size O(N1+1/tlog11/tN)O(N^{1+1/t}\log^{1-1/t}N), but again the path finding algorithm runs in time exponential in NN. They ask whether a generalized connector exists with small size and an efficient path finding algorithm. They do not specify explicitly, but “small size” is usually considered to be a value that is N1+1/tNo(1)N^{1+1/t}\cdot N^{o(1)}, see [WZ99], and “efficient” should ideally mean that the runtime is poly(logN)\operatorname{poly}(\log N). Some explicit constant-depth NN-connectors are known with path finding algorithms running in time poly(logN)\operatorname{poly}(\log N), but their size is not optimal, see [Hwa04, chapter 2]. For instance, for odd tt, the Clos network of depth tt has size Θt(N1+2/(t+1))\Theta_{t}(N^{1+2/(t+1)}).

In [WZ99, Th. 5.4] an explicit construction of size N1+1/texp((loglogN)O(1))N^{1+1/t}\exp((\log\log N)^{O(1)}) was obtained, but the path finding algorithm is the same slow one from [FFP88].

In section 5, we present a non-explicit constant depth NN-connector whose size is optimal up to factors poly(logN)\operatorname{poly}(\log N) and with a path finding algorithm running in time poly(logN)\operatorname{poly}(\log N). Here we assume that the input of this algorithm is a description of the state of the connection game that includes the graph999For each node the input specifies the degree and a list of neighbors in arbitrary order. and the algorithm may use a data structure.

Corollary 1.4.

For all tt and NN, there exists an NN-connector of depth tt and size

N1+1/tpoly(logN)N^{1+1/t}\operatorname{poly}(\log N)

with a poly(logN)\operatorname{poly}(\log N) time path finding algorithm.

An NN-connector is explicit if the ii-th neighbor of a node is computed in time poly(logN)\operatorname{poly}(\log N). We present an explicit connector with small size and a path finding algorithm running in quasipoly(logN)\operatorname{quasipoly}(\log N) time.

Corollary 1.5.

For all tt and NN, there exists an explicit NN-connector of depth tt, size

N1+1/texp(O(log2logN)),N^{1+1/t}\exp(O(\log^{2}\log N)),

with a path finding algorithm with runtime exp(O(log2logN))\exp(O(\log^{2}\log N)).

Proof idea. NN-connectors are obtained by composing several graphs with online matching, see fig. 2 for the idea. We apply this to lossless expanders, which according to theorem 1.2 have fast online matching. The path-finding algorithm for the construction of depth tt applies tt times an online matching algorithm, and hence, is fast as well. By instantiating with the non-explicit expander from lemma 5.2 and with the explicit one from theorem 6.2, we obtain the parameters in the two corollaries.

Open questions

Theorem 1.2 assumes large expansion, logarithmic load, and that the algorithm uses a data structure. We do not know if we can strengthen any of these assumptions. The strongest claim that we can not refute is the following.

Open question 1. Does there exist ee and \ell with e+3e+\ell\leq 3 such that each graph with ee-expansion up to KK has online matching up to KK with load \ell, where the time for computing matches is O(DlogN)O(D\log N) without using a data structure.101010 Recall that the input is the state of a game with the underlying graph. We do not need to process retractions, since there is no data structure.

The following open question is weaker than the above open question. However, if true, then the size of explicit connectors with depth tt can be further improved to N1+1/tpoly(logN)N^{1+1/t}\operatorname{poly}(\log N) instead of N1+1/tquasipoly(logN)N^{1+1/t}\operatorname{quasipoly}(\log N). (Recall that the lower bound is tN1+1/ttN^{1+1/t}.)

Open question 2. Does 11-expansion up to KK imply online matching up to KK with load O(logN)O(\log N) in which matches and retractions are processed in time poly(DlogN)\operatorname{poly}(D\log N) with a data structure? (In other words, can the restriction of TT-expiration be removed in proposition 3.1?)

The above claim on the applications follows from the explicit 11-expander in proposition 1.3 which has right size #R=O(K)\#R=O(K) and D=poly(logK)D=\operatorname{poly}(\log K). In contrast, the state-of-the-art explicit graph with (2D/3+2)(2D/3+2)-expansion up to K has D=poly(logN)2O((loglogK)2)D=\operatorname{poly}(\log N)\cdot 2^{O((\log\log K)^{2})} and #R=Kpoly(D,logN)\#R=K\cdot\operatorname{poly}(D,\log N), see theorem 6.2 below, obtained from [LOZ22, theorem 18].

A further relaxation of the last open question is to require poly(N)\operatorname{poly}(N) runtime instead of poly(logN)\operatorname{poly}(\log N). Proving that such an algorithm does not exist requires some hardness assumption because if P = NP, the algorithm from [FFP88, proposition 1] runs in time poly(DN)\operatorname{poly}(DN).

The main result is only used for the 3rd application, and the other applications follow from parts of its proof. The question is whether the main result can be strengthened to get all applications from a single result. We tried hard to use a single result to obtain both the 1st and 3rd application. Therefore, we expect a negative answer to the following question.

Open Question 3. Does (D(1ε))(D(1-\varepsilon))-expansion up to KK imply O(ε)O(\varepsilon)-rich online matching up to cKcK for some c>0c>0?

Summary and final remarks

We analyze 3 related online matching games in bipartite graphs.

  1. (A)

    The basic game, defined on page 1.

  2. (B)

    The game with TT-expiration, which adds the requirement that Requester must drop any assignment after at most TT rounds.

  3. (C)

    The ε\varepsilon-rich matching game with TT-expiration, which adds to game (B) the constraint that the Matcher must match a requested node with (1ε)(1-\varepsilon)-fraction of its neighbors.

From the point of view of the Matcher’s strategy, game (B) is easier than game (A), and game (C) is more difficult than game (B) and incomparable with game (A). The logical dependencies between technical results and applications is given in the following figure. Game (A) is used for application 3 (NN-connectors), game (B) for application 2 (dictionaries with non-adaptive probes), and game (C) for application 1 (1-bit probes).

Prop. 3.1T-expiration (B)polylog timeProp. 1.1basic (A) poly timeApplication non-adaptive probesThm. 1.2, basic (A)polylog timeProp. 6.1ε\varepsilon-rich (C) polylog timeApplication connectorsApplication 1-bit probes

The table below provides a summary of various “Hall-type” results for online matching. If a graph with NN left nodes and left degree DD satisfies the expansion condition in column 1, then it has matching with the features in columns 2, 3, and 4. The 4-th column is the worst case runtime for finding or retracting one matching assignment.

expansion up to KK matching up to KK load runtime per match reference
11 offline 11 N/A Hall’s Theorem
11 online 33 NK+O(1)N^{K+O(1)} [FFP88], Corollary A.2
11 TT-expiration online O(logT)O(\log T) O(DlogN)O(D\log N) Proposition 3.1
2D/3+22D/3+2 online 11 poly(DN)\operatorname{poly}(DN) Proposition 1.1
2D/3+22D/3+2 online O(logN)O(\log N) O(DlogN)O(D\log N) Theorem 1.2

For game (C), any graph with (1ε)D(1-\varepsilon)D-expansion up to 2K2K has TT-expiration online (2ε)(2\varepsilon)-rich matching up to KK with load O(logT)O(\log T), in which a matching assignment/retraction can be done in time O(Dlog(TN))O(D\log(TN)). We show this for KK-expiration in section 6. The case of general TT-expiration can be shown similarly to proposition 3.1.

Technically, the most difficult is the main result, theorem 1.2. It shows that lossless expanders admit fast strategies for matching up to KK in the basic game (A). In combination with known non-explicit and explicit constructions, it yields bipartite graphs that solve the main question in a classical paper of Feldman, Friedman, and Pippenger [FFP88]. These graphs have surprisingly strong properties. Note that the right size is only K(small-factor)K\cdot\text{(small-factor)} (where (small-factor) is O(logN)O(\log N) in the non-explicit case and quasipoly(logN)(\log N) in the explicit case) and hence the neighborhoods of the NN left nodes overlap a lot. Still, for each online matching assignment of a left node, we only inspect its neighborhood and make a few additional simple computations that take less time than scanning the neighborhood.

The proof uses game (B). This game admits a greedy strategy, that only inspects the neighborhood of the requested node (and also updates a few associated counters). This feature of the algorithm is important for the application 2. In fact, this simple strategy makes the bulk of the assignments. A few remaining assignments theoretically may still exist (we proved this for the adversarial setting of the game, but it is unlikely that this happens in practice). For them, a more complex strategy (from proposition 1.1) is used, but running it requires only O(1)O(1) time per assignment.

The matching strategy for game (C) is a variant of the strategy for game (B). In the open question 3, we ask whether we can obtain a strategy for game (C) without the condition of TT-expiration. Fortunately, in application (1), TT-expiration is not a big issue, because the condition can be satisfied by just refreshing old matches, which adds only a constant factor to the runtime of the insertion algorithm.

2 Polynomial time online matching

For notational simplicity, we prove proposition 1.1 with a slightly stronger assumption: we assume expansion up to K+1K+1 instead of KK. The original proposition is proven similarly.111111 Define nodes to be critical if they have at least D/3+1D/3+1 matched neighbors (instead of D/3D/3), and follow the proof with extra +1+1’s and 1-1’s where needed. In the second lemma below, bound the number #C\#C of critical nodes by K1K-1 instead of KK. We state this variant.

Proposition.

If a graph with left size NN and left degree DD has (23D+2)(\tfrac{2}{3}D+2)-expansion up to K+1K+1 then it has an online matching algorithm up to KK in which each match is computed in time poly(N)\operatorname{poly}(N).

This algorithm is used in the faster O(DlogN)O(D\log N)-time algorithm in theorem 1.2.

Recall the online matching game with =1\ell=1. Requester and Matcher maintain a set MM of edges. They alternate turns, and at their turn they do the following.

  • Requester removes edges from MM so that #MK1\#M\leq K-1. He also selects a left node xx. We say that he requests xx.

  • If xx is not covered by MM, then Matcher must reply by adding an edge (x,y)(x,y) to MM. After this, MM must be a matching. The right node yy is called the match of xx.

The aim of Matcher is to provide correct replies indefinitely.

A matching algorithm has as input the state of the game after Requester’s move, Requester’s move itself, and some datastructure (which stores information to speed up computations in future rounds). The state of the game consists of NN, KK, the graph, and the matching. Requester’s move consists of a list of retracted edges and the requested left node. In every strategy of this paper, 2 algorithms are executed that each process a part of Requester’s move.

  • First, for each retracted edge, the retraction algorithm updates the datastructure.

  • Afterwards, the match generation algorithm is given the requested left node. It updates the datastructure and outputs a match.

The proof uses 2 technical lemmas. Let N(S)\operatorname{{N}}(S) be the set of neighbors of a set SS of nodes. Given a set SS of left nodes, we call a right node yy a unique neighbor of SS if yy has precisely 1 left neighbor in SS. The following lemma holds in any bipartite graph with left degree DD.

Lemma.

The number of unique neighbors of SS is at least 2#N(S)D#S2\#\operatorname{{N}}(S)-D\#S.

Proof.

We need to lower bound the number pp of unique neighbors. The number of vertices in N(S)\operatorname{{N}}(S) that are not unique, equals #N(S)p\#\operatorname{{N}}(S)-p. There are D#SD\#S edges with an endpoint in SS. For each such edge, the right endpoint is either unique or has at least 2 neighbors in SS. Hence,

D#Sp+2(#N(S)p).D\#S\geq p+2(\#\operatorname{{N}}(S)-p).

The lower bound of the lemma follows by rearranging. ∎

The following lemma holds for graphs satisfying the assumption in the proposition.

Lemma.

Let YY be a subset of right nodes with #Y2K+1\#Y\leq 2K+1. If a left set CC contains only nodes xx with #N(x)YD/3\#\operatorname{{N}}(x)\cap Y\geq D/3, then #CK\#C\leq K.

CC SS YY
Proof.

Suppose CC contains at least K+1K+1 elements, and let SS be a subset of CC of size exactly K+1K+1. By assumption on CC, each of its nodes has at most 23D\tfrac{2}{3}D neighbors outside YY. Thus, by expansion,

(23D+2)#S#N(S)#Y+23D#S.(\tfrac{2}{3}D+2)\#S\leq\#N(S)\leq\#Y+\tfrac{2}{3}D\#S.

This simplifies to 2#S#Y2\#S\leq\#Y. But this contradicts #S=K+1\#S=K+1 and #Y2K+1\#Y\leq 2K+1. ∎

Proof of the proposition..

The idea of the matching algorithm is to assign a “virtual match” to left nodes for which at least D/3D/3 neighbors are matched. Note that there are 2 types of matches to which we refer as standard and virtual matches. In the D/3D/3 bound, we count both types of matches. A virtual match is treated as an actual match and other nodes can not be matched to it. The virtual matches are stored in the datastructure.

Left nodes with at least D/3D/3 matched neighbors (of both types) are called critical. A virtual match will be assigned to a left node xx if and only if xx is critical and has no match.

Algorithm for retracting a match (x,y)(x,y). If xx is critical, then declare yy to be a virtual match. Otherwise, retract the match and retract all virtual matches of left nodes with less than D/3D/3 matches.

SSmatched nodesMstandMvirtM_{\textnormal{stand}}\cup M_{\textnormal{virt}} unique neighbors of SS without match

Virtual matches of critical nodes are unique neighbors.


Generating a matching for a request xx. If the request is a critical node, then its virtual match yy is returned, and thus yy is now a standard match. Otherwise, xx is matched to any neighbor that does not have a match (of either type). (Such a neighbor exists because a non-critical node has more than DD/3D-D/3 unmatched neighbors.)

After this, there might be critical nodes which do not have a match. Let SS be the set of such nodes. Virtual matches for these elements are assigned 1 by 1 as follows.

Select an unmatched right node yy that has exactly 1 neighbor in SS. Below we explain that such a yy always exists. Let xx be this single neighbor. Remove xx from SS, and declare yy to be its virtual match. Add to SS all new critical nodes without a match. Keep repeating until SS is empty. (This must happen, because an element can be added to SS at most once.) This finishes the description of the matching algorithm.


Note that the 2 algorithms above require poly(DN)\operatorname{poly}(DN) amount of computation. We may assume that DND\leq N, since otherwise the proposition is trivial. Hence, the runtime is poly(N)\operatorname{poly}(N). In the presentation of the algorithm a claim was made: the set SS of critical nodes always has at least 1 unique and unmatched neighbor. If this is true, the online matching algorithm always produces matches and the proposition is proven.


We first prove 2 other claims.

Proof that at any moment, at most KK nodes are critical. In the above algorithm, matches are added 1 by 1. Assume that just before allocating a match there are at most KK critical nodes. Then the number of standard and virtual matches is at most K+KK+K (and in fact, it is 1 less, but this doesn’t matter). Let YY be the set of matched right nodes with the new match included, thus #Y2K+1\#Y\leq 2K+1. By the second lemma, there are still at most KK critical nodes.

Proof that at any moment, all nodes in SS have exactly D3\lceil\tfrac{D}{3}\rceil matched neighbors. By construction a node is placed in SS when it has at least D3\tfrac{D}{3} neighbors. This condition is checked each time after a match is assigned, thus when a node is added to SS, it has exactly D3\lceil\tfrac{D}{3}\rceil neighbors. As long as SS is nonempty, a virtual match yy is given to a left node xx such that yy has no other neighbors in SS, and then xx is removed. Thus for all other nodes in SS, the number of matched neighbors remains the same.

Proof that in the above matching algorithm, an unmatched node yy exists that has exactly 1 left neighbor in SS. Since all nodes in SS are critical, we have #SK\#S\leq K. By the assumption on expansion, #N(S)(23D+2)#S\#\operatorname{{N}}(S)\geq(\tfrac{2}{3}D+2)\#S. By the first lemma, SS has at least (13D+4)#S(\tfrac{1}{3}D+4)\#S unique neighbors. At most 13D#S\lceil\tfrac{1}{3}D\rceil\#S of the unique neighbors can be matched, by the previous point. Hence, at least 3#S3\#S right nodes are unique and unmatched. Thus, if #S1\#S\geq 1, the required right node yy exists, and if #S=0\#S=0, no unique neighbor is needed. This finishes the proof of the claim inside the algorithm, and hence, the proposition is proven. ∎

3 Fast online matching with TT-expiration

In this section we present matching strategies for games in which Requester is restricted, culminating with a proof of proposition 3.1. They will be used in the proof of the main result, theorem 1.2, and in the application with non-adaptive dictionaries. Also, similar games define versions of ε\varepsilon-rich matching in section 6, which are used in the application with bitprobe storage schemes.

  • In the incremental matching game, Requester can not remove edges from MM. Note that such a game can not last for more than KK rounds. Matcher wins if he can reply KK times.

  • The TT-round matching game is the same as the original game, but Matcher already wins if he can reply TT times.

  • In the TT-expiring matching game, for each ii, Requester must remove the edge added in round ii during one of the rounds i+1,,i+Ti+1,\ldots,i+T. Matcher wins if he can reply indefinitely.

We say that a graph has incremental matching, respectively, TT-round matching, and TT-expiring matching if Matcher has a winning strategy in the corresponding games.

Note that incremental matching up to KK and KK-round matching are equivalent, because in the KK-round game, removing edges from the matching can only help Matcher. Also, TT-expiring matching implies TT-round matching.

Examples. Recall the 2 graphs in the introduction, which are shown again. Recall that the left graph has offline matching up to 22. This graph does not have incremental matching up to 22, because if the middle node is selected first, then 1 of the 2 other nodes can not be matched.

The right graph does have incremental matching up to 22. But it does not have 33-round matching up to 22, and also no 22-expiring matching up to 22, because Requester’s strategy from footnote 3 has 3 rounds, and in the 3rd round, the match from the 1st round is retracted.


We now define fast matching algorithms. Graphs are given in adjacency list representation and checking whether an edge belongs to the matching requires O(1)O(1) time.

Definition.

Consider a graph with NN left nodes and left degree DD. We call a matching strategy fast if the strategy can be presented by a retraction and a match generation algorithm as explained in the previous section and the runtime of both algorithms is O(DlogN)O(D\log N).

In [MRS11, p229 bottom] and [BZ23, Corollary 2.11] it is proven that 11-expansion up to KK implies fast incremental matching up to 2K2K with load 1+logK1+\lfloor\log K\rfloor. In the remainder of this section we prove the following extension of this result.

Proposition 3.1.

If a graph has 11-expansion up to KK, then it has TT-expiring fast matching up to KK with load O(logT)O(\log T).

An \ell-clone of a graph GG is a graph obtained from \ell copies of GG by identifying the left nodes.

Remarks.
– A graph GG has ee-expansion if and only if an \ell-clone has (e)(e\ell)-expansion.
– For each of the different matching games above, the following holds. A graph has matching with load \ell if and only if an \ell-clone has matching with load 1.

The proposition follows from these remarks, corollary 3.4, and lemma 3.5 below. Corollary 3.4 is a variant of the result from [MRS11, section 2.3], which we prove first.

Lemma 3.2.

If a graph has 11-expansion up to KK, then a (1+logK)(1+\lfloor\log K\rfloor)-clone has incremental matching up to KK.

Proof.

Let the copies of the clone be ordered. Node yy is a free neighbor of xx if edge (x,y)(x,y) is not in the matching.

Matching strategy. Given a request xx, select the first copy in which xx has a free neighbor, and match xx to any free neighbor in this copy.

For K=1K=1, correctness is trivial. For larger KK, we use induction. Assume the statement is already proven for some value of KK. We prove that with 11 more copy, incremental matching up to 2K2K is obtained.

requestsfirst copyRRMM^{\prime}other copies

MM^{\prime} covers N(R)\operatorname{{N}}(R), thus #M#N(R)\#M^{\prime}\geq\#\operatorname{{N}}(R).

Fix a moment in the game. Let MM^{\prime} be the set of edges in MM that belong to the first copy. Let RR be the set of requests whose matches do not belong to MM^{\prime}. The total number of requests is #M+#R\#M^{\prime}+\#R, and this is bounded by 2K2K during the incremental matching. It remains to show that #R#M\#R\leq\#M^{\prime}, since this implies #RK\#R\leq K and the result follows by the inductive hypothesis.

Let N(R)\operatorname{{N}}(R) denote the neighbors of RR in the first copy. Note that N(R)\operatorname{{N}}(R) is covered by edges in MM^{\prime}, because if request xx is not matched in the first copy, then its neighbors N(x)\operatorname{{N}}(x) are covered by MM^{\prime} by choice of the algorithm. By 1-expansion, we have

#R#N(R)#M.\#R\leq\#\operatorname{{N}}(R)\leq\#M^{\prime}.\qed

Note that the above proof provides a matching strategy which is fast, because it suffices to check all the neighbors in the clone of the requested left node, which is done in time “the degree of the (1+logK)(1+\lceil\log K\rceil)-clone” times O(logN)O(\log N). There is no need for a data structure. However, when we transfer from matching in the (1+logK)(1+\lceil\log K\rceil)-clone to matching in the original graph with load, then we do need a data structure for storing the load, since iterating over the edges incident on a right node may take a long time.

Corollary.

If a graph has 11-expansion up to KK, then it has fast incremental matching up to KK with load (1+logK)(1+\lceil\log K\rceil).

Proof.

We run the algorithm from the previous lemma after merging the copies of each right node. We now use a data structure to maintain the load of each right neighbor, and a requested node is matched to a right neighbor with smallest load. Given an edge, the retraction algorithm simply decreases the load \ell of the right neighbor. The runtime of match generation is O(D(logN+log))O(D(\log N+\log\ell)). It remains to note that N\ell\leq N, thus the matching time is O(DlogN)O(D\log N), so it is fast. ∎

Lemma 3.3.

Let T/KT/K be a non-negative power of 22. If a graph has 33-expansion up to KK, then a (1+logT)(1+\lceil\log T\rceil)-clone has TT-round matching up to KK.

Proof.

The matching strategy is the same as in lemma 3.2. The proof proceeds by induction on T/KT/K. For K=TK=T the lemma is already proven by this lemma. Now assume that the lemma is already proven for some TT that is a multiple of KK. We show with 11 extra copy, 2T2T requests can be handled. We organize the requests in blocks of length 2K2K. It suffices to show that while processing each such block, at least KK matches are assigned using the extra copy, and hence, the remaining TT requests can be processed by the other copies.

Fix a block and consider a moment during the processing of its requests. Let MM^{\prime} be the set of all edges of the first copy that at some point have been present in the matching since the processing of the block started (and might still be present). Note that #M3K\#M^{\prime}\leq 3K, because at the start of the block at most KK edges can be present, and at most 2K2K requests are processed during the block. In fact, we have #M<3K\#M^{\prime}<3K until the last request is processed.

Let RR be the set of requests in the current block that were matched outside the first copy. We show that #R<K\#R<K after adding each next match, except perhaps after the last request.

Again, let N(R)\operatorname{{N}}(R) denote the set of neighbors of RR in the first copy. As in the previous lemma, N(R)\operatorname{{N}}(R) is covered by MM^{\prime}, thus #N(R)#M\#\operatorname{{N}}(R)\leq\#M^{\prime}. Since #R<K\#R<K was true during the previous step, after 1 more match, we have #RK\#R\leq K. By 33-expansion up to KK, we conclude that

3#R#N(R)#M<3K,3\#R\leq\#\operatorname{{N}}(R)\leq\#M^{\prime}<3K,

and hence #R<K\#R<K after adding each next match, except for the last one. ∎

Corollary 3.4.

If a graph has 11-expansion up to KK, then it has fast TT-round matching up to KK with load O(logT)O(\log T).

Proof.

If T2NT\geq 2^{N}, then the result is trivial, because every nonempty graph has matching with load NN. If T<KT<K, then TT-round matching is equivalent to incremental matching up to TT, and the result follows from the previous corollary. Otherwise, we obtain 33-expansion from a 33-clone, and apply the lemma above. Next, exactly like in the above corollary, merge the copies of each right node, and use a counter to maintain its load. By the same analysis, each match is done in O(D(logN+log))O(D(\log N+\log\ell)) time, where =O(logT)\ell=O(\log T) is the maximal load. Since T<2NT<2^{N}, the matching is fast. ∎

Lemma 3.5.

If a graph has TT-round matching, then a 22-clone has TT-expiring matching. If the TT-round matching is fast and with load \ell, so is the matching for the 22-clone.

Proof.

The matching algorithm processes TT rounds on the first copy, then the next TT rounds on the other copy, then again TT rounds on the first one, and so on. At each switch, the matching has no edges in the copy because of TT-expiration. ∎

Recall that corollary 3.4 and lemma 3.5 imply proposition 3.1, thus its proof is finished.

Remark.

From proposition 3.1 we obtain (2K)(2K)-expiring matching. Two properties of the matching algorithm will be used in the application about dictionaries.

Each algorithm for generating matches for a node xx reads the datastructure only about the load of the neighbors of xx (in fact, the load on O(1)O(1) copies). Therefore, we may assume that the queried memory only depends on the queried node xx, and not on the datastructure or the matching.

In the proof of lemma 3.2, we used 1+logK1+\lfloor\log K\rfloor copies with expansion up to KK. In fact we may merge graphs with less expansion: it is enough that the ii-th graph has expansion up to K2iK2^{-i}, Since each copy allocates half of the remaining matches. Thus, if we merge graphs with expansion 2i2^{i} for i=0,1,2,,logKi=0,1,2,\ldots,\lfloor\log K\rfloor, we obtain a graph that has (2K)(2K)-expiring matching with load O(1)O(1). Moreover, the previous remark still applies.

4 Fast online matching

We finish the proof of the main result, theorem 1.2. The matching strategy combines an O(DlogN)O(D\log N) time greedy strategy from section 3 with the poly(N)\operatorname{poly}(N) time strategy of section 2. The greedy strategy allocates most matches, while the polynomial one is used for a few problematic requests that are anticipated well in advance.

Recall that in fast online matching we use a data structure to compute matches. We consider a relaxed notion of fast matching that besides algorithms to generate matches and process retractions, also has a preparation algorithm. This algorithm is run at regular intervals and does not need to be fast. This algorithm prepares the data structure for fast computation of future matches.

Definition.

We say that a graph with left size NN and left degree DD has fast online matching with TT-step preparation and load \ell if there exists an online matching algorithm that computes matches and processes retractions in time O(DlogN)O(D\log N). Moreover, each time after TT matches have been assigned, it runs a preparation algorithm that takes O(T)O(T) time.

1st copy2nd copypreparationTT matches
Remark.

A graph with fast online matching with preparation has fast online matching in the amortized sense. De-amortization is obtained as follows. A 2-clone of such a graph has fast online matching (in the standard worst-case) because blocks of TT-subsequent requests can alternatingly be given to the copies: while one copy is used for assigning matches, the other can run its preparation algorithm (in little chunks at each request). Next, if we merge the 2 clones, the load increases only by a factor of 22.

Let GG and GG^{\prime} be graphs with vertices VV and VV^{\prime}, and with edges EE and EE^{\prime}. The union of GG and GG^{\prime} is the graph with vertices VVV\cup V^{\prime} and edges EEE\cup E^{\prime}.

Lemma.

Consider two graphs with the same left set of size NN. If the first has (12D+2)(\tfrac{1}{2}D+2)-expansion up to KK and the second has polynomial time online matching up to 2K2K, then their union has fast online matching up to KK with load O(logN)O(\log N) and poly(N)\operatorname{poly}(N)-step preparation.

Before proving the lemma, we show that it implies the main result. This is not so hard to prove, because with a constant number of clones of the graph from the theorem, we obtain the graphs satisfying the conditions of the lemma. Here are the details.

Proof of theorem 1.2..

The graph GG in the assumption of the theorem has degree DD and expansion 23D+212D+2\tfrac{2}{3}D+2\geq\tfrac{1}{2}D+2. By proposition 1.1, graph GG has polynomial-time online matching up to KK. By applying the lemma to GG=GG\cup G=G, this graph has online matching up to K/2K/2 with load O(logN)O(\log N) and poly(N)\operatorname{poly}(N) preparation time.

By the remark above on de-amortization, a 2-clone of GG has online matching up to K/2K/2 with load O(logN)O(\log N). Hence, a 4-clone of GG has such matching up to KK.

Therefore, the original graph of the theorem has matching up to KK with load O(logN)O(\log N), by multiplying by 44 the constant hidden in O()O(\cdot). The theorem is proven, except for the lemma. ∎

Proof of the lemma..

Let FF be the graph with (12D+2)(\tfrac{1}{2}D+2)-expansion and let GG be the graph with polynomial time online matching. We may assume that their right nodes are disjoint, because this affects the load by at most a factor 2.

The preparation algorithm uses GG as a safety buffer to precompute in it matches for nodes that are at-risk in the sense that they have many busy neighbors in FF (the precise definition is below). The preparation and retraction algorithms share a queue containing matches in GG. Let TT be a polynomial of NN that we determine later.


Match generation for the first TT requests. Apply the fast matching algorithm from corollary 3.4 using graph FF. Since FF has 11-expansion, we obtain matching with load O(logT)O(\log T).

Preparation algorithm. Run GG’s retraction algorithm for all matches from the queue. Also run it for all precomputed matches from the previous run of the preparation algorithm that are not in the current matching.

We call a right node of FF disabled if it is matched. The others are called enabled. Let AA be the set of left nodes with at least D/2D/2 disabled neighbors (the at-risk nodes). Compute the induced subgraph FF^{\prime} of FF containing the left nodes not in AA and the enabled right nodes. The set AA and graph FF^{\prime} are fixed until the next run of the preparation algorithm and will be used in the fast match generation algorithm below.

Precompute matches in GG for all nodes in AA. Do this by generating requests 1-by-1 in any order. (We soon explain that GG’s matching algorithm will indeed produce matches.)

Match generation for request xx. If xx is in AA, return its precomputed match in GG. Otherwise, run the fast TT-round algorithm from corollary 3.4 on the graph FF^{\prime}. (We soon explain that FF^{\prime} has 11-expansion up to KK.)

Retracting (x,y)(x,y). If (x,y)(x,y) is in GG, then add the edge to the queue. Otherwise, run the retraction algorithm of FF^{\prime}.

The value of TT is chosen to be a polynomial in NN large enough so that the preparation algorithm can be performed in time TT. By corollary 3.4, the runtime of computing a match satisfies the conditions.

Above, 2 claims were made that need a proof. After this, the lemma is proven, because by construction, the load of all nodes in GG is bounded by 11, and for FF it is bounded by O(logT)O(\log T).

Proof that FF^{\prime} has 1-expansion up to KK. Let SS be a set of left nodes in FF^{\prime} of size at most KK. By expansion in FF, the set has at least (12D+2)#S(\tfrac{1}{2}D+2)\#S neighbors in FF. By choice of AA, each element in SS has at most 12D\tfrac{1}{2}D disabled neighbors in FF. Thus the number of neighbors in FF^{\prime} is at least

(12D+2)#S12D#S#S.(\tfrac{1}{2}D+2)\#S\,-\,\tfrac{1}{2}D\#S\geq\#S.

Proof that the polynomial-time matching algorithm precomputes matches for all the nodes in AA. For this, we need to show that before each request, the size of GG’s matching is at most 2K12K-1. First we show that #A<K\#A<K. Suppose that #AK\#A\geq K and let SS be a subset of AA with exactly KK elements. Let MM be the set of matches in FF. Since all matches in FF are actual (not pre-computed), we have #MK\#M\leq K. Each node in SS has at most 12D\tfrac{1}{2}D neighbors that are not covered by MM. Hence, the number of neighbors of SS in FF is at most

#M+(12D)#SK+(12D)#S.\#M+(\tfrac{1}{2}D)\#S\leq K+(\tfrac{1}{2}D)\#S.

By the expansion of SS in FF, we conclude that

(12D+2)#S#N(S)K+12D#S.(\tfrac{1}{2}D+2)\#S\leq\#\operatorname{{N}}(S)\leq K+\tfrac{1}{2}D\#S.

Hence, 2#SK2\#S\leq K, but this contradicts #S=K\#S=K.

The claim follows because less than 2K2K precomputed matches can exist simultaneously. Indeed, there are less than KK matches computed in the current run and also there are at most KK matches from previous runs (that became actual matches and have not been retracted). ∎

5 Constant-depth connectors with fast path finding algorithms

Graphs with online matching up to KK can be composed into NN-connectors of constant depth tt. The following construction was given in [FFP88, Proposition 3.2], and obtains an almost minimal number of edges.

Proposition 5.1.

Let NN be a tt-th power of an integer. Assume that for some CC and DD, for all integers c<tc<t, we have graphs with CN(c+1)/tCN^{(c+1)/t} left nodes, at most CNc/tCN^{c/t} right nodes, left degree at most DD, and online matching up to Nc/tN^{c/t}. Then, there exists an NN-connector of depth tt with at most tCDN1+1/ttCDN^{1+1/t} edges.

Recall that each connector has at least tN1+1/ttN^{1+1/t} edges (see [PY82, proposition 2.1]). Hence, the above result is minimal within a factor CDCD.

Remark.

To compute a path or extend a tree in this construction, at most tt matches need to be computed. Thus, for matching obtained from theorem 1.2 we obtain path finding in time O(tDlogN)O(tD\log N).

For the sake of completeness, we present the construction and prove the proposition. First some observations about the static case are given.

An (N,N)(N,N^{\prime})-network is a directed acyclic graph with NN input and NN^{\prime} output nodes. Recall that the network is rearrangeable if every 1-to-1 mapping from outputs to inputs can be realized using node disjoint paths.

The following 2 lemmas are directly obtained from the definitions.

Lemma.

Consider a graph with NN left and NN^{\prime} right nodes that has offline matching up to KK. The concatenation of this graph with a rearrangeable (N,K)(N^{\prime},K)-network is a rearrangeable (N,K)(N,K)-network.

Lemma.

Consider BB rearrangeable (N,N)(N,N^{\prime})-networks with the same set of inputs and disjoint outputs. The union of these BB networks is a rearrangeable (N,BN)(N,BN^{\prime})-network.

Figure 2: Construction of a 2727-connector. Left column: 3 copies of a graph with online matching up to 99. Middle: 9 copies of a graph with online matching up to 33. Right: 9 fully connected graphs.
Proof of the proposition..

Let N=BtN=B^{t} for an integer BB. The construction is illustrated for B=t=3B=t=3 in figure 2.

Construction of a rearrangeable (CN,N)(CN,N)-network. For every ctc\leq t, we construct a (CBc,Bc)(CB^{c},B^{c})-rearrangeable network of depth cc recursively. For c=1c=1, we use the complete bipartite graph with left size CBCB and right size BB.

Suppose for some c1c\geq 1, we already have such a network HH. First obtain an (CBc+1,Bc)(CB^{c+1},B^{c})-network of depth c+1c+1 by introducing CBc+1CB^{c+1} input nodes, denoted by the set II, and connect them to HH according to a graph with matching up to BcB^{c} in the statement of the proposition. Then merge BB copies of this graph having the same set II of inputs and disjoint sets of outputs.

The rearrangeability property follows from the 2 lemmas above.

Proof that the network has at most tCDBt+1tCDB^{t+1} edges. We prove this by induction on tt. For t=1t=1, the network is fully connected and has at most (CB)BtCDBt+1(CB)\cdot B\leq tCDB^{t+1} edges.

Let t2t\geq 2 and assume that the construction of a (CBt1,Bt1)(CB^{t-1},B^{t-1})-connector of depth t1t-1 contains at most (t1)CDBt(t-1)CDB^{t} edges. The (CBt,Bt)(CB^{t},B^{t})-network consists of BB such connectors and BB graphs with CBtCB^{t} left nodes. Thus, the total number of edges is at most

B(DCBt+(t1)CDBt)=tCDBt+1.B\cdot(D\cdot CB^{t}+(t-1)CDB^{t})=tCDB^{t+1}.

With exactly the same construction, connectors are obtained. The matching game on (N,N)(N,N^{\prime})-networks is defined in precisely the same way, and using this game, (N,N)(N,N^{\prime})-connectors are defined. We adapt the 2 lemmas above.

  • If a graph with sizes NN and NN^{\prime} has online matching up to KK, then its concatenation with an (N,K)(N^{\prime},K)-connector is an (N,K)(N,K)-connector.

  • The union of CC output disjoint (N,N)(N,N^{\prime})-connectors is an (N,CN)(N,CN^{\prime})-connector.

For the first item, when Requester selects an input–output pair (i,o)(i,o), this triggers a request for a match ii^{\prime} for ii in the graph with online matching, followed by a request to connect the pair (i,o)(i^{\prime},o) in the connector. Since there are KK outputs, at most KK matches are simultaneously needed and therefore both requests can be satisfied.

The second is easy to understand, since the path finding (or better tree extension) algorithms of separate copies do not interfere. Both claims together provide the connectors of the proposition. ∎

Corollary 1.5 follows by applying this construction to the matching algorithm from theorem 1.2 applied to the lossless expander obtained from theorem 6.2 as follows. Choose ε=34\varepsilon=\tfrac{3}{4} and left size N2N^{2}. For each KNK\leq N, the expander of theorem 6.2 satisfies:

max{left degree,#right setK}poly(logNexpO(log2logK))exp(O(log2logN)),\max\{\text{left degree},\frac{\#\text{right set}}{K}\}\;\leq\;\operatorname{poly}(\log N\exp O(\log^{2}\log K))\;\leq\;\exp(O(\log^{2}\log N)),

and this is bounded by NN for large NN. Let CC be the right side of the above. From this expander, we only use the first CN(c+1)/tCN^{(c+1)/t} of the N2N^{2} left nodes and drop the others. This yields the graphs satisfying the conditions of proposition 5.1 with D=exp(O(log2logN))D=\exp(O(\log^{2}\log N)).

For non-explicit constructions, we can use an expander with smaller degree. In fact, a random graph has good expansion properties as explained for example in [Vad12, theorem 6.14] or [BZ23, appendix C].

Lemma 5.2.

For each NN and KK, there exists a (34D)(\tfrac{3}{4}D)-expander up to KK with left degree D=O(logN)D=O(\log N), left size NN and right size O(KD)O(KD).

Corollary 1.4 follows from proposition 5.1 and theorem 1.2 instantiated with this expander.

6 ε\varepsilon-rich matching

We consider matchings in which a left node is matched to most of its right neighbors, and present an explicit family of graphs that have online such matchings with KK-expiration. In the next section, this is used to construct bitprobe storage schemes.

Given a graph with left degree DD and a set SS of left nodes. A set of edges is an ε\varepsilon-rich matching with load \ell
– if each element of SS is incident on at least (1ε)D(1-\varepsilon)D edges, and
– if each right node is incident on at most 1 edge.

Online ε\varepsilon-rich matching game. This game is defined in the same way as before, but now, Requester needs to remove edges such that at most K1K-1 left nodes are covered, and when he selects a left node xx, Matcher needs to cover xx with (1ε)D(1-\varepsilon)D different edges such that each right node is incident on at most \ell edges.

Definition.

A graph has online ε\varepsilon-rich matching with load \ell if it has a winning strategy in the online ε\varepsilon-rich matching game. For brevity, we drop “online” and just use “ε\varepsilon-rich matching.” Graphs with incremental and TT-expiring ε\varepsilon-rich matchings are defined similarly.

The product of 2 graphs with the same left set LL and right sets R1R_{1} and R2R_{2} is the graph with left set LL and right set R1×R2R_{1}\times R_{2} in which a left node xx is adjacent to (y1,y2)R1×R2(y_{1},y_{2})\in R_{1}\times R_{2} if and only if xx is adjacent to both y1y_{1} and y2y_{2} in the respective graphs.

Proposition 6.1.

If a graph with degree DD has ((1ε)D)((1-\varepsilon)D)-expansion up to KK, and another graph has ε\varepsilon^{\prime}-rich matching up to 4+2logK4+2\log K, then their product has KK-expiring (2ε+ε)(2\varepsilon+\varepsilon^{\prime})-rich matching.

Remark.

This is easily generalized from KK-expiring to TT-expiring matching, provided the 2nd graph has ε\varepsilon^{\prime}-rich matching up to 4+2logmax{K,T}4+2\log\max\{K,T\}. But we do not need this.

To prove proposition 6.1, we first adapt lemma 3.2 about incremental matching.

Lemma.

If a graph has ((1ε)D)((1-\varepsilon)D)-expansion up to KK, then it has incremental (2ε)(2\varepsilon)-rich matching up to KK with load (1+logK)(1+\lfloor\log K\rfloor).

Proof.

Let DD be the degree of the graph and consider a (1+logK)(1+\lfloor\log K\rfloor)-clone. It suffices to show that in this clone every left node can be matched to D(12ε)D(1-2\varepsilon) neighbors. At the risk of being too detailed, we state the induction hypothesis exactly. For this, a more general variant of the game is used: a request consists of a node xx and a number tt with tD(12ε)t\leq D(1-2\varepsilon), and Matcher must assign tt matches to xx.

Matching algorithm given a request (x,t)(x,t). For each neighbor of xx in the original graph, collect the minimal index of a copy in which this neighbor is free. Match xx to the tt neighbors with minimal indices.

For K=1K=1, correctness is trivial. Now inductively assume that the graph has expansion up to 2K2K and that this algorithm computes incremental matches up to KK. We show that with 1 more clone it also computes incremental matches up to 2K2K by using only the first copy for at least half of its requests.

Let FF be the set of requests for which only the first copy was used and let RR be the set of other requests. Let N(F)\operatorname{{N}}(F) and N(R)\operatorname{{N}}(R) be the sets of their neighbors in the first copy.

N(FR)=N(F)rR(N(r)N(F)).\operatorname{{N}}(F\cup R)=\operatorname{{N}}(F)\cup\bigcup_{r\in R}(\operatorname{{N}}(r)\setminus\operatorname{{N}}(F)).

By choice of the algorithm, we have #N(r)N(F)(12ε)D\#\operatorname{{N}}(r)\setminus\operatorname{{N}}(F)\leq(1-2\varepsilon)D, because otherwise rr would have enough free neighbors to be matched in the first copy. By expansion up to 2K2K, we have

(1ε)D(#F+#R)#N(FR)D#F+(12ε)D#R.(1-\varepsilon)D(\#F+\#R)\leq\#\operatorname{{N}}(F\cup R)\leq D\#F+(1-2\varepsilon)D\#R.

After a calculation, we conclude that #R#F\#R\leq\#F. Thus for at least half of the requests, only the first copy is used. ∎

We obtain matching with KK-expiration by applying Lemma 3.5, which holds also for ε\varepsilon-rich matching (with the same proof). This doubles the load.

Corollary.

If a graph has ((1ε)D)((1-\varepsilon)D)-expansion up to KK, then it has (2ε)(2\varepsilon)-rich matching up to KK with load 2(1+logK)2(1+\lfloor\log K\rfloor) and KK-expiration.

To finish the proof of the proposition, we decrease the load from O(logK)O(\log K) to 11 by applying the following.

Lemma.

Assume a first graph has ε\varepsilon-rich matching up to KK with load \ell, and a second graph has ε\varepsilon^{\prime}-rich matching up to \ell. Then the product has (ε+ε)(\varepsilon+\varepsilon^{\prime})-rich matching up to KK. If the matching in the former 2 graphs is with TT-expiration, so is the matching in the product graph.

Proof.

Let GG and GG^{\prime} be the graphs in the lemma. The matching strategy in G×GG\times G^{\prime} will run the strategy in GG as well as separate copies of GG^{\prime}’s matching strategy for each right node yy in GG.

Matching strategy of G×GG\times G^{\prime} on input a left node xx. First run the matching strategy of GG on input xx, and let (x,y)(x,y) be the match. Run the yy-th copy of GG^{\prime} matching strategy on input xx, and let (x,y)(x,y^{\prime}) be the match. Output (x,(y,y))(x,(y,y^{\prime})).

By definition of load \ell, this produces an ε\varepsilon^{\prime}-rich matching in the yy-copy of GG^{\prime}.

The union of all edges in all copies of GG^{\prime} forms a set MM that satisfies the definition of ((1ε)(1ε))((1-\varepsilon)(1-\varepsilon^{\prime}))-rich matching, because given a request, GG’s strategy produces (1ε)D(1-\varepsilon)D edges covering neighbors yy, and for each such yy, the yy-copy produces edges on (1ε)D(1-\varepsilon^{\prime})D^{\prime} neighbors. Since (1ε)(1ε)1εε(1-\varepsilon)(1-\varepsilon^{\prime})\geq 1-\varepsilon-\varepsilon^{\prime}, the lemma is proven. ∎

Recall that by the previous 2 results, proposition 6.1 is proved. Finally, we apply it to explicit graphs. The first one is an explicit lossless expander based on [GUV09], and the second one is a standard hash code with prime numbers, see for example [BZ23, lemma 2.4] or appendix B for a proof.

Theorem 6.2 ([LOZ22], Th 18).

For all ε\varepsilon, NN, and KK, there exists an explicit graph with left size NN, ((1ε)D)((1-\varepsilon)D)-expansion up to KK, left degree D=(logN)O(1)(1εlogK)O(loglogK)D=(\log N)^{O(1)}(\tfrac{1}{\varepsilon}\log K)^{O(\log\log K)}, and right size Kpoly(DlogN)K\cdot\operatorname{poly}(D\log N).

Lemma.

For all ε\varepsilon, NN, and KK, there exists an explicit graph with left size NN, right size K2poly(1εlogN)K^{2}\cdot\operatorname{poly}(\tfrac{1}{\varepsilon}\log N), and ε\varepsilon-rich matching up to KK.

Corollary 6.3.

For all ε>0\varepsilon>0, KK and NN, there exists an explicit graph with left degree D=(logN)O(1)(1εlogK)O(loglogK)D=(\log N)^{O(1)}(\tfrac{1}{\varepsilon}\log K)^{O(\log\log K)} and right size Kpoly(DlogN)K\operatorname{poly}(D\log N), that has fast ε\varepsilon-rich matching up to KK with KK-expiration.

Proof.

The graph is obtained as the product of the graphs in the 2 above result. The datastructure for the matching maintains counters for nodes of the first graph. Let D1D_{1} be its degree. Selecting the D1(12ε)D_{1}(1-2\varepsilon) minimal counters takes time O(D1logN)O(D_{1}\log N), and since D1DD_{1}\leq D, the result follows. ∎

7 1-bitprobe storage scheme for dynamic sets

The goal is to store a KK-element set S[N]S\subseteq[N], where typically KNK\ll N. A 1-bitprobe (or bit vector) storage scheme is a data structure in which queries “Is xx in SS?” are answered probabilistically by reading a single bit. Previous constructions for 1-bitprobes are for static sets. We show that graphs that admit ε\varepsilon-rich matching can be used to obtain 1-bitprobe storage schemes for dynamic sets: the data structure also allows for efficient insertions and deletions from SS.

A static 1-bitprobe is a data structure (s,pos)(s,\textnormal{{pos}}) that is described by a size ss and a probabilistic algorithm pos mapping [N][N] to [s][s], which selects a bit to answer a membership query. Let [xS][x{\in}S] be 1 if xSx\in S and 0 otherwise.

Formal requirement for a 1-bitprobe with parameters N,K,εN,K,\varepsilon.121212 For notational convenience, our requirement is slightly stronger than in the standard definition, in the latter, an algorithm for membership queries either returns a bit vpos(x)v_{\textnormal{{pos}}(x)} or its negation. This affects the size by at most a factor 2, (by also storing the negation of each bit). For all S[N]S\subseteq[N] with #SK\#S\leq K there exists v{0,1}sv\in\{0,1\}^{s} such that for all x[N]x\in[N],

Pr[vpos(x)=[xS]] 1ε.\Pr[v_{\textnormal{{pos}}(x)}=[x{\in}S]]\;\geq\;1-\varepsilon.

A dynamic 1-bitprobe additionally has an update function for adding and removing elements from the set. A history is a list of integers that describes these operations chronologically, where a positive integer ii represents the addition of ii to the set, and i-i its removal.

For a history hh\in\mathbb{Z}^{*}, let set(h)\operatorname{set}(h) be the set of elements that remain after the sequence of operations, thus this is the set of positive entries ii in hh with no appearance of i-i at their right. In the definition of 1-bitprobes we consider histories that at any moment encode sets of size at most KK.

Definition.

History hh\in\mathbb{Z}^{*} is (N,K)(N,K)-legal if |hj|[N]|h_{j}|\in[N] for all j|h|j\leq|h| and if #set(h~)K\#\operatorname{set}(\tilde{h})\leq K for each prefix h~\tilde{h} of hh.

Definition.

A dynamic 1-bitprobe with parameters N,K,εN,K,\varepsilon consists of
– a size ss,
– a deterministic algorithm upd:×{0,1}s{0,1}s\textnormal{{upd}}:\mathbb{Z}\times\{0,1\}^{s}\rightarrow\{0,1\}^{s}, and
– a probabilistic algorithm pos:[N][s]\textnormal{{pos}}:[N]\rightarrow[s],
such that for each (N,K)(N,K)-legal histories hh and each x[N]x\in[N]

Pr[upd(h,0s)pos(x)=[xset(h)]] 1ε,\Pr\big{[}\textnormal{{upd}}(h,0^{s})_{\textnormal{{pos}}(x)}=[x{\in}\operatorname{set}(h)]\big{]}\;\geq\;1-\varepsilon,

where upd(h1hk,v)=upd(hk,upd(hk1,,upd(h1,v)))\textnormal{{upd}}(h_{1}\ldots h_{k},v)=\textnormal{{upd}}(h_{k},\textnormal{{upd}}(h_{k-1},\ldots,\textnormal{{upd}}(h_{1},v)\ldots)).

We construct dynamic 1-bitprobes of small size that have efficient implementations for queries and updates.

Theorem 7.1.

There exists a family of dynamic 1-bitprobes with parameters N,K,εN,K,\varepsilon with
– size K(logN)O(1)(1εlogK)O(loglogK)K(\log N)^{O(1)}(\tfrac{1}{\varepsilon}\log K)^{O(\log\log K)},
– query time (logN)O(1)(\log N)^{O(1)},
– update time (logN)O(1)(1εlogK)O(loglogK)(\log N)^{O(1)}(\tfrac{1}{\varepsilon}\log K)^{O(\log\log K)}.

We start the proof with the simpler case of static 1-bitprobes, which follows directly from graphs with ε\varepsilon-rich incremental matching.

Lemma.

If a left regular graph with left and right sets [N][N] and [s][s] has incremental ε\varepsilon-rich matching up to K+1K+1, then the mapping pos that maps a left node to a random neighbor defines a static 1-bitprobe of size ss with parameters (N,K,ε)(N,K,\varepsilon).

Proof.

Given a KK-element S[N]S\subseteq[N], run the matching algorithm for all elements of SS in an arbitrary order and let v{0,1}sv\in\{0,1\}^{s} be the string that has 1’s in precisely those indices in [s][s] that are covered by the matching.

We prove that v{0,1}sv\in\{0,1\}^{s} satisfies the 1-bitprobe condition. Indeed, if xSx\in S, then at least 1ε1-\varepsilon of xx’es neighbors are covered, and hence Pr[vpos(x)=1]1ε\Pr[v_{\textnormal{{pos}}(x)}=1]\geq 1-\varepsilon. Assume xSx\not\in S. If the incremental matching algorithm would be given xx, then, it would find (1ε)D(1-\varepsilon)D right neighbors that are not matched, since the incremental matching is up to K+1>#SK+1>\#S. By the choice of vv, the corresponding indices are 0, and hence Pr[vpos(x)=0]1ε\Pr[v_{\textnormal{{pos}}(x)}=0]\geq 1-\varepsilon. ∎

In fact, by this proof we obtain 1-bitprobes in which elements can be dynamically inserted but not removed. If there exist graphs with online ε\varepsilon-rich matching, then we could apply a similar argument and we are done, but we do not know whether such graphs with small right sizes exist.

Fortunately, it is enough to have graphs with ε\varepsilon-rich matching with (2K)(2K)-expiration. The idea is to refresh old elements. More precisely, if an element xx was inserted, and it was not removed during the KK next insertions, then we delete xx and reinsert xx. After this modification, each insertion in the probe’s history corresponds to 22 rounds of the matching game, and hence, (2K)(2K)-expiration is required.

Lemma.

Assume that there exists a graph with degree DD, left set [N][N] and right set [s][s] that has (2K)(2K)-expiring ε\varepsilon-rich matching up to K+1K+1. Furthermore, assume that the matching algorithm is fast and the datastructure uses space O(KDlogN)O(KD\log N). Then there exists a dynamic 1-bitprobe of size s+O(KDlogN)s+O(KD\log N) with parameters (N,K,ε)(N,K,\varepsilon) and update time poly(DlogN)\operatorname{poly}(D\log N). Moreover, if the graph is explicit, then the query time is poly(logD,logN)\operatorname{poly}(\log D,\log N).

Proof.

Let the pos function be defined as in the previous lemma. Note that this implies the moreover-part of the lemma.

The update function requires the storage of the matching, the last KK insertions of the history, and the datastructure of the matching algorithm. To store the matching, we use a Red-Black search tree, so that membership can be checked in time O(logN)O(\log N) and updates can be done in the same time. To store the queue with the last KK requests, we simply use a single linked list. This increases the size ss by O(KDlogN)O(KD\lceil\log N\rceil) for storing the matching, by KlogNK\lceil\log N\rceil for the queue, and by O(KDlogN)O(KD\log N) for the datastructure.

For removals, the update function first checks the presence of the element in the stored set. If not present, it is finished. Otherwise, it runs the retraction algorithm of the matching, and sets the bits of vv to zero for the right nodes that are no longer covered.

For inserting a node xx, the update function first checks whether xx is already present in the stored set. If so, it finishes. Otherwise, runs the matching algorithm for xx, and sets the assigned bits to 1. Next, it refreshes the KK-th oldest insertion (it runs the retraction and then the matching algorithm for it).

To see that this works, we need to verify that every match is retracted after at most 2K2K requests of the matching algorithm. Indeed, KK insertions in the probe’s history now correspond to at most 2K2K requests for the matching algorithm. If an element is removed after at most KK other insertions, then we are done. Otherwise, the update algorithm will retract it at the KK-th insertion. ∎

Proof of theorem 7.1..

Apply the above lemma to the graph from corollary 6.3.131313 The 1-bitprobe storage scheme in theorem 7.1 has smaller size than the 1-bitprobe storage schemes in [BMRV00, Ta-02, GUV09] (provided ε1/K1/log2logK\varepsilon\geq 1/K^{1/\log^{2}\log K}, see table 1), even though these schemes have the limitation of handling only static sets. Plugging in the above generic construction the lossless expander used in [GUV09], one obtains a 1-bitprobe storage scheme for dynamic sets with data structure size equal to (storage size from [GUV09]) ×O((logNlogK1/ε)2)\times\,O((\log N\cdot\log K\cdot 1/\varepsilon)^{2}), in which pos and upd have runtime poly(logN,log1/ε)\operatorname{poly}(\log N,\log 1/\varepsilon). Compared to  theorem 7.1, upd is faster. The reason is that the lossless expander in  [GUV09] has D=poly(logN,log(1/ε))D=\operatorname{poly}(\log N,\log(1/\varepsilon)), smaller than the left degree of the graph in theorem 6.2 (but the right set is larger).

Remark.

The explicit lossless expander GG from theorem 6.2 is based on the construction in [GUV09] and is not practical. Otherwise, the algorithms of our 1-bitprobe storage scheme in theorem 7.1 are efficient. Thorup [Tho13] constructed lossless expanders (using tabulation hashing) with worse asymptotic right sizes than [GUV09], but for realistic NN they seem practical. Since a random graph is a lossless expander with positive probability, it is possible that with pseudorandom graphs (obtained from CityHash, murmur, SHA-3), the datastructure is practical, (but with weaker proven guarantees).

8 Static and dynamic dictionaries with non-adaptive probing

A dictionary stores (key, value) pairs for fast retrieval of the values corresponding to keys. The keys belong to [N][N]. Memory is divided in cells having bitsize exactly logN\log N. The goal is to implement efficient querying by accessing the cells of the memory in parallel. For this, we aim at accessing poly(logN)\operatorname{poly}(\log N) cells whose indices only depend on the queried key, and not on the datastructure.

The constructions below are for the membership datastructure. But they also provide dictionaries, because they all have a feature in common: to determine whether xx belongs to the set, we read a few cells, and xx is in the set if and only if one of these cells contains xx. For dictionaries, one needs to store together with each key xx its corresponding value. This increases the memory by a constant factor.

Definition.

A static membership datastructure for parameters (N,K)(N,K) is a pair (s,query)(s,\textnormal{{query}}) where query:[N]×([N])s{0,1}\textnormal{{query}}:[N]\times([N]\cup\bot)^{s}\rightarrow\{0,1\} is an algorithm that computes membership queries. For all S[N]S\subseteq[N] with #SK\#S\leq K there must exist v([N])sv\in([N]\cup\bot)^{s} such that for all x[N]x\in[N]: query(x,v)=[xS]\textnormal{{query}}(x,v)=[x{\in}S]. (\bot denotes the ‘blank’ value.)

Algorithm query(x,v)\textnormal{{query}}(x,v) makes non-adaptive probes if the accessed cells of the probe only depend on the first argument xx and not on the second argument vv.

Proposition.

There exists a family of static membership datastructures with parameters (N,K)(N,K) with s=5Ks=5K (so consisting of 5K5K cells of bitsize logN\log N) in which query runs in poly(logN)\operatorname{poly}(\log N) time and makes non-adaptive probes.

Note that the bitsize of any membership datastructure is lower bounded by KlogNO(1)K\log N-O(1), hence the above size is optimal up to a constant factor. The construction is the same as in [LPPZ23], except that instead of a non-explicit expander, we use the expander from proposition 1.3. For later reference, we repeat the construction.

Proof.

We use the explicit graph with 11-expansion up to KK from proposition 1.3, which has right size 5K5K and degree D=O(log5N)D=O(\log^{5}N). Let s=5Ks=5K.

Construction of v[N]sv\in[N]^{s}. By Hall’s theorem, there exists a matching that covers SS. For each edge (x,y)(x,y), write xx in the yy-th cell.

Query function on input xx and vv. Check all cells yy such that yy is a neighbor of xx. If one of these cells contains xx, output that xSx\in S otherwise, output that xSx\not\in S.

Correctness follows directly from the construction. Since the graph is explicit, the query function can compute all neighbors of a node xx in polynomial time, and hence query runs in polynomial time. Since no other cells are scanned, the query is non-adaptive. ∎

A dynamic membership datastructure allows for insertion and removal of elements in SS. Recall from section 7 our notation for updates of SS using positive and negative numbers for insertions and removals, as well as the notation set(h)\operatorname{set}(h) and upd(h,v)\textnormal{{upd}}(h,v). Also, recall the definition of (N,K)(N,K)-legal histories in \mathbb{Z}^{*}.

Definition.

A dynamic membership datastructure with parameters N,KN,K is a triple (s,query,upd)(s,\textnormal{{query}},\textnormal{{upd}}) consisting of
– a size ss,
– an algorithm query:[N]×([N])s{0,1}\textnormal{{query}}:[N]\times([N]\cup\bot)^{s}\rightarrow\{0,1\}, and
– an algorithm upd:×([N])s([N])s\textnormal{{upd}}:\mathbb{Z}\times([N]\cup\bot)^{s}\rightarrow([N]\cup\bot)^{s},
such that for each (N,K)(N,K)-legal history hh, for all x[N]x\in[N]: query(x,upd(h,s))=[xset(h)]\textnormal{{query}}(x,\textnormal{{upd}}(h,\bot^{s}))=[x{\in}\operatorname{set}(h)]. (We use s\bot^{s} to denote the initial empty table).

Algorithm upd makes non-adaptive cell probes if the cells that it reads and writes to only depend on its first argument xx.

We present dynamic dictionaries that also have optimal size up to a constant factor.

Proposition 8.1.

There exists a family of dynamic membership datastructures for parameters N,KN,K that use O(K)O(K) cells of bitsize logN\log N and in which query and upd run in poly(logN)\operatorname{poly}(\log N) time. Moreover, query and removals in upd are non-adaptive probes.

Proof.

We use the construction of graphs with (2K)(2K)-expiring matching from the remark at the end of section 3. When applied to the expander from proposition 1.3, the right size is O(K)O(K). Let cc be the constant that bounds the load.

The matching is maintained on the cell probe v[N]sv\in[N]^{s} in the same way as for the static dictionaries, except that we allow each right node to be matched to cc nodes (instead of only 1 node). On the cell probe we also keep the datastructure for the match generation algorithm, but this datastructure is only used for insertions.

The query function simply checks the presence of xx in the lists of their neighbors and answers correspondingly. This requires exactly cD=poly(logN)cD=\operatorname{poly}(\log N) non-adaptive probes. The update algorithm follows the modifications on the matching and datastructure made by the retraction and match generation algorithms.

To retract xx, means removing xx from the list of its matched right neighbor and update O(1)O(1) information that is also stored there. Thus this is done with non-adaptive probing.

To insert xx, means running the matching algorithm, and inserting xx in the list of the selected right node. Afterwards, the oldest match is refreshed: it is retracted and reinsterted. This makes the probing adaptive, because this left node is stored on the probe. ∎

Remark.

In fact, removals by upd are memoryless, which means that the modifications of a cell only depend on this cell and no other cells. This means that retractions are done with a single round of communication, and this is faster than insertions, which require a few rounds. This might be helpful in some applications, for example, think about maintaining a database of available flight tickets in a distributed way over a slow network, where adding new tickets is not time critical, but a conflict between buyers is.

The insertions by upd are close to being non-adaptive in the sense that they only “clean up” the datastructure, and this cleanup can always be postponed for up to poly(K)\operatorname{poly}(K) other insertions. (For most insertions, no clean up is needed at all.) In fact, this clean up can be done by an independent process that does not need to know about insertions and does the work in little pieces.


A fully non-adaptive datastructure exists using probabilistic insertions. Unfortunately, its size is a factor O(logN)O(\log N) larger than in the above proposition. We do not know whether there exists a fully non-adaptive membership datastructure whose size is optimal up to a constant.

Theorem 8.2.

There exists a family of dynamic membership datastructures with parameters (N,K)(N,K) with a probabilistic algorithm upd, that
– consists of O(KlogN)O(K\log N) cells of bitsize logN\log N,
query and upd run in poly(logN)\operatorname{poly}(\log N) time and make non-adapive probes, and
– for each (N,K)(N,K)-legal history hh\in\mathbb{Z}^{*}, with probability 1exp(N)1-\exp(-N): all x[N]x\in[N] satisfy

query(x,upd(h,1s))=1xset(h).\textnormal{{query}}(x,\textnormal{{upd}}(h,1^{s}))=1\;\Longleftrightarrow\;x\in\operatorname{set}(h).
Proof.

Consider the strategy for (N3)(N^{3})-expiring matching obtained from proposition 3.1 applied to the expander from proposition 1.3. Recall that the strategy in proposition 3.1 alternates between 2 copies. One copy is used for assigning matches while the other “rests” until all its matches disappear. After N3N^{3} insertions, the roles flip. We call these copies the active and passive copies. The query and update function follow the matching algorithm in a similar way as in proposition 8.1, however, there are 2 modifications to the insertions update that have to do with refreshing.

  • We do not refresh the oldest match (because then we need to read what this is from the cell probe). Instead we select a random value of [N][N] and if it is matched in the currently passive copy, then this match is retracted and placed on the active copy.

  • If at the end of a stage the passive copy still contains a match, then all insertions during the next stage are ignored.

We transform this graph to a dynamic membership datastructures in the same way as in the proposition above. Note that now the each right node is associated to \ell cells. This finishes the construction.

By the 2 propositions, the size of the probe equals the number of right nodes times the load, which is O(K)O(logN)O(K)\cdot O(\log N). By the first modification, insertions of elements are non-adaptive. It remains to prove the last item of the theorem. Fix a history hh.

Claim. The probability that in a fixed stage of hh all insertions are ignored is at most Kexp(N2)K\exp(-N^{2}).

Proof of the claim. Fix an element xx that is matched in the passive copy at the beginning of the previous stage. The probability that this element is not refreshed in the first stage equals 11/Nexp(1/N)1-1/N\leq\exp(-1/N). The probability that this fails during the N3N^{3} insertions of the stage is at most exp(N3/N)\exp(-N^{3}/N). The claim follows by the union bound, since there are at most KK matches at the beginning of the stage.

This claim implies the proposition, because set(h)\operatorname{set}(h) contains at most KK elements, and for each element the stage of their last insertion is good with the probability of the claim. It remains to note that KNK\leq N and that N2exp(N2)exp(N)N^{2}\exp(-N^{2})\leq\exp(-N) for large NN. ∎

References

  • [ABK94] Yossi Azar, Andrei Z Broder, and Anna R Karlin. On-line load balancing. Theoretical computer science, 130(1):73–84, 1994.
  • [AKPP93] Y Azar, B Kalyanasundaram, S Plotkin, and K Pruhs. Online load balancing of temporary tasks. In Workshop on Algorithms and Data Structures (WADS), Montreal, Canada, pages 119–130, 1993.
  • [ALM96] Sanjeev Arora, F. Thomson Leighton, and Bruce Maggs. On-line algorithms for path selection in a nonblocking network. SIAM Journal on Computing, 25:149–158, 1996.
  • [Aza05] Yossi Azar. On-line load balancing. Online algorithms: the state of the art, pages 178–195, 2005.
  • [BHP+06] Mette Berger, Esben Rune Hansen, Rasmus Pagh, Mihai Puatracscu, Milan Ruzic, and Peter Tiedemann. Deterministic load balancing and dictionaries in the parallel disk model. In Phillip B. Gibbons and Uzi Vishkin, editors, SPAA 2006: Proceedings of the 18th Annual ACM Symposium on Parallelism in Algorithms and Architectures, Cambridge, Massachusetts, USA, July 30 - August 2, 2006, pages 299–307. ACM, 2006.
  • [BKV+81] M. Blum, R.M Karp, O. Vornberger, C.H. Papadimitriou, and M. Yannakakis. The complexity of checking whether a graph is a superconcentrator. Information Processing Letters, 13(4,5):164–167, 1981.
  • [BMRV00] Harry Buhrman, Peter Bro Miltersen, Jaikumar Radhakrishnan, and Srinivasan Venkatesh. Are bitvectors optimal? In F. Frances Yao and Eugene M. Luks, editors, Proceedings of the Thirty-Second Annual ACM Symposium on Theory of Computing, May 21-23, 2000, Portland, OR, USA, pages 449–458. ACM, 2000.
  • [BMVZ18] Bruno Bauwens, Anton Makhlin, Nikolai K. Vereshchagin, and Marius Zimand. Short lists with short programs in short time. Computational Complexity, 27(1):31–61, 2018.
  • [BP73] L. A. Bassalygo and M. S. Pinsker. Complexity of an optimum nonblocking switching network without reconnections. Problems of Information Transmission, 9:64–66, 1973.
  • [BRR23] Soheil Behnezhad, Mohammad Roghani, and Aviad Rubinstein. Sublinear time algorithms and complexity of approximate maximum matching. In Proceedings of the 55th Annual ACM Symposium on Theory of Computing, pages 267–280, 2023.
  • [BZ23] Bruno Bauwens and Marius Zimand. Universal almost optimal compression and Slepian-Wolf coding in probabilistic polynomial time. J. ACM, 70(2):1–33, 2023. (arxiv version posted in 2019).
  • [CKL+22] Li Chen, Rasmus Kyng, Yang P. Liu, Richard Peng, Maximilian Probst Gutenberg, and Sushant Sachdeva. Maximum flow and minimum-cost flow in almost-linear time. CoRR, abs/2203.00671, 2022.
  • [CRVW02] M. R. Capalbo, O. Reingold, S. P. Vadhan, and A. Wigderson. Randomness conductors and constant-degree lossless expanders. In John H. Reif, editor, STOC, pages 659–668. ACM, 2002.
  • [CW18] Ilan Reuven Cohen and David Wajc. Randomized online matching in regular graphs. In Proceedings of the Twenty-Ninth Annual ACM-SIAM Symposium on Discrete Algorithms, pages 960–979. SIAM, 2018.
  • [DKM+94] Martin Dietzfelbinger, Anna R. Karlin, Kurt Mehlhorn, Friedhelm Meyer auf der Heide, Hans Rohnert, and Robert Endre Tarjan. Dynamic perfect hashing: Upper and lower bounds. SIAM J. Comput., 23(4):738–761, 1994.
  • [DPR22] Shyam Dhamapurkar, Shubham Vivek Pawar, and Jaikumar Radhakrishnan. Set membership with two classical and quantum bit probes. In Mikolaj Bojanczyk, Emanuela Merelli, and David P. Woodruff, editors, 49th International Colloquium on Automata, Languages, and Programming, ICALP 2022, July 4-8, 2022, Paris, France, volume 229 of LIPIcs, pages 52:1–52:19. Schloss Dagstuhl - Leibniz-Zentrum für Informatik, 2022.
  • [FFP88] Paul Feldman, Joel Friedman, and Nicholas Pippenger. Wide-sense nonblocking networks. SIAM J. Discret. Math., 1(2):158–173, 1988.
  • [FKS84] Michael L. Fredman, János Komlós, and Endre Szemerédi. Storing a sparse table with 0(1) worst case access time. J. ACM, 31(3):538–544, 1984.
  • [GR17] Mohit Garg and Jaikumar Radhakrishnan. Set membership with non-adaptive bit probes. In Heribert Vollmer and Brigitte Vallée, editors, 34th Symposium on Theoretical Aspects of Computer Science, STACS 2017, March 8-11, 2017, Hannover, Germany, volume 66 of LIPIcs, pages 38:1–38:13. Schloss Dagstuhl - Leibniz-Zentrum für Informatik, 2017.
  • [GUV09] Venkatesan Guruswami, Christopher Umans, and Salil P. Vadhan. Unbalanced expanders and randomness extractors from Parvaresh–Vardy codes. J. ACM, 56(4), 2009.
  • [HK73] John E. Hopcroft and Richard M. Karp. An n5/2n^{5/2} algorithm for maximum matchings in bipartite graphs. SIAM Journal on Computing, 2(4):225–231, 1973.
  • [HKPS20] Monika Henzinger, Shahbaz Khan, Richard Paul, and Christian Schulz. Dynamic matching algorithms in practice. In Fabrizio Grandoni, Grzegorz Herman, and Peter Sanders, editors, 28th Annual European Symposium on Algorithms, ESA 2020, September 7-9, 2020, Pisa, Italy (Virtual Conference), volume 173 of LIPIcs, pages 58:1–58:20. Schloss Dagstuhl - Leibniz-Zentrum für Informatik, 2020.
  • [HLW06] S. Hoory, N. Linial, and A. Wigderson. Expander graphs and their applications. Bull. Amer. Math. Soc., 43:439–561, 2006.
  • [Hwa04] Frank K. Hwang. The Mathematical Theory of Nonblocking Switching Networks. World Scientific, 2004. 2nd edition.
  • [KVV90] Richard M Karp, Umesh V Vazirani, and Vijay V Vazirani. An optimal algorithm for on-line bipartite matching. In Proceedings of the twenty-second annual ACM symposium on Theory of computing, pages 352–358, 1990.
  • [LMSVW22] Hung Le, Lazar Milenković, Shay Solomon, and Virginia Vassilevska Williams. Dynamic matching algorithms under vertex updates. In 13th Innovations in Theoretical Computer Science Conference (ITCS 2022). Schloss Dagstuhl-Leibniz-Zentrum für Informatik, 2022.
  • [LOZ22] Zhenjian Lu, Igor Carboni Oliveira, and Marius Zimand. Optimal coding theorems in time-bounded Kolmogorov complexity. In Mikolaj Bojanczyk, Emanuela Merelli, and David P. Woodruff, editors, 49th International Colloquium on Automata, Languages, and Programming, ICALP 2022, July 4-8, 2022, Paris, France, volume 229 of LIPIcs, pages 92:1–92:14. Schloss Dagstuhl - Leibniz-Zentrum für Informatik, 2022.
  • [LPP+24] Kasper Green Larsen, Rasmus Pagh, Giuseppe Persiano, Kevin Yeo, Toniann Pitassi, Kevin Yeo, and Or Zamir. Optimal non-adaptive cell probe dictionaries and hashing. In Proceedings ICALP, 2024. A merge and revision of [LPPZ23] and [PY20].
  • [LPPZ23] Kasper Green Larsen, Rasmus Pagh, Toniann Pitassi, and Or Zamir. Optimal non-adaptive cell probe dictionaries and hashing. arXiv preprint arXiv:2308.16042, 2023.
  • [Mar73] G. A. Margulis. Explicit constructions of concentrators. Problems of Information Transmission, 9:325–332, 1973.
  • [MP69] M. Minsky and S. Papert. Perceptrons. MIT Press, 1969.
  • [MP97] Yuan Ma and Serge Plotkin. An improved lower bound for load balancing of tasks with unknown duration. Information Processing Letters, 62(6):301–303, 1997.
  • [MRS11] D. Musatov, A. E. Romashchenko, and A. Shen. Variations on Muchnik’s conditional complexity theorem. Theory Comput. Syst., 49(2):227–245, 2011.
  • [ÖP02] Anna Östlin and Rasmus Pagh. One-probe search. In International Colloquium on Automata, Languages, and Programming, pages 439–450. Springer, 2002.
  • [PL86] Michael D Plummer and László Lovász. Matching theory. Elsevier, 1986. A rewritten book by the same authors was published in 2009.
  • [PY82] N. Pippenger and A.C.-C Yao. Rearrangeable networks with limited depth. SIAM J. Algebraic Discrete Methods, 2:411–417, 1982.
  • [PY20] Giuseppe Persiano and Kevin Yeo. Tight static lower bounds for non-adaptive data structures. CoRR, abs/2001.05053, 2020.
  • [Rom14] Andrei E. Romashchenko. Pseudo-random graphs and bit probe schemes with one-sided error. Theory Comput. Syst., 55(2):313–329, 2014.
  • [Sha50] C. E. Shannon. Memory requirements ina telephone exchange. Bell Sys. Tech. Jour., 29:343–349, 1950.
  • [Ta-02] Amnon Ta-Shma. Storing information with extractors. Inf. Process. Lett., 83(5):267–274, 2002.
  • [Teu14] Jason Teutsch. Short lists for shortest descriptions in short time. Computational Complexity, 23(4):565–583, 2014.
  • [Tho13] Mikkel Thorup. Simple tabulation, fast expanders, double tabulation, and high independence. In 54th Annual IEEE Symposium on Foundations of Computer Science, FOCS 2013, 26-29 October, 2013, Berkeley, CA, USA, pages 90–99. IEEE Computer Society, 2013.
  • [TSUZ07] A. Ta-Shma, C. Umans, and D. Zuckerman. Lossless condensers, unbalanced expanders, and extractors. Combinatorica, 27(2):213–240, 2007.
  • [Vad12] Salil P. Vadhan. Pseudorandomness. Foundations and Trends in Theoretical Computer Science, 7(1-3):1–336, 2012.
  • [WZ99] Avi Wigderson and David Zuckerman. Expanders that beat the eigenvalue bound: Explicit construction and applications. Combinatorica, 19(1):125–138, 1999.
  • [Zim14] Marius Zimand. Short lists with short programs in short time - A short proof. In Arnold Beckmann, Erzsébet Csuhaj-Varjú, and Klaus Meer, editors, Language, Life, Limits - 10th Conference on Computability in Europe, CiE 2014, Budapest, Hungary, June 23-27, 2014. Proceedings, volume 8493 of Lecture Notes in Computer Science, pages 403–408. Springer, 2014.

Appendix A The (slow) online matching algorithm of Feldman, Friedman, and Pippenger

For completeness, we present a special case of [FFP88, Proposition 1]. Our proof is based on the original one. The result implies that if a graph has offline matching up to KK, then it has online matching up to KK elements with load 33.

Theorem A.1.

If a graph has 1-expansion up to KK and each left set SS with K<#S2KK<\#S\leq 2K has at least #S+K\#S+K neighbors, then the graph has online matching up to KK.

Corollary A.2.

If a graph GG has 11-expansion up to KK, then it has online matching up to KK with load 33.

Proof.

We modify GG by taking 3 clones of each right node. The new graph GG^{\prime} satisfies the hypothesis of theorem A.1. Indeed, let SS be subset of left nodes with K<#S2KK<\#S\leq 2K. We partition SS into a set S1S_{1} of size KK and a set S2S_{2} of size #SKK\#S-K\leq K. S1S_{1} has at least 2K2K neighbors in the right subset made with the first 2 clones, and S2S_{2} has at least $SK\$S-K neighbors in the set made with the third clones. Thus, SS has at least 2K+#SK=#S+K2K+\#S-K=\#S+K neighbors. theorem A.1 implies that GG^{\prime} has online matching up to KK. By merging the 3 clones into the original nodes, it follows that GG has online matching with load 33. ∎

We continue with the proof of theorem A.1. We start with 2 technical lemmas.

Definition.

For a set of nodes SS, let N(S)\operatorname{{N}}(S) be the set of all neighbors of elements in SS. A left set SS is critical if #N(S)#S\#\operatorname{{N}}(S)\leq\#S.

Lemma.

If AA and BB are critical and #N(AB)#AB\#\operatorname{{N}}(A\cap B)\geq\#A\cap B, then ABA\cup B is also critical.

Proof.

We need to bound the quantity #N(AB)\#\operatorname{{N}}(A\cup B) which equals #N(A)N(B)\#\operatorname{{N}}(A)\cup\operatorname{{N}}(B). By the inclusion-exclusion principle this equals

=#N(A)+#N(B)#N(A)N(B).=\#\operatorname{{N}}(A)+\#\operatorname{{N}}(B)-\#\operatorname{{N}}(A)\cap\operatorname{{N}}(B).

Since N(AB)N(A)N(B)\operatorname{{N}}(A\cap B)\subseteq\operatorname{{N}}(A)\cap\operatorname{{N}}(B) and the assumption of the lemma, this is at most

#N(A)+#N(B)#AB.\leq\#\operatorname{{N}}(A)+\#\operatorname{{N}}(B)-\#A\cap B.

Since AA and BB are critical, this is at most #A+#B#AB=#AB\#A+\#B-\#A\cap B=\#A\cup B. ∎

Lemma.

Assume a graph has 1-expansion up to KK and has no critical set SS with K<#S2KK<\#S\leq 2K. Then, for every left node xx there exists a right node yy such that after deleting xx and yy, the remaining graph has 1-expansion up to KK.

Proof.

A right neighbor yy of xx is called bad if after deleting yy, there exists a left set SyS_{y} of size at most KK such that #N(Sy)<#Sy\#\operatorname{{N}}(S_{y})<\#S_{y}. Note that SyS_{y} is critical, and by the 1-expansion of the original graph, N(Sy)\operatorname{{N}}(S_{y}) contains yy. We show that by iterated application of the above lemma, the set

U=y is badSyU=\bigcup_{y\text{ is bad}}S_{y}

is critical. Indeed, for each critical set CC of size at most KK, the set CSyC\cup S_{y} is critical by 1-expansion and the previous lemma. Also this set has cardinality at most 2K2K, thus by the assumption this union must have cardinality at most KK.

Note that if all neighbors yy of xx were bad, then N(U{x})=N(U)\operatorname{{N}}(U\cup\{x\})=\operatorname{{N}}(U) because yN(Sy)N(U)y\in\operatorname{{N}}(S_{y})\subseteq\operatorname{{N}}(U). Thus

#N(U{x})#U#U{x}.\#\operatorname{{N}}(U\cup\{x\})\leq\#U\leq\#U\cup\{x\}.

If #U<K\#U<K, then this violates 11-expansion, and if #U=K\#U=K, this violates the assumption about the sizes of critical sets. Hence, at least 1 neighbor of xx is not bad and satisfies the conditions of the lemma. ∎

Proof of theorem A.1..

The online matching strategy maintains a copy of the graph. If Requester makes a matching request for a left node xx, Matcher replies by searching for a right node yy that satisfies the condition of the above lemma for the copy graph and adds the edge (x,y)(x,y) to the matching MM. In the copy she deletes the nodes xx and yy. When Requester removes an edge (x,y)(x,y) from MM, Matcher restores the nodes xx and yy in the copy graph.

It remains to show that in each application of the above lemma, the conditions are satisfied. Note that if Matcher restores the endpoints xx and yy of an edge, the conditions always remain true, because if xSx\not\in S, then #S\#S and #N(S)\#N(S) do not change, and otherwise both values increase by 11.

It remains to show that before any matching request, the copy graph has no critical set SS with K<#S2KK<\#S\leq 2K (and thus the Matcher can apply the lemma and satisfy the request). Assume to the contrary that there is such an SS. In the original graph, SS has at least #S+K\#S+K neighbors. When a right neighbor is assigned, Matcher deletes it from the copy graph. Therefore before any request, the Matcher has deleted from SS at most K1K-1 right nodes (since there can be at most K1K-1 active requests), hence, SS has at least #S+K(K1)=#S+1\#S+K-(K-1)=\#S+1 neighbors, thus it is not critical.

Therefore, the conditions of the lemma are always satisfied and the strategy can always proceed by selecting a neighbor yy. The theorem is proven. ∎

Remark.

In the matching algorithm from [FFP88], the condition on the 11-expansion up to KK elements is checked using a brute force check over all left sets of size at most KK. This can be done in O((#LK))O({\#L\choose K}) time. In general, checking whether a graph has 11-expansion up to KK elements is 𝖼𝗈𝖭𝖯\mathsf{coNP}-complete, see [BKV+81]. However, this hardness result does not exclude algorithms that run in time poly(log#L)\operatorname{poly}(\log\#L) for specially chosen graphs.

Appendix B Prime hashing implies ε\varepsilon-rich matching

Lemma.

For all ε\varepsilon, NN, and KK, there exists an explicit graph with left size NN, right size K2poly(1εlogN)K^{2}\cdot\operatorname{poly}(\tfrac{1}{\varepsilon}\log N), and ε\varepsilon-rich matching up to KK.

Proof.

Let D=1εKlogND=\tfrac{1}{\varepsilon}K\log N. Let pip_{i} denote the ii-th prime number. Left nodes are {1,,N}\{1,\ldots,N\}, and right nodes are pairs {0,,pD}2\{0,\ldots,p_{D}\}^{2}. Note that pDO(DlogD)p_{D}\leq O(D\log D), and the condition on the right size is satisfied for KNK\leq N. For K>NK>N the lemma is trivial.

A left node xx is connected to all pairs (pi,xmodpi)(p_{i},x\bmod p_{i}) with iDi\leq D. The matching strategy is the greedy strategy that matches a node xx to all unmatched right neighbors.

We prove that this provides ε\varepsilon-rich matchings. Assume that there are matches for x1,,xK1x_{1},\ldots,x_{K-1}, and let x~\tilde{x} be an element that is not in this set. For each xix_{i}, there are at most logN\log N common neighbors of x~\tilde{x} and xix_{i}. Hence, at most a fraction (KlogN)/D(K\log N)/D of x~\tilde{x}’es neighbors have already been matched. Thus the greedy matching is ε\varepsilon-rich. ∎

Appendix C Explicit expander with 11-expansion up to KK

Proposition (Proposition 1.3).

For each NN and KNK\leq N there exists an explicit graph with left size NN, right size 5K5K, left degree O(log5N)O(\log^{5}N), and 11-expansion up to KK.

The proof relies on the construction by Ta-Shma, Umans, and Zuckerman of an explicit disperser [TSUZ07, Th 1.4]. To make the notation of bipartite graphs compatible with the notation in [TSUZ07], we assume that the left side has size #L=N=2n\#L=N=2^{n}, the left degree is D=2dD=2^{d} and the right side has size #R=2m\#R=2^{m}. We also assume K=2kK=2^{k}. The construction of the disperser is done in 3 steps.

Step 1: Obtaining a good disperser. A (K,ϵ)(K,\epsilon) disperser is a bipartite graph in which every subset SLS\subseteq L with #SK\#S\geq K has #N(S)(1ϵ)#R\#N(S)\geq(1-\epsilon)\#R. We modify the construction in [TSUZ07, Lemma 6.4] by replacing the extractor used there with the improved extractor with small entropy loss from [GUV09, Th 4.21]. This latter extractor has a smaller dd (namely, d=logn+O(logklog(k/ϵ))d=\log n+O(\log k\cdot\log(k/\epsilon)) and a smaller entropy loss because it has m=k+d2log(1/ϵ)O(1)m=k+d-2\log(1/\epsilon)-O(1) and, therefore, the entropy loss is Δ=2log(1/ϵ)+O(1)\Delta=2\log(1/\epsilon)+O(1). By plugging these values in Lemma 6.4 and Lemma 6.5 in [TSUZ07] and if we assume ϵ1/k\epsilon\geq 1/k, we obtain an explicit (K,ϵ)(K,\epsilon) disperser with left size #L=N\#L=N, left degree D=n3D=n^{3} and right size #R=K1α(n,ϵ)\#R=K\cdot\frac{1}{\alpha(n,\epsilon)}, where α(n,ϵ)=Cn(1/ϵ)7\alpha(n,\epsilon)=C\cdot n\cdot(1/\epsilon)^{7} for some constant natural number CC.

Step 2: Obtaining a good disperser with #R=K\#R=K. We set ϵ=1/6\epsilon=1/6. We construct a graph obtained from the above disperser by taking α(n,ϵ)\alpha(n,\epsilon) clones of the right side. This is a graph such that #L=N,#R=K,D=Θ(n4)\#L=N,\#R=K,D=\Theta(n^{4}) (because the left degree is multiplied by α(n,ϵ)\alpha(n,\epsilon)) and it has the property that every SLS\subseteq L with #SK\#S\geq K has #N(S)(1ϵ)#R=(5/6)K\#N(S)\geq(1-\epsilon)\cdot\#R=(5/6)\cdot K.

Step 3: Obtaining an expander with 11-expansion up to KK. Now we repeat the above construction for K,(3/5)K,(3/5)2K,K,(3/5)\cdot K,(3/5)^{2}\cdot K,\ldots and take the union of these graphs in which we take the same left side for all the graphs, but pairwise disjoint right sides. Since all the graphs have the same left side, LL, and this is also the left side of the union graph. The right side of the union graph has size #R=K+(3/5)K+(3/5)2K+(5/2)K\#R=K+(3/5)\cdot K+(3/5)^{2}\cdot K+\ldots\leq(5/2)K and the left degree of the union graph is Θ(n4logK)=O(n5)\Theta(n^{4}\cdot\log K)=O(n^{5}). In this union graph, every set SLS\subset L of size #SK\#S\leq K, has #N(S)(1/2)#S\#N(S)\geq(1/2)\cdot\#S (so it is a 1/21/2-expander up to KK). Indeed suppose #S[(3/5)jK,(3/5)j1K)\#S\in[(3/5)^{j}\cdot K,(3/5)^{j-1}K). Then in the “(3/5)jK(3/5)^{j}\cdot K component” of the union, SS has at least (5/6)(3/5)jK(5/6)\cdot(3/5)^{j}\cdot K neighbors, and this value is greater than (1/2)#S(1/2)\cdot\#S.

Finally, we construct the graph obtained from the above graph by taking 22 clones of the right side. In this new graph, the expansion factor is 11, as desired. The size of the right side is #R2(5/2)K=5K\#R\leq 2\cdot(5/2)K=5K and the left degree is multiplied by 22, so it is still O(n5)O(n^{5}).

Appendix D Related work on matching

For more than 4 decades, matching algorithms have been studied, see [PL86], and the research still continues, see for example [BRR23]. We discuss 3 areas in which variants of online matching algorithms are studied. The algorithms from theorem 1.2 and proposition 1.1 combine the constraints of all these areas, but these algorithms only work for graphs with large expansion (and for theorem 1.2, load is allowed).


Online matching. Let MCM(G)\operatorname{MCM}(G) be the maximum cardinality of a matching in a graph GG. For some α\alpha that is close to 11, the objective is to maintain a matching of size αMCM(G)\alpha\operatorname{MCM}(G) while edges and vertices are added and removed from the graph GG. Once a match is assigned it may not be revoked.

A greedy algorithm that maintains a maximal matching, i.e., a matching that is not a strict subset of another matching, obtains this objective for α=1/2\alpha=1/2. Note that the greedy algorithm in section 3 maintains a maximal matching in the induced subgraph with left nodes that have “active requests”. A similar algorithm is given in the proof of [LMSVW22, corollary 4].

Perhaps the first paper in this field is [KVV90]. This paper considers the incremental setting in which left nodes arrive but do not depart. They give a probabilistic (11/exp(1))(1-1/\exp(1))-approximation algorithm for bipartite graphs with a perfect matching.141414The adversary is oblivious, i.e., the moves of the adversary are fixed before the randomness of the algorithm is fixed. More recently, this was improved to an (11/D)(1-1/D)-approximation for regular graphs with degree DD. Unfortunately, the runtime of this algorithm is polynomial in NN[CW18].


Dynamic matching. The objective is again to maintain a matching of at least αMCM\alpha\operatorname{MCM}, but now matches are allowed to be revoked. The aim is to minimize the runtime and it is also important to have few revocations.

In [LMSVW22, theorem 2] an algorithm is given for general graphs that are not necessarily bipartite. A (1/2)(1/2)-approximation is given in which the worst case number of revocations for each assigned match is 1, and the amortized runtime is O(D)O(D) in the word-ram model, where DD is the average degree of the graph. Note that this algorithm is almost irrevocable. If it could be made irrevocable, we would obtain a stronger version of theorem 1.2 that does not require lossless expansion: (1/c)(1/c)-expansion up to KK implies poly(logN)\operatorname{poly}(\log N)-time matching with load O(clogN)O(c\log N) up to KK. Unfortunately, such an improvement is unlikely, because it would contradict 2 popular conjectures: the “online matrix-vector multiplication conjecture” and “triangle detection conjecture”, see [LMSVW22, theorem 1].

We refer to [LMSVW22] and [HKPS20] for more references.


Load balancing with restricted assignment. In this task, there are MM servers and tasks arrive with a duration and a subset of servers that can perform the task. When the tasks arrive, a server needs to be selected immediately. For the full duration of the task, the servers’ load is increased by 1. Usually, it is not allowed to reassign a task to a different server. The aim is to minimize the maximal load of a server. Two types of assignment algorithms are studied, depending on whether the input contains the duration of the task. Our game corresponds to the variant in which the duration is not given.

Given a sequence of clients, the performance of an assignment algorithm is the maximum of the load over all machines and over time. The aim is to minimize the competitive ratio: the ratio of this performance to the performance of an optimal offline algorithm that is given the full sequence of tasks and there durations at once. We refer to [Aza05] for more background.

For this model, for every deterministic assignment algorithm, there exists a sequence of tasks of length poly(M)\operatorname{poly}(M) in which the competitive ratio is at least 2M\lfloor\sqrt{2M}\rfloor, where MM is the number of servers, see [ABK94, MP97]. There exists an algorithm that guarantees a competitive ratio of at most 2M+12\sqrt{M}+1[AKPP93]. The algorithm from the proof of theorem 1.2 obtains a competitive ratio O(logN)O(\log N), which is typically exponentially smaller than 2M+12\sqrt{M}+1, but this algorithm only works for graphs that are lossless expanders.