Keywords

1 Introduction

Graph sparsification is a technique to deal with large input graphs by “compressing” them into smaller graphs while preserving important characteristics, like cut values, graph spectrum etc. Its algorithmic value is apparent, since these smaller representations can be computed in a preprocessing step of an algorithm, thereby greatly improving performance.

Cut sparsifiers [4] and spectral sparsifiers [19] aim at reducing the number of edges of the graph while approximately preserving cut values and graph spectrum, respectively. These techniques are used in a variety of fast approximation algorithms, and are instrumental in the development of nearly linear time algorithms.

In vertex sparsification [6, 9, 10, 12, 14, 16, 18], apart from reducing the number of edges, the goal is also to reduce the number of vertices of a graph. In such setting, one is given a large graph \(G=(V,E,c)\), together with a relatively small subset of terminals \(K\subseteq V\). The goal is to shrink the graph while preserving properties involving the terminals. For example, in Cut Sparsification one wants to construct a graph \(H=(V_H,E_H,c_H)\) (with \(K\subseteq V_H\)) such that H preserves mincuts between terminals up to some approximation factor q (the quality).

Hagerup et al. [9] introduced this concept under the term Mimicking Networks, and focused on constructing a (small) graph H that maintains mincuts exactly. They showed that one can obtain H with \(O(2^{2^{k}})\) vertices, where \(k=|K|\). Krauthgamer and Rika [13] and Khan and Raghavendra [11] independently proved that \(2^{\varOmega (k)}\) vertices are required for some graphs if we want to preserve mincuts exactly.

Moitra [16] analyzed the setting where the graph H is as small as possible, namely \(V_H=K\). Under this condition, he obtained a quality \(O(\log k/\log \log k)\) cut sparsifier. A lower bound of \(\varOmega (\sqrt{\log k}/\log \log k)\) was presented by Makarychev and Makarychev [15]. A strictly stronger notion than a cut sparsifier, is a flow sparsifier that aims at (approximately) preserving all multicommodity flows between terminals. The upper bound of [16] also holds for this version, but the lower bound is slightly stronger: \(\varOmega (\sqrt{\log k / \log \log k})\).

Due to the lower bounds on the quality of sparsifiers with \(V_H=K\), the recent focus has been on obtaining better guarantees with slightly larger sparsifiers. Chuzhoy [7] obtained a constant quality flow sparsifier of size \(C^{O(\log \log C)}\), where C is the total weight of the edges incident to terminal nodes. Andoni et al. [3] obtained quality of \((1+\varepsilon )\) and size \(O({\text {poly}}(k/\varepsilon ))\) for quasi-bipartite graphs, i.e., graphs where the terminals form an independent set. This is interesting since these graphs serve as a lower bound example for Mimicking Networks, i.e., in order to obtain an exact sparsifier one needs size at least \(2^{\varOmega (k)}\).

In this paper we study flow and cut sparsifiers for trees. Since, for tree networks it is immediate to obtain a sparsifier of size O(k) and quality 1, we consider the problem of designing flow and cut sparsifiers with \(V_H=K\) as in the original definition of Moitra. In Sect. 2 we show how to design such a flow sparsifier for unweighted trees with quality 2. In Sect. 3 we prove that this result is essentially tight by establishing a lower bound. Concretely, we prove that even for unweighted stars it is not possible to obtain cut sparsifiers with quality \(2-o(1)\).

As a further applicaton of our techniques, we apply them to quasi-bipartite graphs. We first obtain a 2-quality flow sparsifier with \(V_H=K\) for such graphs. In addition we explore the other extreme and construct exact sparsifiers of size \(O(2^k)\), if the input graph is unweighted. This shows that even though quasi-bipartite graphs serve as lower bound instances for Mimicking Networks they are not able to close the currently large gap between the upper bound of \(O(2^{2^k})\) and the lower bound of \(2^{\varOmega (k)}\) on the size of Mimicking Networks.

Finally we obtain hardness results for the problem of deciding whether a graph H is a sparsifier for a given unweighted tree T. We prove that this problem is co-\(\mathcal {NP}\)-hard for cut sparsifiers, based on Chekuri et al. [5]. For flow sparsifiers we show that for a single-source version, where the sparsifier has to preserve flows in which all demands share a common source, the problem is co-\(\mathcal {NP}\)-hard. Due to space limitations the hardness results have been deferred to the full version.

1.1 Preliminaries

Let \(G=(V,E,c)\) be an undirected graph with terminal set \(K \subset V\) of cardinality k, where \(c: E \rightarrow \mathbb {R}^{+}\) assigns a non-negative capacity to each edge. We present two different ways to sparsify the number of vertices in G.

Let \(U \subset V\) and \(S \subset K\). We say that a cut \((U, V \setminus U)\) is S-separating if it separates the terminal subset S from its complement \(K \setminus S\), i.e., \(U \cap K\) is either S or \(K \setminus S\). The cutset \(\delta (U)\) of a cut \((U, V \setminus U)\) represents the edges that have one endpoint in U and the other one in \(V \setminus U\). The cost \({{\mathrm{cap}}}_G(\delta (U))\) of a cut \((U, V \setminus U)\) is the sum over all capacities of the edges belonging to the cutset. We let \(\text {mincut}_{G}(S, K \setminus S)\) denote the S-separating cut of the minimum cost in G. A graph \(H = (V_H, E_H, c_H)\), \(K \subset V_H\) is a vertex cut sparsifier of G with quality \(q \ge 1\) if: \( \forall S \subset K, ~ {{\mathrm{mincut}}}_G(S, K \setminus S) \le {{\mathrm{mincut}}}_H(S, K \setminus S) \le q \cdot {{\mathrm{mincut}}}_G(S, K \setminus S). \)

