Mincut Sensitivity Data Structures for the Insertion of an Edge

Let G=(V,E)\documentclass[12pt]{minimal} \usepackage{amsmath} \usepackage{wasysym} \usepackage{amsfonts} \usepackage{amssymb} \usepackage{amsbsy} \usepackage{mathrsfs} \usepackage{upgreek} \setlength{\oddsidemargin}{-69pt} \begin{document}$$G=(V,E)$$\end{document} be an undirected graph on n vertices with non-negative capacities on its edges. The mincut sensitivity problem for the insertion of an edge is defined as follows. Build a compact data structure for G and a given set S⊆V\documentclass[12pt]{minimal} \usepackage{amsmath} \usepackage{wasysym} \usepackage{amsfonts} \usepackage{amssymb} \usepackage{amsbsy} \usepackage{mathrsfs} \usepackage{upgreek} \setlength{\oddsidemargin}{-69pt} \begin{document}$$S\subseteq V$$\end{document} of vertices that, on receiving any edge (x,y)∈S×S\documentclass[12pt]{minimal} \usepackage{amsmath} \usepackage{wasysym} \usepackage{amsfonts} \usepackage{amssymb} \usepackage{amsbsy} \usepackage{mathrsfs} \usepackage{upgreek} \setlength{\oddsidemargin}{-69pt} \begin{document}$$(x,y)\in S\times S$$\end{document} of positive capacity as query input, can efficiently report the set of all pairs from S×S\documentclass[12pt]{minimal} \usepackage{amsmath} \usepackage{wasysym} \usepackage{amsfonts} \usepackage{amssymb} \usepackage{amsbsy} \usepackage{mathrsfs} \usepackage{upgreek} \setlength{\oddsidemargin}{-69pt} \begin{document}$$S\times S$$\end{document} whose mincut value increases upon insertion of the edge (x, y) to G. The only result that exists for this problem is for a single pair of vertices (Picard and Queyranne, in: Rayward-Smith (ed) Combinatorial optimization II. Mathematical programming Studies, vol 13, no 1. Springer, Berlin, pp 8–16, 1980. https://doi.org/10.1007/BFb0120902, and dates back to 1980. We present the following results for the single source and the all-pairs versions of this problem. Single source Given any designated source vertex s, there exists a data structure of size O(|S|)\documentclass[12pt]{minimal} \usepackage{amsmath} \usepackage{wasysym} \usepackage{amsfonts} \usepackage{amssymb} \usepackage{amsbsy} \usepackage{mathrsfs} \usepackage{upgreek} \setlength{\oddsidemargin}{-69pt} \begin{document}$${\mathcal {O}}(|S|)$$\end{document} (Data structure sizes are in words unless specified otherwise, where a word occupies Θ(logn)\documentclass[12pt]{minimal} \usepackage{amsmath} \usepackage{wasysym} \usepackage{amsfonts} \usepackage{amssymb} \usepackage{amsbsy} \usepackage{mathrsfs} \usepackage{upgreek} \setlength{\oddsidemargin}{-69pt} \begin{document}$$\Theta (\log n)$$\end{document} bits.) that can output all those vertices from S whose mincut value to s increases upon insertion of any given edge. The time taken by the data structure to answer any query is O(|S|)\documentclass[12pt]{minimal} \usepackage{amsmath} \usepackage{wasysym} \usepackage{amsfonts} \usepackage{amssymb} \usepackage{amsbsy} \usepackage{mathrsfs} \usepackage{upgreek} \setlength{\oddsidemargin}{-69pt} \begin{document}$${\mathcal {O}}(|S|)$$\end{document}. All-pairs There exists an O(|S|2)\documentclass[12pt]{minimal} \usepackage{amsmath} \usepackage{wasysym} \usepackage{amsfonts} \usepackage{amssymb} \usepackage{amsbsy} \usepackage{mathrsfs} \usepackage{upgreek} \setlength{\oddsidemargin}{-69pt} \begin{document}$${\mathcal {O}}(|S|^2)$$\end{document} size data structure that can output all those pairs of vertices from S×S\documentclass[12pt]{minimal} \usepackage{amsmath} \usepackage{wasysym} \usepackage{amsfonts} \usepackage{amssymb} \usepackage{amsbsy} \usepackage{mathrsfs} \usepackage{upgreek} \setlength{\oddsidemargin}{-69pt} \begin{document}$$S\times S$$\end{document} whose mincut value increases upon insertion of any given edge. The time taken by the data structure to answer any query is O(k)\documentclass[12pt]{minimal} \usepackage{amsmath} \usepackage{wasysym} \usepackage{amsfonts} \usepackage{amssymb} \usepackage{amsbsy} \usepackage{mathrsfs} \usepackage{upgreek} \setlength{\oddsidemargin}{-69pt} \begin{document}$${\mathcal {O}}(k)$$\end{document}, where k is the number of pairs of vertices whose mincut value increases. For both these versions, we also address the problem of reporting the values of the mincuts upon insertion of any given edge. To derive our results, we use interesting insights into the nearest and the farthest mincuts for a pair of vertices. In addition, a crucial result, that we establish and use in our data structures, is that there exists a directed acyclic graph of O(n)\documentclass[12pt]{minimal} \usepackage{amsmath} \usepackage{wasysym} \usepackage{amsfonts} \usepackage{amssymb} \usepackage{amsbsy} \usepackage{mathrsfs} \usepackage{upgreek} \setlength{\oddsidemargin}{-69pt} \begin{document}$${\mathcal {O}}(n)$$\end{document} size that compactly stores the farthest mincuts from all vertices of V to a designated vertex s in the graph. We believe that this result is of independent interest, especially, because it also complements a previously existing result (Hariharan et al., in: Proceedings of the 39th annual ACM symposium on theory of computing, San Diego, California, USA, June 11–13, 2007, pp 605–614, 2007. https://doi.org/10.1145/1250790) that the nearest mincuts from all vertices of V to s is a laminar family, and hence, can be stored compactly in the form of a rooted tree of O(n)\documentclass[12pt]{minimal} \usepackage{amsmath} \usepackage{wasysym} \usepackage{amsfonts} \usepackage{amssymb} \usepackage{amsbsy} \usepackage{mathrsfs} \usepackage{upgreek} \setlength{\oddsidemargin}{-69pt} \begin{document}$${\mathcal {O}}(n)$$\end{document} size. Single source Given any designated source vertex s, there exists a data structure of size O(|S|)\documentclass[12pt]{minimal} \usepackage{amsmath} \usepackage{wasysym} \usepackage{amsfonts} \usepackage{amssymb} \usepackage{amsbsy} \usepackage{mathrsfs} \usepackage{upgreek} \setlength{\oddsidemargin}{-69pt} \begin{document}$${\mathcal {O}}(|S|)$$\end{document} (Data structure sizes are in words unless specified otherwise, where a word occupies Θ(logn)\documentclass[12pt]{minimal} \usepackage{amsmath} \usepackage{wasysym} \usepackage{amsfonts} \usepackage{amssymb} \usepackage{amsbsy} \usepackage{mathrsfs} \usepackage{upgreek} \setlength{\oddsidemargin}{-69pt} \begin{document}$$\Theta (\log n)$$\end{document} bits.) that can output all those vertices from S whose mincut value to s increases upon insertion of any given edge. The time taken by the data structure to answer any query is O(|S|)\documentclass[12pt]{minimal} \usepackage{amsmath} \usepackage{wasysym} \usepackage{amsfonts} \usepackage{amssymb} \usepackage{amsbsy} \usepackage{mathrsfs} \usepackage{upgreek} \setlength{\oddsidemargin}{-69pt} \begin{document}$${\mathcal {O}}(|S|)$$\end{document}. All-pairs There exists an O(|S|2)\documentclass[12pt]{minimal} \usepackage{amsmath} \usepackage{wasysym} \usepackage{amsfonts} \usepackage{amssymb} \usepackage{amsbsy} \usepackage{mathrsfs} \usepackage{upgreek} \setlength{\oddsidemargin}{-69pt} \begin{document}$${\mathcal {O}}(|S|^2)$$\end{document} size data structure that can output all those pairs of vertices from S×S\documentclass[12pt]{minimal} \usepackage{amsmath} \usepackage{wasysym} \usepackage{amsfonts} \usepackage{amssymb} \usepackage{amsbsy} \usepackage{mathrsfs} \usepackage{upgreek} \setlength{\oddsidemargin}{-69pt} \begin{document}$$S\times S$$\end{document} whose mincut value increases upon insertion of any given edge. The time taken by the data structure to answer any query is O(k)\documentclass[12pt]{minimal} \usepackage{amsmath} \usepackage{wasysym} \usepackage{amsfonts} \usepackage{amssymb} \usepackage{amsbsy} \usepackage{mathrsfs} \usepackage{upgreek} \setlength{\oddsidemargin}{-69pt} \begin{document}$${\mathcal {O}}(k)$$\end{document}, where k is the number of pairs of vertices whose mincut value increases.


Introduction
Let G = (V, E) be a graph on n = |V | vertices and m = |E| edges with a non-negative capacity on each edge.A mincut for a pair of vertices u and v is a set of edges with least capacity whose removal disconnects v from u.It is a fundamental concept in graph theory.Moreover, the area of designing algorithms for the mincut and its variants has been extensively researched ever since the seminal result on the maxflow-mincut duality by Ford and Fulkerson [5].
It is often the case that one is more interested in the mincuts between vertices belonging to a relatively small part of the input graph than the mincuts between all vertices.Hence, consider a subset of vertices S ⊆ V and any subset of pairs of vertices Q ⊆ S × S whose mincut we are interested in.The objective is to have the knowledge about how sensitive the mincuts of pairs of vertices from Q are, with respect to any change in the subgraph induced by S. This change could be a change in the capacity of an existing edge in the subgraph induced by S or insertion of a new edge between any two vertices in S.This knowledge of the impact on various mincuts due to any change in the network can make the network administrators well prepared for such changes when they indeed occur in future.
An important measure of the impact of a change in the capacity of an edge is the number of pairs of vertices whose mincut value changes.The change in the capacity of an edge could be either an increase or a decrease.We focus on the case when the capacity of an edge is allowed to increase only.For this data structure problem, the query input is a new edge with positive capacity or an existing edge whose capacity is increased.It can easily be observed that as far as the mincut between any pair of vertices is concerned, increasing the capacity of an existing edge (x, y) by amount ∆ is equivalent to adding one more edge between x and y with capacity ∆.So henceforth, we only consider the insertion of an edge.On receiving any such edge, the objective is to efficiently report the pairs of vertices whose mincut increases.
Based on the discussion above, we now formally define the problem of mincut sensitivity.
Problem 1. Preprocess G = (V, E), a set S ⊆ V , and a set Q ⊆ S × S to build a compact data structure that, on receiving any edge (x, y) ∈ S × S of positive capacity as query input, can efficiently report all those pairs from Q whose mincut value increases upon insertion of the edge (x, y) to G.
We expect the bounds for the data structure of Problem 1 to depend on only the size of S instead of V .For simultaneously achieving efficient query time and compact space, the only previous solution that exists for this problem is for a single pair of vertices only, i.e., when |Q| = 1.It consists of a data structure that occupies O(|S|) space and achieves O(1) query time.This solution follows from an observation made by Picard and Queyranne in their seminal paper [11]. 12:3

Our Contribution
We address the single source and the all-pairs versions of Problem 1, along with the problem of reporting the new value of the mincut between any pair of vertices after the edge insertion.
Single source all destinations: In the single source case, we are interested in the mincuts between a designated vertex s ∈ S and all other vertices from set S, i.e., the (s, t)-mincut, for all t ∈ S \ {s}.
Theorem 2. For an undirected graph and any subset S of vertices with a designated vertex s ∈ S, there exists an O(|S|) size data structure that can report all those vertices from S whose mincut value to s increases upon insertion of any given edge from S × S. The time taken by this data structure to answer any such query is O(|S|).
The O(|S|) space and O(|S|) query time of our data structure for undirected graphs can be much less than O(|V |) for smaller S. Also, it is in sharp contrast with the following lower bound result for directed graphs that we also prove.Theorem 3. Any data structure for a directed graph to answer a mincut sensitivity query from a designated source vertex to any designated subset of q vertices must use Ω(q 2 ) bits of space for at least one directed graph.
The proof of Theorem 3 basically establishes that any such data structure can be used to store any balanced bipartite graph on 2|S| vertices implicitly.Interestingly, the same proof also establishes an Ω(|S| 2 ) lower bound for the single source version of two other fundamental problems for directed graphs, namely, reachability sensitivity as well as distance sensitivity for the insertion of an edge.These facts add more significance to the result stated in Theorem 2 for the single source mincut sensitivity.
All-pairs: When considering the mincuts between all pairs of vertices in S, i.e., the (u, v)mincut, for all u, v ∈ S such that u = v, we obtain the following result.Theorem 4. For an undirected graph and any subset S of vertices, there exists an O(|S| 2 ) size data structure that can report all those pairs of vertices from S × S whose mincut value increases upon insertion of any given edge from S × S. The time taken by the data structure to answer any such query is O(k), where k is the number of pairs whose mincut increases.
Note that the query time of the data structure in Theorem 4 is optimal.Moreover, if the objective is to report just the number of all-pairs from the set S × S whose mincut increases upon insertion of any given edge, our data structure can accomplish this objective in O(min(k, |S| log |S|)) time, which is O(|S| log |S|) always.
Remark 5. Our results for mincut sensitivity directly extend to maxflow sensitivity as well due to the equivalence between maxflow and mincut [5].
To achieve all our results, we use interesting insights into the nearest and the farthest mincuts for a pair of vertices -two concepts that exist since the seminal work of Ford and Fulkerson on maximum flow [5].Additionally, a crucial result about the farthest mincuts that we establish and use in one of our data structures is the following.Theorem 6.For an undirected graph on n vertices and a designated source vertex s, there exists a directed acyclic graph (DAG) of size O(n) that compactly stores the farthest mincuts from all vertices v ∈ V \{s} to s.For any v, the set of vertices defining the farthest mincut from v to s can be reported in time that is of the order of the size of the set.
The graph theoretic result of Theorem 6 is of independent interest in addition to its applications in the mincut sensitivity problem.This is because, not only it adds to our understanding of mincuts, but it also complements an earlier result of Hariharan et al. [9] that showed that the nearest mincuts from all vertices to s form a laminar family, and hence, can be stored in a tree data structure occupying only O(n) space.

On reporting the value of mincut
In addition to reporting the pairs of vertices whose mincut increases upon insertion of a given edge, it may be important to output the new values of their mincuts.Indeed, if the edge capacities in the graph are integral and the inserted edge has unit capacity, our data structures from Theorems 2 and 4 can also report the new values of the affected mincuts upon insertion of an edge, i.e., the value of the mincut will be increased by one for the reported pairs of vertices.However, if there is no restriction on the capacity of the inserted edge, we show that even for the single source case it is not possible to accomplish this objective with any data structure of subquadratic size.Theorem 7.There exists a set G of undirected graphs on n vertices with integer edge capacities in the range [1, n 2+ε ] (for any ε > 0) for which the following claim holds true.Any data structure for an undirected graph that can report the value of the mincut between a designated source vertex and any other vertex upon insertion of any edge of integer capacity polynomial in n must require Ω(n 2 ε log n) bits of space for at least one graph from G.
For the all-pairs case, it turns out that any such data structure also provides a generalization of the flow-tree [6,8].That is, the data structure will also be able to report the mincut value between a vertex u and a pair {x, y} of vertices for any u, x, y ∈ V .Chitnis, Kamma, and Krauthgamer [4] showed that there will be total O(n 2 ) distinct mincut values separating any vertex from any pair of vertices in an undirected graph.However, to the best of our knowledge, designing an O(n 2 ) size data structure that returns the value of any such mincut in non-trivial query time is still an open problem.

Overview of our results
We begin with the result of Picard and Queyranne [11] for mincut sensitivity for a sourcedestination pair (s, t).For any maximum flow f from s to t, let G f be the corresponding residual graph.Notice that there is no path from s to t in G f .Let R be the set of vertices which are reachable from s in G f , and let T be the set of vertices from which t is reachable in G f .Picard and Queyranne [11] made the following crucial observation.Lemma 8 (Picard and Queyranne [11]).The maxflow from s to t increases upon insertion of an edge (x, y) if and only if x belongs to R and y belongs to T .
Without loss of generality, we can assume that the vertices of set S are labeled from 1 to |S|.Based on Lemma 8, the data structure for mincut sensitivity for a (s, t)-pair where s, t ∈ S, stores each of R ∩ S and T ∩ S in Boolean arrays indexed by the vertices of set S.
The subsets R and V \T in Lemma 8 turn out to be the smallest, and the largest subsets of vertices defining a mincut from s to t, respectively.In the literature on mincuts, R and V \T are respectively called the nearest and the farthest mincut from s to t; we define these notions more formally in the next section.Therefore, in order to design a compact and efficient data structure for the single source and the all-pairs versions of the mincut sensitivity problem, it is natural to explore if we can have a compact way to store these two types of cuts

12:5
for multiple pairs of vertices.We now provide an overview of the compact data structures for the nearest and the farthest mincuts, and the way these data structures are used to solve the mincut sensitivity problem.

Compact data structures for the nearest and the farthest mincuts
Interestingly, Hariharan et al. [9] showed that the nearest mincuts from all vertices to a designated vertex s in an undirected graph form a laminar family -If the subsets of vertices defining the nearest mincuts from u to s, and v to s intersect, then one of them must be a subset of the other.As a result, the nearest mincuts from all vertices to s can be stored compactly in a tree data structure occupying O(n) space only.However, the farthest mincuts do not constitute a laminar family.Let F u and F v be the subsets of vertices that define the farthest mincuts to s from u and v respectively.It is quite possible that F u and F v intersect each other but none of them is a subset of the other.In other words, two intersecting farthest mincuts to s may cross each other.Moreover, there may be Θ(n) vertices whose farthest mincuts to s cross the farthest mincut of a single vertex to s.This poses a challenge for designing a compact data structure for storing all the farthest mincuts to s.However, we overcome this challenge using crucial insights into the farthest mincuts.
Using the submodularity of cuts, we first establish the existence of a DAG on O(n) nodes that stores the farthest mincuts from all vertices to any designated vertex s.However, this DAG could have O(n 2 ) edges, and establishing the sparsity of the DAG turns out to be the main hurdle.We overcome this by proving the following interesting property of the farthest mincuts to s: For any three vertices, either the intersection of their farthest mincuts to s is empty or the farthest mincut from at least one of them is a subset of one of the other two.
Using this property, we are able to prune away all the unnecessary edges from the DAG structure storing farthest mincuts to s.As a result, each node in the DAG turns out to have at most 2 incoming edges, so the size of the DAG is O(n).
For the objective of solving mincut sensitivity for a subset S ⊆ V , we present data structures for the nearest mincuts (likewise the farthest mincuts) that consist of vertices of S only instead of V .Their size is O(|S|).See Theorem 18 and Theorem 6.

Solving the mincut sensitivity problem
For solving the single source mincut sensitivity problem, we use the tree data structure storing the nearest mincuts and the DAG data structure storing the farthest mincuts, from all vertices of the set S to s.The size of the data structure is O(|S|).Following Lemma 8, it takes O(|S|) time using this data structure to determine whether the insertion of a given edge increases the (s, v)-mincut value for any vertex v ∈ S.This leads to O(|S| 2 ) time to find all vertices from S whose mincut value from s increases due to the insertion of a given edge.In order to reduce the query time to O(|S|), we make use of the following insight: A vertex x ∈ S belongs to the farthest mincut from v to s if and only if x is reachable from v in the DAG structure storing the farthest mincuts to s.
Solving the all-pairs version of the mincut sensitivity problem with optimal query time turns out to be more challenging.As the underlying graph is undirected, the subset of vertices that defines the farthest mincut from u to v is the complement of the subset of the vertices that defines the nearest mincut from v to u.As a result, keeping the nearest-mincut tree data structure for each vertex of S suffices to solve this problem.The data structure takes O(1) time to determine for any pair (u, v), whether insertion of an edge, say (x, y), increases E S A 2 0 2 0 12:6 Mincut Sensitivity Data Structures for the Insertion of an Edge (u, v)-mincut value.This observation implies an O(|S| 2 ) time algorithm for computing all pairs of vertices from set S whose mincut value increases upon insertion of edge (x, y).But it is quite wasteful if k, the number of pairs whose mincut value increases, is much smaller than |S| 2 .To accomplish O(k) query time, we make use of multiple insights into the structure of the nearest mincuts.The most crucial insight is the following: The vertices whose mincut value to s increases upon insertion of an edge (x, y) lie contiguously on the paths from x and y to their lowest common ancestor in the tree that stores the nearest mincuts to s.
This insight leads to an O(|S| + k) query time.To get rid of the additive factor of |S|, we use another insight that helps finding the right pool of vertices whose nearest-mincut tree we need to query.

Related work
Our research is related to the field of dynamic graph algorithms that emphasizes on efficient data structures to handle changes in a network.For dynamic graph algorithms, the objective is to maintain the solution of a problem for an online sequence of edge insertions or deletions with worst case time complexity better than that of the best static algorithm.There do exist efficient dynamic algorithms for maintaining a global mincut -an incremental algorithm by Goranci, Henzinger, and Thorup [7], and a fully dynamic algorithm by Thorup [12].However, there does not exist any dynamic algorithm for all-pairs mincuts whose worst case time complexity is better than the best static algorithm.Hartmann and Wagner [10] presented a fully dynamic algorithm for maintaining an all-pairs mincut tree for undirected graphs.Although it achieves a significant speedup over the best static algorithm on many real world graphs, its worst case asymptotic time complexity is not better than the best static algorithm for an all-pairs mincut tree.

Organization of the paper
Equipped with notations, definitions, and well known lemmas introduced in Section 2, we present the compact data structures for nearest and farthest mincuts in Sections 3 and Section 4, respectively.The data structures for the single source and the all-pairs versions of the mincut sensitivity problem are presented in Section 5 and 6 respectively.Due to the space constraint, the proofs of some theorems and lemmas had to be omitted from this version.So we recommend the reader to refer to the full version of this paper [2].

Preliminaries
Our results consider an undirected graph G = (V, E) on n vertices where each edge is assigned a non-negative capacity through a function c : E → R + .

Definition 9 ((s, t)-cut).
A subset of edges whose removal disconnects t from s is called an (s, t)-cut.An (s, t)-mincut is an (s, t)-cut of smallest capacity.

Definition 10 (set defining a cut). A subset A ⊂ V is said to define an (s, t)-cut if s ∈ A and t / ∈ A. The corresponding cut is denoted by cut(A, Ā) or more compactly cut(A).
When there is no scope of confusion, we do not distinguish between a mincut and the set defining the mincut.We can extend the capacity function c on edges to any subset A ⊂ V in a natural way as follows: c(A) denotes the sum of the capacities of all those edges which have exactly one endpoint in A. With this generalization, we now state a well-known property of cuts, namely, the submodularity of cuts.

Lemma 11 (Submodularity of cuts). Given an undirected graph G = (V, E) with positive edge capacities, the following inequality holds true for any two subsets
The following lemma states an important property of an (s, t)-mincut.
Lemma 12. Let A ⊂ V define an (s, t)-mincut with s ∈ A. For any subset A ⊂ A with s / ∈ A , if α is the number of edges incident on A from V \A, and β is the number of edges incident on A from A\A , then α ≤ β.

The nearest and the farthest mincuts
Definition 13 (Nearest and farthest mincuts from s to t).The subset A ⊂ V with s ∈ A is said to define the nearest (likewise the farthest) mincut from s to t if (1) cut(A, Ā) defines an (s, t)-mincut, and (2) For every other subset A ⊂ V that defines an (s, t)-mincut, A ⊂ A (likewise A ⊂ A).We use s N t and s F t to denote the nearest and the farthest mincut from s to t, respectively.
One can easily show using Lemma 11 that the nearest and the farthest mincut from s to t are unique.Additionally, t N s and s F t partition the set of vertices V as stated in the following lemma.

Lemma 14. For any pair of vertices
In the light of Lemma 14, we can restate Lemma 8 for undirected graphs as follows.
Lemma 15 (Picard and Queyranne [11]).The insertion of an edge (x, y) can increase the mincut between s and t if and only if x ∈ s N t and y ∈ t N s or vice versa.
Remark 16.In order to explore the relationship among the farthest mincuts from a set of vertices to a vertex s, we focus only on the connected component of s.This is because for each vertex outside this component, its farthest mincut to s is obvious.Therefore, without loss of generality we assume G to be connected in the rest of the paper.

3
A compact data structure for all nearest mincuts to vertex s The following theorem plays the key role in compactly storing all nearest mincuts to s.
Theorem 17 (Hariharan et al. [9]).For any two distinct vertices u, v ∈ S, either u N s and v N s are mutually disjoint or one of them is a subset of the other.
For a given subset S ⊆ V , let N = {x N s ∩ S|x ∈ S\{s}}.Using Theorem 17 we can arrange the sets of N in a forest of disjoint trees as follows.We refer to a vertex in this forest as node.For each set present in N , we create a unique node in the forest.We assign each vertex v ∈ S to the node ν corresponding to v N s ∩ S. The parent of a node ν is defined as the unique node µ such that the set corresponding to µ is the smallest superset of the set corresponding to ν, if such a superset exists.If no such superset exists, ν will be the root of a tree.We create a dummy node and assign it as the parent of the root of every tree in this forest.Let us denote the resulting rooted tree by T (s). Figure 1 shows an example graph and the corresponding T (s) for the case S = V .
It can be observed that if a vertex v ∈ S is assigned to node ν, then the subtree rooted at ν stores the set v N s ∩ S.So it follows that a vertex, say x, belongs to v N s ∩ S if either x and v are assigned to the same node in T (s) or the node containing v is an ancestor of the node containing x.This check can be easily done in O(1) time if we augment T (s) to answer lowest common ancestor (LCA) query for any pair of nodes (see [3]).We can thus state the following theorem.
Theorem 18.For an undirected graph G = (V, E), a subset S ⊆ V , and any vertex s ∈ S, there exists an O(|S|) size data structure T (s) that can report in O(1) time whether x ∈ v N s for any x, v ∈ S.

4
A compact data structure for all farthest mincuts to vertex s In this section, we present a novel data structure that compactly stores the farthest mincuts to vertex s from a subset of vertices.Our main result can be summarized as follows.

A DAG of size O(|S| 2 )
Our data structure to store all farthest mincuts to a designated vertex s uses the observation captured in Lemma 21.In its core, it tells us that certain farthest mincuts are related by a subset relation which can be exploited to store them compactly.

Lemma 21. Let x and v be any two vertices in
Proof.We use Lemma 11 on the submodularity of cuts and provide a proof by contradiction.Let A and B refer to the sets v F s and x F s , respectively.It is given that s .This would imply that B\A = ∅, hence A must be a proper subset of A ∪ B. Observe that A ∩ B defines a valid (x, s)-cut since x is present in both A and B, whereas s / ∈ x F s .This observation implies that c(A ∩ B) ≥ c(B) since B defines an (x, s)-mincut.This inequality and Lemma 11 imply the following inequality.

12:9
Now observe that A ∪ B defines a valid (v, s)-cut since v belongs to A, whereas s belongs neither to A nor to B. Since A defines a (v, s)-mincut, so Inequality 1 implies that c(A ∪ B) must be equal to the capacity of an (v, s)-mincut.But A is a proper subset of A ∪ B. This would imply that the cut defined by A is not the farthest mincut from v to s -a contradiction.
Let F = {v F s ∩ S | v ∈ S\{s}}.We now use Lemma 21 to build a directed acyclic graph D = (V, E) that stores F as follows.We use node to refer to a vertex of this DAG.
For each set present in F, we create a unique node in D. The set of nodes thus created constitutes V. We denote by F(ν) the set in F corresponding to node ν.The edge set E of D is defined as follows.
It can be observed that if X ⊂ Y for any two sets X and Y in F, then |X| < |Y |.Hence D is acyclic.To efficiently retrieve x F s ∩ S for any given x ∈ S, we can augment D as follows.We create an array J s indexed by vertices of set S such that for any v ∈ S \ {s}, J s [v] stores the pointer to node µ that corresponds to v F s ∩ S, that is, We introduce a dummy node and add an edge from it to every other node which has no incoming edge.Lemma 22 follows immediately from Lemma 21 and the construction of D described above.

Lemma 22. Let x and u be any two vertices of set S. x is present in u
Lemma 22 implies that for each vertex v ∈ S\{s}, v F s ∩ S is the set of vertices stored in the list L(J s [v]) and the lists of all the nodes with an incoming edge from The subset relation ⊂ is transitive.So, if there is a path from a node ν to another node µ in D, then (ν, µ) is also an edge in D. In other words, the transitive closure of D is D itself.This observation in conjunction with Lemma 22 leads us to the following lemma which will be crucial for our data structure for the single source mincut sensitivity problem.

Lemma 23. Let x and u be any two vertices in set S. x is present in u
Notice that D has O(|S|) nodes, but it could have Θ(|S| 2 ) edges.So the total space occupied by D could be Θ(|S| 2 ).A natural idea to overcome this hurdle is to remove as many edges as possible from D without affecting the reachability between any pair of its vertices so that Lemma 23 continues to hold.In other words, we compute another DAG D τ which is the transitive reduction of D. Aho, Garey, and Ullman [1] showed that computing the transitive reduction of a DAG is as easy as computing its transitive closure.While in general a transitive reduction does not always lead to a reduced number of edges, it does so in the case of D. In the following subsection we present crucial insights into crossing farthest mincuts that ensure that each node of D τ will have at most two incoming edges.The data structure D(s) in Theorem 19 for storing all farthest mincuts to s is D τ only.

Bounding the in-degree of D τ by 2
A set of vertices I ⊂ V is said to be a set of incomparable vertices with respect to the mincuts to s if for each u, v ∈ I with u = v it holds that u / ∈ v F s and v / ∈ u F s .The following lemma highlights an important property for a pair of incomparable vertices.E S A 2 0 2 0 12:10 Mincut Sensitivity Data Structures for the Insertion of an Edge Lemma 24.For any two incomparable vertices u and v, there does not exist any edge between the set u F s ∩ v F s and the set V \(u F s ∪ v F s ).We shall now use Lemma 12 and Lemma 24 to derive the following lemma which will play a crucial role in establishing that D τ has indegree 2 only.

Lemma 25. For any three incomparable vertices
We give a proof by contradiction.Let B, L, and R denote the sets u F s , v F s , and w F s , respectively.Figure 2(i) illustrates these sets.For a clear distinction, we have used different colors for these sets in this figure, and correspondingly assigned the labels B (for blue), L (for light green), and R (for red) to these sets.Suppose the common intersection B ∩ L ∩ R of these sets (shown shaded in Figure 2(i)) is not an empty set.By applying Lemma 24 for B ∩ L, L ∩ R, R ∩ B, we can infer that each vertex in the common intersection will have edges incident only from the sets B ∩ L, L ∩ R, R ∩ B. Considering the set B ∩ L ∩ R as a single entity, let α, β, γ be the number of edges incident on it from (B ∩ L)\R, (R ∩ B)\L, (L ∩ R)\B, respectively.As the graph is connected (see Remark 16), we have: Let us consider the set (B ∩ L)\R, that is, the set B ∩ L after removing the common intersection B ∩ L ∩ R. It follows from Lemma 24 that the edges incident on this set will be from B\L and L\B only, apart from the edges incident from B ∩ L ∩ R. Similar claims hold for the sets (B ∩ R)\L and (R ∩ L)\B as well.Figure 2(ii) shows these sets as shaded regions along with the edges incident on them.For example, l, b, α are the number of edges incident on (B ∩ L)\R from B\L, L\B, and B ∩ R ∩ L, respectively.
The rest of the proof is as follows.Exploiting the fact that u, v, w are incomparable, we suitably apply Lemma 12 to arrive at inequalities that eventually leads to contradict Inequality 2.
B defines an (s, u)-mincut.Since u is incomparable with both v and w, it is not present in the set B ∩ (R ∪ L) shown shaded in Figure 2(iii).Notice that the number of edges incident on this set from V \B is b + b + γ whereas the number of edges incident on this set from the rest of B, that is, the set B\(R ∪ L) (enclosed by dotted boundary in Figure 2(iii)) is at most l + r.So we get the following inequality by substituting B and B ∩ (R ∪ L) in place of A and A respectively in Lemma 12: In Figure 2, R defines an (s, w)-mincut and L defines an (s, v)-mincut.Hence, with similar arguments as above, analyzing the (s, w)-mincut in Figure 2(iv), and analyzing the (s, v)-mincut in Figure 2(v), we get the following inequalities, respectively: Adding the above inequalities with Inequality 3 and canceling identical terms on either sides we get α + β + γ ≤ 0. This contradicts Inequality 2 and completes the proof.
The following is a simple corollary of Lemma 25.
Corollary 26.Let A ∈ F. If U, V, W are any three distinct sets from F such that A ⊂ U, A ⊂ V , and A ⊂ W . Then at least one of the sets from {U, V, W } must be a proper subset of one of the remaining two.
We can use Corollary 26 to establish the following lemma.
Lemma 27.The indegree of any node in D τ will be at most 2.
Figure 3 shows farthest mincuts from a sample of vertices to s in our example graph.Notice that the farthest mincut b F s crosses the farthest mincut d F s .Also, the farthest mincuts from j and g to s are identical, so j and g are mapped to a single node in D τ .

Single source mincut sensitivity for insertion of an edge
We now present an O(|S|) space data structure that can report all those vertices from S whose mincut value to s increases upon insertion of any given edge (x, y) ∈ S × S. The data structure will consist of the tree structure T (s) from Theorem 18 and DAG structure D(s) from Theorem 19. Let

6
All-pairs mincut sensitivity data structure for insertion of an edge Our data structure consists of the nearest-mincut tree T (z) from Theorem 18 for each z ∈ S.
Each of these trees occupies O(|S|) space, so the space occupied by the data structure is O(|S| 2 ).For the rest of this section, x, y, z are any arbitrary vertices from S. Upon insertion of edge (x, y), let k be the number of pairs of vertices from S × S whose mincut value increases.We present an O(k) time algorithm to output all these pairs using four insights into the nearest-mincut trees.Our first insight is stated in Lemma 28.It implies that for all vertices belonging to a node µ in T (z), it suffices to determine for any single vertex, say u ∈ µ, whether the (z, u)-mincut value increases upon insertion of any given edge.
Lemma 28.Let u, v ∈ S be any two vertices belonging to the same node in T (z).Upon insertion of any given edge, (u, z)-mincut value increases iff (v, z)-mincut value increases.
Let µ and ν be the nodes in T (z) containing x and y respectively.Our second insight, stated in the following lemma, specifies the location of vertices in T (z) whose mincut value to s increases upon insertion of edge (x, y).
Lemma 29.Let ω = LCA(µ, ν) in T (z).Upon insertion of edge (x, y), the mincut value from z to only those vertices may increase that belong to the nodes of ( 1) the path from µ to ω but excluding ω, and ( 2) the path from ν to ω but excluding ω.

ω µ ν y x
Figure 4 The tree T (z) from the perspective of µ and ν.If v is a vertex whose node in T (z) does not belong to either of ω-ν and ω-µ paths, then v must be present in one of the subtrees hanging from these paths (shown in blue).Now consider any node, say γ, lying on the path from ω to the root of T (z).Both x and y belong to the subtree rooted at γ.

Proof.
Let us view T (z) from the perspective of the paths from µ and ν to the root of T (z).The reader is advised to refer to Figure 4 for a better understanding.If v is a vertex whose node in T (z) does not belong to these paths, then v must be present in one of the subtrees (shown in blue in Figure 4) hanging from these paths.Notice that neither x nor y belongs to 12:13 the subtree containing v.So it follows from Lemma 15 that the mincut from z to v is not affected by the insertion of edge (x, y).Now consider any node, say γ, lying on the path from ω to the root of T (z).Both x and y belong to the subtree rooted at γ.So using Lemma 15 again, the mincut from z to any vertex of γ remains unaffected by the insertion of edge (x, y).
Our third and most crucial insight is that the vertices whose mincut value to z increases upon insertion of edge (x, y) belong to a contiguous sequence of nodes on the paths from the node containing y and the node containing x to their LCA in T (z).The following lemma states this insight for the node containing y.
Lemma 30.Let ω be the LCA of the nodes containing x and y in T (z).Let u and v be any two vertices lying on the path from the node containing y to ω in T (z) such that the node containing u is an ancestor of the node containing v. If (z, u)-mincut value increases upon insertion of edge (x, y), then (z, v)-mincut value also increases upon insertion of (x, y).
Proof.It follows from the construction of T (z) that y ∈ v N z and v N z ⊆ u N z .It is given that the insertion of edge (x, y) increases (z, u)-mincut value and u is an ancestor of y in T (z).So Lemma 15 implies: Applying Lemma 14(ii) again, it follows that z N u ⊆ z N v .Using this fact and Equation 4, we can infer that x ∈ z N v .Since we have already established that y ∈ v N z , so using Lemma 15 we can conclude that (z, v)-mincut value will also increase upon insertion of edge (x, y).
It is a simple corollary of Lemma 30 that if (y, z)-mincut value does not increase upon insertion of edge (x, y), then for any vertex v present in any ancestor of the node containing y in T (z), (v, z)-mincut value will also not increase.So, to compute all-pairs of vertices whose mincut increases, we need to explore the nearest-mincut tree of only those vertices z whose mincut value to y (and likewise to x) increases.
We now describe how to process T (z) for a vertex z given that (y, z)-mincut value increases upon insertion of (x, y).For each such z, first we enumerate all vertices present in the node, say ν, to which y belongs.We then begin an upward traversal of T (z) starting from the parent of ν.For any node, say λ, that we traverse, we pick any arbitrary vertex from it, say v, and determine whether x ∈ z N v by querying T (v).It takes O( 1) time to answer this query (see Theorem 18).If x ∈ z N v , it follows from Lemma 28 that each vertex present in λ has its mincut value to z increased.So we enumerate all vertices from λ, and continue processing the parent of λ in a similar manner.If x / ∈ z N v , we stop the traversal.It follows from Lemma 30 that the vertices enumerated in this way are precisely the vertices whose mincut value to z increases.To efficiently identify each vertex z, such that the (y, z)-mincut value increases upon insertion of edge (x, y), we exploit the fourth insight into the nearest-mincut trees which is stated in the following lemma.This lemma can be seen as a corollary of Lemma 15.
Lemma 31.(y, z)-mincut value increases upon insertion of edge (x, y) iff x ∈ z N y .
It follows from Lemma 31 that the vertices present in the node containing x and its ancestors in T (y) are precisely the vertices whose mincut value to y increases.We can identify all these vertices in optimal time by traversing T (y) upward from the node containing x. E S A 2 0 2 0 12:14 Mincut Sensitivity Data Structures for the Insertion of an Edge We have described above the processing of each z such that the (y, z)-mincut value increases due to the insertion of edge (x, y).A similar processing must be carried out for all vertices z, such that the (x, z)-mincut value increases due to the insertion of edge (x, y).
It follows from the description given above that we can compute all those pairs of vertices from S × S whose mincut value increases upon the insertion of any given edge in O(k) time, where k is the number of these pairs.If our goal is to just report the value of k, we can accomplish it in O(min(k, |S| log |S|)) time by suitably augmenting the nearest-mincut trees.We can thus conclude with Theorem 32 which extends Theorem 4.
Theorem 32.For an undirected graph G = (V, E), and a subset S of vertices, there exists an O(|S| 2 ) size data structure that can report all pairs of vertices whose mincut increases upon insertion of a query edge.The guaranteed query time is O(k), where k is the number of pairs whose mincut increases.We can also report k in O(min(k, |S| log |S|)) time.

Figure 1
Figure 1 (a) The nearest mincut from a vertex to s is encircled with same color.(b) Tree T (s).

Theorem 19 .
For an undirected graph G = (V, E), any subset S ⊆ V , and a designated vertex s ∈ S, there exists a directed acyclic graph D(s) having O(|S|) nodes and O(|S|) edges that can report v F s ∩ S in time of the order of the size of v F s ∩ S for any v ∈ S\{s}.Lemma 14(ii) implies that s N v = V \v F s .So we can compute s N v ∩ S in O(|S|) time once we have v F s ∩ S. Therefore, we can state the following corollary of Theorem 19.Corollary 20.For an undirected graph G = (V, E), any subset S ⊆ V , and a designated vertex s ∈ S, there exists a data structure of O(|S|) size that takes just O(|S|) time to compute s N v ∩ S for any v ∈ S\{s}.Next, we show how to compute a DAG storing all farthest mincuts to s in space O(|S| 2 ).Thereafter, we reduce its space complexity to O(|S|) only.

Figure 2
Figure 2 Intersection of the farthest mincuts to s.

Figure 3
Figure 3 (a) A dotted boundary defines a farthest mincut to s from a vertex of the same color.(b) The DAG D τ .

E S A 2 0 2 0 12:12 Mincut Sensitivity Data Structures for the Insertion of an Edge from
It follows from Lemma 15 that if (s, v)-mincut increases, then v must belong to A x or A y .Furthermore, for any v ∈ A x , (s, v)-mincut increases if y ∈ v N s .Using Theorem 18, it takes just O(1) time to do this check for any given v ∈ A x (likewise A y ).So, in order to report all vertices from S whose mincut from s increases upon insertion of edge (x, y) in O(|S|) time, all we need is an O(|S|) time algorithm to compute A x and A y .We now provide O(|S|) time algorithm to compute A x ; we can compute A y in O(|S|) time in a similar manner.It follows from Lemma 14(ii) that computing A x is equivalent to computing the set Āx = {v ∈ S|x ∈ v F s }.Recall that J s [x] is the node containing x in D(s).It follows from Lemma 23 that x ∈ v F s if and only if J s [x] is reachable from J s [v] in D(s).Therefore, we can compute Āx by first reversing the edges of D(s) and then traversing all the nodes reachable J s [x].For each node λ reachable from J s [x] in the reversed D(s), x is present in v F s for each vertex v ∈ L(λ).Since D(s) has O(|S|) edges, it takes O(|S|) time to reverse it and traverse it to compute Āx .This establishes the proof of Theorem 2 for the single source mincut sensitivity problem.