We say that a (multi-commodity) flow f is a routing of the demand function d, if for every terminal pair \((x,x')\) it sends \(d(x,x')\) units of flow from x to \(x'\). The congestion of an edge \(e \in E\) incurred by the flow f is defined as the ratio of the total flow sent along the edge to the capacity of that edge, i.e., f(e) / c(e). The congestion of the flow f for routing demand d is the maximum congestion over all edges in G. We let \({{\mathrm{cong}}}_{G}(d)\) denote the minimum congestion over all flows. A graph \(H = (V_H, E_H, c_H)\), \(K \subset V_H\) is a vertex flow sparsifier of G with quality \(q \ge 1\) if for every demand function d, \({{\mathrm{cong}}}_H(d) \le {{\mathrm{cong}}}_G(d) \le q \cdot {{\mathrm{cong}}}_H(d). \)

We use the following tools about sparsifiers throughout the paper.

Lemma 1

[14]. If \(H = (V_H, E_H, c_H)\), \(V_H=K\) is a vertex flow sparsifier of G, then the quality of H is \(q = {{\mathrm{cong}}}_{G}(d_{H})\), where \(d_{H}(x,x') : = c_{H}(x,x')\) for all terminal pairs \((x,x')\).

Let \(G_1\) and \(G_2\) be graphs on disjoint set of vertices with terminals \(K_1 = \{s_1,\ldots ,s_k\}\) and \(K_2 = \{t_1,\ldots ,t_m\}\), respectively. In addition, let \(\phi (s_i) = t_i\), for all \(i =1,\ldots ,\ell \), be a one-to-one correspondence between some subset of \(K_1\) and \(K_2\). The \(\phi \)-merge (or 2-sum) of \(G_1\) and \(G_2\) is the graph G with terminal set \(K = K_1 \cup \{t_{\ell +1},\ldots ,t_m\}\) formed by identifying the terminals \(s_i\) and \(t_i\) for all \(i = 1,\ldots , \ell \). This operation is denoted by \(G := G_1 \oplus _{\phi } G_2\).

Lemma 2

([3], Merging). Let \(G = G_1 \oplus _{\phi } G_2\). Suppose \(G_1'\) and \(G_2'\) are flow sparsifiers of quality \(q_1\) and \(q_2\) for \(G_1\) and \(G_2\), respectively. Then \(G' = G_1' \oplus _{\phi } G_2'\) is a flow sparsifier of quality \(\max \{q_1, q_2\}\) for G.

Lemma 3

(Convex Combination of Sparsifiers). Let \(H_i = (V^{*},E_i, c_i)\), \(i = 1, \ldots , m\) with \(K \subset V^{*}\) be vertex flow sparsifiers of G. In addition, let \(\alpha _1, \alpha _2, ..., \alpha _m\) be convex multipliers corresponding to \(H_i\)’s such that \(\sum _{i} \alpha _i = 1\). Then the graph \(H' = \sum _{i} \alpha _i \cdot H_i \) is a vertex flow sparsifier for G.

2 Improved Vertex Flow Sparsifiers for Trees

In this section we show that given an unweighted tree \(T=(V,E)\), \(K \subset V\), we can construct a flow sparsifier H only on the terminals, i.e., \(V(H)=K\), with quality at most 4. We then further improve the quality to 2. The graph H has the nice property of being a convex combination of trees.

We obtain the quality of 4 by combining the notion of probabilistic mappings due to Andersen and Feige [2] and a duality argument due to Räcke [17]. Our result then immediately follows using as a black-box an implicit result of Gupta [8]. We note that a direct application of the Transfer Theorem due to Andersen and Feige [2] does not apply, since their interchangeability argument relies on arbitrary capacities and lengths.

Let \(w : E \rightarrow \mathbb {R}_{\ge 0}\) be a function which assigns non-negative values to edges which we refer to as lengths. Given a tree \(T=(V,E,w)\) we use \(d_{w} : V \times V \rightarrow \mathbb {R}_{\ge 0}\) to denote the shortest path distance induced by the edge length w. A 0-extension of a tree \(T = (V,E)\), \(K \subset V\) is a retraction \(f : V \rightarrow K\) with \(f(x) = x\), for all \(x \in K\), along with another graph \(H = (K, E_{H})\) such that \(E_{H} = \{(f(u),f(v)) : (u,v) \in E\}\). The graph H is referred to as a connected 0-extension if in addition we require that \(f^{-1}(x)\) induces a connected component in T.

Given a graph \(G = (V,E)\), we let \(\mathcal {P}\) be a collection of multisets of E, which will be usually referred to as paths. A mapping \(M : E \rightarrow \mathcal {P}\) maps every edge e to a path \(P \in \mathcal {P}\). This mapping can be alternatively represented as a non-negative square matrix M of dimension \(|E| \times |E|\), where \(M(e',e)\) is the number of times edge e lies on the path \(M(e')\). Let \(\mathcal {M}\) denote the collection of mappings M. If we associate to each mapping \(M \in \mathcal {M}\) a convex multiplier \(\lambda _M\), the resulting mapping is referred to as a probabilistic mapping.

Connected 0-Extension Embedding on Trees. Suppose we are given a tree \(T = (V,E)\), \(K \subset V\) and a connected 0-extension (Hf), where \(H = (K,E_{H})\) and f is a retraction. Given an edge \((u,v) \in E\) from T, we can use the retraction f to find the edge (f(u), f(v)) in H (if u and v belong to different components). Since this edge is not an edge of the original tree T, we need a way to map it back to T in order to be consistent with our definition of mappings. The natural thing to do is to take the unique shortest path between f(u) and f(v) in T. Denote by \(S^{T}_{u,v}\) all the edges in the shortest path between u and v in T. Then, we let \(M_{H,f}((u,v)) = S^{T}_{f(u),f(v)}\) be the mapping \(M_{H,f} : E \rightarrow \mathcal {P}\) induced by (Hf).

Let \(\mathcal {H}\) be the family of all connected 0-extensions for T, which are also trees. We then define the collection of mappings \(\mathcal {M}\) for T by \(\{M_{H,f} : H \in \mathcal {H}\}\).

Capacity Mappings. Given a tree \(T = (V,E,c)\), \(c : E \rightarrow \mathbb {R}^{+}\) and a connected 0-extension (Hf), the load of an edge \(e \in E\) under (Hf) is \({{\mathrm{load}}}_f(e) = \sum _{e'} M_{H,f}({e',e}) \cdot c(e')\). The expected load of an edge \(e \in E\) under a probabilistic mapping is \(\sum _{i}\lambda _i {{\mathrm{load}}}_{f_{i}}(e)\).

Distance Mappings. Given a tree \(T = (V,E,w)\), \(w : E \rightarrow \mathbb {R}^{+}\) and a connected 0-extension (Hf), the mapped length of an edge \(e' = (u',v') \in E\) under (Hf) is \(d_w(f(u'), f(v')) = \sum _{e} M_{H,f}({e',e}) \cdot w(e)\). The expected mapped length of an edge \(e'=(u',v') \in E\) under a probabilistic mapping is \(\sum _{i}\lambda _i d_w(f_i(u'), f_i(v'))\).

With the above definitions in mind, for some given tree \(T=(V,E,c)\), we can find a flow sparsifiers that is a convex combination of connected 0-extensions using the following linear program, and its dual.

figure a

Next, we re-write the dual constraints of type \((*)\) as follows:

$$\begin{aligned} \begin{aligned} \textstyle \sum \nolimits _{e}&w(e) {{\mathrm{load}}}_{f_i} (e) = \textstyle \sum \nolimits _{e} w(e) \textstyle \sum \nolimits _{e'} M_{H,f_i}({e',e}) \cdot c(e')\\ =&\textstyle \sum \nolimits _{e'} c(e') \left( \textstyle \sum \nolimits _{e} M_{H,f_i}(e',e) \cdot w(e) \right) = \textstyle \sum \nolimits _{e' = (u',v')} c(e') \cdot d_{w}(f_i(u'),f_i(v')). \end{aligned} \end{aligned}$$

Using this re-formulation and a few observations, the dual is equivalent to:

$$\begin{aligned} \max _{w \ge 0} \min _{i} { \sum \nolimits _{e=(u,v)} c(e) \cdot d_w(f_i(u),f_i(v))}~/~{ \sum \nolimits _{e} w(e) \cdot c(e)}. \end{aligned}$$
(1)

For the unweighted case \(c(e)=1\), we can make use of the following lemma:

Lemma 4

[8, Lemma 5.1]. Given a tree \(T=(V,E,w)\), \(K \subset V\), we can find a connected 0-extension f such that \(\sum \nolimits _{e=(u,v)} d_w(f(u),f(v)) \le 4 \cdot \sum _{e} w_e.\)

The above lemma tells us that optimal value of (1) is bounded by 4. This implies that the optimal value of the dual is bounded by 4, and by strong duality, the optimal value of the primal is also bounded by 4. The latter implies that T admits a 4-quality vertex sparsifier of size k.

2.1 Obtaining Quality 2

Next we show how to bring down the quality of flow sparsifiers on trees to 2. We give a direct algorithm that constructs a flow sparsifiers and unlike in the previous subsection, it does not rely on the interchangeability between distances and capacities. We first consider trees where terminals are the only leaf nodes, i.e., \(L(T)=K\). Later we show how to extend the result to arbitrary trees.

To convey some intuition, we start by presenting the deterministic version of our algorithm. We maintain at any point of time a partial mapping f–setting \(f(v) = \perp \), when f(v) is still undefined, but producing a valid connected 0-extension when the algorithm terminates. Note that \(f(x)=x\), for all \(x \in K\). Without loss of generality, we may assume that the tree is rooted at some non-terminal vertex and the child-parent relationships are defined. The algorithm works as follows: it repeatedly picks a non-terminal v farthest from the root and maps it to one of its children c, i.e., \(f(v)=f(c)\) Footnote 1 (we refer to such procedure as Algorithm 1. This process results in a flow sparsifier that is a connected 0-extension.

Unfortunately, the quality of the sparsifier produced by the above algorithm can be very poor. To see this, consider an unweighted star graph \(S_{1,k}\), where leaves are the terminal vertices and the center is the non-terminal vertex v. Any connected 0-extension of \(S_{1,k}\) is a new star graph \(S_{1,k-1}\) lying on the terminals, where the center is the terminal x with \(f(v) = x\). Now, consider a demand function d that sends a unit flow among all edges in \(S_{1,k-1}\). Clearly, d can be feasibly routed in \(S_{1,k-1}\). But routing d in \(S_{1,k}\) gives a load of at least \(k-1\) along the edge (xv), and thus the quality of \(S_{1,k-1}\) is at least \(k-1\) (Lemma 1).

One way to improve upon the quality is to map the non-terminal v uniformly at random to one of the terminals. We can equivalently view this as taking convex combination over all possible connected 0-extensions of \(S_{1,k}\). By Lemma 3 we know that such a convex combination gives us another flow sparsifier for \(S_{1,k}\), and it can be checked that the quality of such a sparsifier improves to 2. Surprisingly, we show that applying this trivial random-mapping of non-terminals in trees with terminals as leaves leads to a flow sparsifier H which is a random connected 0-extension and achieves similar guarantees. We refer to such procedure as Algorithm 2.

To compute the quality of H as a flow sparsifier for T, we need to bound the congestion of every edge of T incurred by the embedding of H into T. This embedding routes the capacity of every terminal edge \((x,x')\) in H along the (unique) shortest paths between leaves x and \(x'\) in T. First, we crucially observe that without loss of generality, it suffices to bound the load of the edges incident to the terminals, i.e., edges incident to leaf vertices. To see this, let (uv) be an edge among non-terminals in T, with v being the parent of u. Now, when embedding H into T, we know that the demands among all terminal pairs that lie in the subtree T(u) rooted at u cannot incur any load on the edge (uv), as these terminal shortest paths do not use this edge. Thus, we can safely replace the subtree T(u) with some dummy terminal and perform the analysis as before.

First, we study edge loads under deterministic connected 0-extensions. Let \(e = (x,v)\) be the edge incident to \(x \in K\), \(m_x\) denote the level of x in T and \(\{x,v_{m_x-1},\ldots ,v_0\}\) be the set of vertices belonging to the shortest path between x and the root \(r = v_0\) in T. Given a connected 0-extension \(f_i\) output by Algorithm 1, we say that x is expanded up to the \(\ell \)-th level if \(f_i(v_j) = x\), for all \(j \in \{m_x,\ldots , \ell \}\). This leads to the following lemma.

Lemma 5

Let \(e = (x,v)\) be the edge incident to \(x \in K\), \((H_i,f_i)\) be a connected 0-extension and recall that empty sum is defined as 0. If x is expanded up to the \(\ell \)-th level, then the load of e under \((H_i,f_i)\) is \({{\mathrm{load}}}_{f_i}(e) \le 1 + \sum _{j=\ell }^{m_x-1}(c_j-1) ,~ \ell \in \{m_x,\ldots , 0\}\), where \(c_j\) denotes the number of children of non-terminal \(v_j\) in T.

Let \(I^{x}_{\ell } = \{(H_i,f_i)\}\) be the set of connected 0-extensions output by Algorithm 1 where x is expanded up to the \(\ell \)-th level. We observe that the edge e has the same load regardless of which element of \(I^{x}_{\ell }\) we choose. Thus, for any \((H_i,f_i) \in I^{x}_{\ell }\), we can write \({{\mathrm{load}}}_\ell (e) = {{\mathrm{load}}}_{f_i}(e)\).

Now, we study the expected edge loads under the random connected 0-extension output by Algorithm 2. Let N be the number of all different connected 0-extensions that can be output by Algorithm 1. If by \(Z^{x}_\ell \) we denote the event that x is expanded up to the \(\ell \)-th level, then it follows that the expected load \(\mathbb {E}[{{\mathrm{load}}}_f(e)]\) of \(e=(x,v)\) under (Hf) is

$$\begin{aligned} \sum _{i=1}^{N} {{\mathrm{load}}}_{f_i}(e)/N = \sum _{\ell =0}^{m_x} \frac{\mathrm {\#\,\, of\,\, }f_i\text {'s s.t. } Z^{x}_{\ell } }{N} \cdot {{\mathrm{load}}}_{\ell }(e) = \sum _{\ell =0}^{m_x} \mathbb {P} [Z^{x}_{\ell }] \cdot {{\mathrm{load}}}_{\ell }(e). \end{aligned}$$
(2)

Since in Algorithm 2 all non-terminals are mapped independently of each other, we obtain \(\mathbb {P}[Z^{x}_{\ell }] = (1-1/c_{\ell -1}) \prod _{j=\ell }^{m_x-1} {1}/{c_{j}}, \ell \in \{m_x,\ldots ,1\}\) (recall that the empty product is defined as 1). Further, observe that \(\mathbb {P}[Z^{x}_0] = 1 / \prod _{j=0}^{m_x-1} c_j\). Plugging the probabilities and Lemma 5 in (2), we get that \(\mathbb {E}[{{\mathrm{load}}}_f(e)]\) is

$$\begin{aligned} \frac{1}{\prod _{j=0}^{m_x-1} c_j} \bigg (1 + \sum _{j=0}^{m_x-1} (c_j - 1)\bigg ) + \sum _{\ell = 1}^{m_x} (1-1/c_{\ell -1}) \prod _{j=\ell }^{m_x-1} \frac{1}{c_{j}} \bigg (1 + \sum _{j = \ell }^{m_x-1} (c_j-1)\bigg ). \end{aligned}$$

Next, we rewrite the above as A / B, where \(B = \prod _{j=0}^{m_x-1}c_j\) and A is given by

$$\begin{aligned} 1 + \sum _{j=0}^{m_x-1} (c_j - 1) + \sum _{\ell =1}^{m_x-1} (c_{\ell -1} - 1) \prod _{j=0}^{\ell -2} c_j \bigg (1 + \sum _{j=\ell }^{m_x-1}(c_j - 1) \bigg ) + (c_{m_x-1} - 1) \prod _{j=0}^{m_x-2}c_j. \end{aligned}$$

The following lemma simplifies the middle expression of A.

Lemma 6

For any positive integers \(\{c_0,\ldots , c_{m_x-1}\}\) and \(m_x \ge 3\),

$$\begin{aligned} \sum _{\ell =1}^{m_x-1} (c_{\ell -1} - 1) \prod _{j=0}^{\ell -2} c_j \big (1 + \sum _{j=\ell }^{m_x-1}(c_j - 1) \big ) = (c_{m_x-1} + 1) \prod _{\ell =0}^{m_x-2} c_\ell - \sum _{\ell = 0}^{m_x-1} (c_\ell - 1) - 2. \end{aligned}$$

Proof

Let \(P(m_x-1)\) be the left-hand side expression in the statement of the lemma. We proceed by induction on \(m_x\). For the base case \(m_x=3\), it is easy to argue that the claim is valid. If we assume that the lemma holds true for \(m_x-1\), then we get that:

$$\begin{aligned} \begin{aligned} P(m_x) =&\sum _{\ell =1}^{m_x-1} (c_{\ell -1} - 1) \prod _{j=0}^{\ell -2} c_j \bigg (1 + \sum _{j=\ell }^{m_x-1}(c_j - 1) + (c_{m_x} - 1) \bigg ) \\&+ (c_{m_x-1} -1) \prod _{j=0}^{m_x-2}c_j\bigg ((c_{m_x}-1) + 1\bigg ) \\ =&\sum _{\ell =1}^{m_x-1} (c_{\ell -1} - 1) \prod _{j=0}^{\ell -2} c_j \bigg (1 + \sum _{j=\ell }^{m_x-1}(c_j - 1) \bigg ) \\&+ (c_{m_x} - 1) \sum _{\ell =1}^{m_x} (c_{\ell -1} -1) \prod _{j=0}^{\ell -2}c_j \; + \; (c_{m_x-1} -1) \prod _{j=0}^{m_x-2}c_j. \end{aligned} \end{aligned}$$
(3)

Note that the following expression is a simple telescoping series:

$$\begin{aligned} \sum _{\ell = 1}^{m_x} (c_{\ell -1} -1) \prod _{j=0}^{\ell -2} c_j = \prod _{\ell = 0}^{m_x-1} c_\ell - 1. \end{aligned}$$
(4)

Plugging this into Eq. (3) and using induction hypothesis gives:

$$\begin{aligned} \begin{aligned} P(m)&= (c_{m_x-1} + 1) \prod _{\ell =0}^{m_x-2} c_\ell - \sum _{\ell = 0}^{m_x-1} (c_\ell - 1) - 2 \quad + (c_{m_x} -1) \bigg ( \prod _{\ell =0}^{m_x-1} c_\ell -1\bigg ) \\&\quad + (c_{m_x-1} -1) \prod _{j=0}^{m_x-2} c_j = (c_{m_x} + 1) \prod _{\ell =0}^{{m_x}-1} c_\ell - \sum _{\ell = 0}^{m_x} (c_\ell - 1) - 2. \end{aligned} \end{aligned}$$

This completes the induction step, and hence the proof of the lemma.   \(\square \)

Now, plugging the above lemma in A we get that \(A = 2B-1\). Thus, \(\mathbb {E}[{{\mathrm{load}}}_f(e)] = (2B-1)/B \le 2\). Since we consider only unweighted trees, it follows that the expected congestion of every edge is also bounded by 2. Taking the maximum over all edge congestions yields the following:

Lemma 7

Given a tree \(T=(V,E)\), \(K \subset V\), \(L(T)=K\), there is a 2-quality flow sparsifier H, which is a convex combination over connected 0-extensions.

Derandomization. Next we show that Algorithm 2 can be easily derandomized. We obtain a deterministic algorithm that runs \(O(n+k^{2}\alpha (2k))\) time and gives the same guarantees as in Lemma 7, where \(\alpha (\cdot )\) is the inverse Ackermann function.

We first give an O(n) time preprocessing step. For a tree \(T=(V,E)\), \(K \subset V\), \(L(T)=K\), we repeatedly contract edges incident to non-terminals of degree 2 in T. When all such non-terminals are deleted from T, our new tree can have at most 2k vertices. Note that this tree exactly preserves all flows among terminals.

Now, we crucially observe that in the flow sparsifier H output by Algorithm 2, the capacity between any two terminals x and \(x'\) is exactly the probability that x and \(x'\) are connected under the random mapping f. We next show that this probability can be computed efficiently.

Let \((x,x')\) be any terminal pair, \({{\mathrm{lca}}}(x,x')\) denote their lowest common ancestor in T and r denote the level of \({{\mathrm{lca}}}(x,x')\) in T. Moreover, let \(V^{x}_{r} = \{x,v_{m_x-1},\ldots ,v_{r}\}\), \(v_{r} = {{\mathrm{lca}}}(x,x')\), be the set of vertices belonging to the shortest path between x and the \({{\mathrm{lca}}}(x,x')\). Similarly, define \(V^{x'}_{r}=\{x',v'_{m_{x'}-1},\ldots ,v_{r}\}\). Since in Algorithm 2 all non-terminals are mapped independently of each other, we obtain

$$\begin{aligned} \begin{aligned}\textstyle \mathbb {P}[(f(x),f(x'))&\in E_H] = 2 \cdot \mathbb {P}[f(v_r) = x] \cdot \mathbb {P}[f(v)=x,~\forall v \in V^{x}_{r-1}] \\&\cdot \,\mathbb {P}[f(v')=x',~\forall v' \in V^{x'}_{r-1}] = \frac{2}{c_r} \cdot \textstyle \prod _{j=r}^{m_{x}-1} \frac{1}{c_j} \textstyle \prod _{j=r}^{m_{x'}-1} \frac{1}{c'_j}. \end{aligned} \end{aligned}$$
(5)

where \(c_j\), \(c'_j\) are the number of children of the non-terminal \(v_j\), \(v'_j\), respectively.

The above expression suggest that one should build an efficient data-structure for T that answers queries of the form “What is the product of the elements associated with vertices along the path from x to \(x'\) in T?”. This problem is known as The Tree Product Query problem. For an arbitrary tree with n vertices, Alon and Schieber [1] show that in order to answer each Tree Product query in at most \(O(\alpha (n))\) steps, an O(n) preprocessing time is sufficient.

Now we are ready to give our deterministic procedure. We first apply our initial preprocessing step in O(n) time. Since the resulting tree has at most 2k vertices, it takes O(k) time to preprocess the tree such that every internal vertex knows the number of its children. Next, using O(k) preprocessing, we build a data-structure for the Tree Product Query problem. Now, for every terminal pair \((x,x')\) we can compute in \(O(\alpha (2k))\) time the capacity of \((x,x')\) in H from the Tree product query between x and \(x'\) and Eq. (5). Since there are at most \(O(k^{2})\) terminal pairs, we get a running time of \(O(n + k^{2}\alpha (2k))\). The correctness is immediate from the above observations.

Extension to Arbitrary Trees. The above algorithm can be extended to arbitrary trees (deferred to the full version). This leads to the following theorem:

Theorem 1

Given an unweighted tree \(T=(V,E)\), \(K \subset V\), there exists a 2-quality flow sparsifier H. Moreover, H can be viewed as a convex combination over connected 0-extensions of T.

3 Lower Bound

In this section we present a \(2 - o(1)\) lower bound on the quality of any cut sparsifier for a star graph. Since previous lower bounds relied on non-planar graph instances, this is the first non-trivial lower bound for arbitrary cut sparsifiers on planar graphs. The result extends to the stronger notion of flow sparsifiers.

The main idea behind our approach is to exploit the symmetries of the star graph. We observe that these symmetries induce other symmetries on the cut structure of the graph. This simplifies the structure of an optimal cut-sparsifier.

Let \(G = (K \cup \{v\}, E)\), be an unweighted star with k terminals. Let \(\pi '\) be any permutation of K. We extend \(\pi '\) to a permutation \(\pi \) of \(K \cup \{v\}\) by setting \(\pi (x) = \pi '(x), \forall x \in K\) and \(\pi (v) = v\). Now, for any \(U \subset K \cup \{v\}\) and any such a permutation \(\pi \), we use the symmetry \({{\mathrm{cap}}}_G(\delta (U)) = {{\mathrm{cap}}}_G(\delta (\pi (U)))\). The latter implies that for any \(S \subset K\), \({{\mathrm{mincut}}}_G(S, K \setminus S) = {{\mathrm{mincut}}}_G(\pi (S), K \setminus \pi (S))\).

For a cut sparsifier H of quality q for G, we show that \(\pi (H)\), i.e., the graph obtained by renaming all vertices of H according to permutation \(\pi \), is also a cut sparsifier of quality q for G. Indeed, for any \(S \in K\), \({{\mathrm{cap}}}_{\pi (H)}(\delta (S)) = {{\mathrm{cap}}}_{H}(\delta (\pi ^{-1}(S))) \ge {{\mathrm{mincut}}}_G(\pi ^{-1}(S), K \setminus \pi ^{-1}(S) ) = {{\mathrm{mincut}}}_G(S, K \setminus S)\). Symmetrically, one can show that \({{\mathrm{cap}}}_{\pi (H)}(\delta (S)) \le q \cdot {{\mathrm{mincut}}}_G(S, K \setminus S)\).

Lemma 8

A convex combination of any two cut sparsifiers with the same quality gives a new cut sparsifier with the same or better quality.

Lemma 9

For the star graph G defined as above, there exists an optimum cut sparsifier H, which is a complete graph with uniform edges-weights.

Proof

First, we observe by Lemma 8 that if we have two cut sparsifiers with the same quality, taking their convex combination gives a new cut sparsifier with the same or better quality. Suppose we are given some optimum cut sparsifier \(H'\). We can generate k! different cut sparsifiers by considering all possible permutations \(\pi \) as defined above. By the above arguments, for each \(\pi \), we know that \(\pi (H')\) is also an optimum cut sparsifier. Taking the convex combination over k! such sparsifiers, we obtain a complete graph H with uniform edge-weights.    \(\square \)

Lemma 10

If H is uniform weighted complete graph that is an optimum cut sparsifier for the star graph G and k even, the edge weight must be at least 2 / k.

Proof

By definition, H must dominate the terminal cut that has k / 2 vertices on one side. The minimum value of such a cut in G is k / 2. The number of edges that cross such a cut in H is \(k^{2}/4\). Since H has uniform edge-weights, this gives that the edge weight must be at least 2 / k.   \(\square \)

Theorem 2

Let \(G = (K \cup \{v\}, E)\) be an unweighted star with k terminals. Then, there is no cut sparsifier H that achieves quality better than \(2-o(1)\).

Proof

By the above lemmas, we can assume without loss of generality that H is a complete graph with uniform edge-weights, where this edge weight is at least 2 / k. Hence, a cut that has a singleton terminal vertex on one side has capacity \(2(k-1)/k = 2(1-1/k)\) in H but it has minimum cut value 1 in G. The latter implies that the quality of H must be at least \(2(1-1/k)\).    \(\square \)

4 Improved Results for Quasi-Bipartite Graphs

In this section, we present two new tradeoffs for flow sparsifiers in quasi-bipartite graphs. For this family of graphs, Andoni et al. [3] show how to obtain flow sparsifier with very good quality and moderate size. Specifically, they obtain an \((1+\varepsilon )\)-quality flow sparsifier of size \(\widetilde{O}(k^{7}/\varepsilon ^3)\). In the original definition of flow sparsifiers, Leighton and Moitra [14] studied the version where sparsifiers lie only on the terminals, i.e., \(V_H = K\). For this restricted setting, we obtain a flow sparsifier of quality 2.

Exact Cut Sparsifier (a.k.a Mimicking Networks) were introduced by Hagerup et al. [9]. In their work they show that general graphs admit exact cut sparsifiers of size doubly exponential in k. As a second result, we show that unit weighted quasi-bipartite graphs admit an exact flow sparsifier of size \(2^{k}\).

A graph G with terminals K is quasi-bipartite if the non-terminals form an independent set. Throughout this section we assume w.l.o.g. that we are given a bipartite graph with terminals lying on one side and non-terminals in the other (this can achieved by subdividing terminal-terminal edges).

A 2-Quality Flow Sparsifier of Size k. Assume we are given an unweighted bipartite graph G with terminals K. The crucial observation is that we can view G as taking union over stars, where each non-terminal is the center connected to some subset of terminals. Lemma 2 allows us to study these stars independently. Then, for every such star, we apply Lemma 7 to obtain a flow sparsifier only on the terminals belonging to that star. Finally, we merge the resulting sparsifiers and construct a sparsifier H with \(V(H) = K\) by another application of Lemma 7. Since the quality of every star in isolation is 2 or better, H is also a 2-quality flow sparsifier.

We note that Lemma 7 only works for unweighted trees. There is an easy extension that gives a similar lemma for weighted stars.

Lemma 11

Let \(G=(K \cup \{u\}, E, c)\) be a weighted star with k terminals. Then G admits a 2-quality flow sparsifier H of size k.

Applying the decomposition and merging lemma similarly to the unweighted case leads to the following theorem:

Theorem 3

Let \(G = (V,E,c)\) with \(K \subset V\) be a weighted quasi-bipartite graph. Then G admits a 2-quality flow sparsifier H of size k.

An Exact Flow Sparsifier of Size \(\mathbf {2}^{{\varvec{k}}}\) . In what follows it will be convenient to work with an equivalent definition for Flow Sparsifiers. Let \(\lambda _G(d)\) denote the maximum fraction of concurrent flow when routing demand d among terminals in graph G. Then \(H=(V_H,E_H,c_H)\) with \(K \subset V_H\) is a flow sparsifier of G with quality \(q \ge 1\) if for all demand functions d, \(\lambda _G(d) \le \lambda _H(d) \le q \cdot \lambda _G(d)\).

The high level idea of our approach is to create “types” for non-terminals and then merge all non-terminals of the same type into a single non-terminal (i.e., add infinity capacity among all non-terminals of the same type). The main difficulty is to define the right types and show that the merging does not affect the multi-commodity flow structure among the terminals. A similar approach was developed by Andoni et al. [3], but their guarantees applies only to approximate flow sparsifier.

We start by defining types. We say that two non-terminals uv are of the same type if they are incident to the same subset of terminals. Non-terminals of the same type form groups. Note that a non-terminal belongs to an unique group. The size of the group is the number of non-terminals belonging to that group. Since the set of non-terminals is an independent set, by Lemma 2, we can construct sparsifiers for each group independently. Our final sparsifier is obtained by merging the sparsifiers over all groups. By another application of Lemma 2, if the sparsifiers of the groups are exact flow sparsifiers, then the final sparsifier is also an exact flow sparsifier for the original graph.

Next, if we replace each group by a single non-terminal, then the size guarantee of the final sparsifier follows from the fact that there are at most \(2^{k}\) different subsets of terminals. Below we formalize the merging operation within groups.

Let \(G_i = (K' \cup \{v_1, \ldots , v_{n_i}\}, E_i, c)\) be a group of size \(n_i \ge 2\), where \(E_i = \{\{v_j,x\}: j \in \{1,\ldots ,n_i\}, \; x \in K'\}\), \(K' \subseteq K\) and \(c(e) = 1\), \(e \in E_i\). We get:

Lemma 12

Let \(G_i\) with \(K' \subset V(G_i)\) be a group of size \(n_i \ge 2\) defined as above. Then \(G_i\) can be replaced by a star \(H_i = (K' \cup \{v_1\}, E_{H_i}, c_{H_i})\) with edge weights \(c_{H_i}(e) = n_i\), for all \(e \in E_{H_i}\), and which preserves exactly all multicommodity flows between terminals from \(K'\).

Taking the union over all sparsifiers \(H_i\) leads to the following theorem:

Theorem 4

Let \(G = (V,E)\) with \(K \subset V\) be a unit weighted quasi-bipartite graph. Then G admits an exact flow sparsifier H of size at most \(2^{k}\).

Proof

(Lemma 12 ). First, observe that we can think of \(H_i\) as adding infinity capacity edges between non-terminals in \(G_i\). Then merging into a single non-terminal is done by simply adding edge weights incident to the same terminal. More precisely, let \(E_{H_i} = \{(v_r, v_s) : r,s = 1,\ldots , n_i, \; r \ne s\}\). Then, we can assume that \(H_i = (K' \cup \{v_1, \ldots v_{n_i}\}, E_i \cup E_{H_i}, c_{H_i})\) where \(c_{H_i} (e) = c(e)\) if \(e \in E_i\) and \(c_{H_i}(e) = \infty \) if \(e \in E_{H_i}\).

Since we can route every feasible demand from \(G_i\) in \(H_i\) even without using the infinity-capacity edges, it is immediate that for any demand function d, \(\lambda _{H_i}(d) \ge \lambda _{G_i}(d)\). Thus, we only need to show that \(\lambda _{H_i}(d) \le \lambda _{G_i}(d)\). To achieve this, we will use the dual to the maximum concurrent flow problem (i.e., the Fractional Sparsest Cut Problem). The dual problem is the followingFootnote 2:

(6)

Let d be an arbitrary demand function. Moreover, let \(\{\ell _e, \delta _{st}\}\) be an optimal solution of value \(\lambda _{G_i}(d)\) for the LP in Eq. (6), where \(\delta _{st}\) is the shortest-path distance induced by the length assignment \(\ell \). We first modify this solution and get a new feasible solution with the same cost and a certain structure that we will later exploit.

The modification works as follows. For every terminal we create a set of edges incident to that terminal. Then, within each set, we replace the length of each edge by the total average length of the group. Specifically, for every \(x \in K'\), let \(E_{x} = \{(v_j, x) : j = 1, \ldots , n_i\}\) be the set of edges incident to x.

The new edge lengths are defined as follows: \(\widetilde{\ell }_{v_jx} = {\sum \nolimits _{e \in E_{x}} \ell _{e}}/{n_i}, \forall x \in K', \forall j = 1,\ldots ,n_i\). Let \(\smash {\widetilde{\delta }_{st}}\) be the new shortest-path distance induced by the length assignment \(\widetilde{\ell }\). In order for \(\{\widetilde{\ell }_e, \widetilde{\delta }_{st}\}\) to be feasible, we need to show that \(\widetilde{\delta }\) dominates \(\delta \), i.e., \(\widetilde{\delta }_{st} \ge \delta _{st}\), for every pair \(s,t \in K'\). Indeed, since edge lengths within groups are the same, we get that for every pair \(s,t \in K'\):

$$\begin{aligned} \begin{aligned} \widetilde{\delta }_{st} = \widetilde{\ell }_{sv_1} + \widetilde{\ell }_{v_1t}&= \frac{1}{n_i}{\textstyle \sum \nolimits _{e \in E_{s}} \ell _{e} + \displaystyle \frac{1}{n_i}\textstyle \sum \nolimits _{e \in E_{t}} \ell _{e}} = \frac{1}{n_i}{\textstyle \sum \nolimits _{j = 1}^{n_i} \left( \ell _{sv_j} + \ell _{v_jt}\right) }\\&\ge \min _{j \in \{1,\ldots ,n_i\}}\{\ell _{sv_j} + \ell _{v_jt}\} \ge \delta _{st}. \end{aligned} \end{aligned}$$

Additionally, observe that the new solution has the same optimal value, namely \(\lambda ^{*}_{G'_i}(d) = \sum _{j=1}^{n_i}{\sum _{x \in K'}} \ell _{v_jx} = \sum _{j=1}^{n_i}{\sum _{x \in K'}} \widetilde{\ell }_{v_jx}\). Hence, we can assume without loss of generality that an optimal solution satsifies: \(\smash {\widetilde{\ell }_{v_1x}} = \ldots = \smash {\widetilde{\ell }_{v_{n_i}}x}, \; \forall x \in K'\). Now, we add edges \((v_i,v_j)\) to \(G_i\) and set \(\widetilde{\ell }_{v_i v_j} = 0\), for all \(i,j = 1,\ldots , n_i\). Note that shortest-path distances \(\widetilde{\delta }_{st}\) do not change by this modification. Therefore, by adding these zero edge lengths between the non-terminals, we still get an optimum solution \(\{\widetilde{\ell }_e, \widetilde{\delta }_{st}\}\) for the LP in (6).

Finally, let us define the dual problem for the star \(H_i\):

(7)

It follows from above that \(\{\widetilde{\ell }_e, \widetilde{\delta }_{st}\}\) is a feasible solution for the LP in (7). Hence, \(\lambda _{H_i}(d) \le \lambda _{G_i}(d)\), what we were after.    \(\square \)