A polynomial-time approximation algorithm for all-terminal network reliability

We give a fully polynomial-time randomized approximation scheme (FPRAS) for the all-terminal network reliability problem, which is to determine the probability that, in a undirected graph, assuming each edge fails independently, the remaining graph is still connected. Our main contribution is to confirm a conjecture by Gorodezky and Pak (Random Struct. Algorithms, 2014), that the expected running time of the"cluster-popping"algorithm in bi-directed graphs is bounded by a polynomial in the size of the input.


Introduction
Network reliability problems are extensively studied #P-hard problems [Col87] (see also [BP83,PB83,KL85,Bal86]). In fact, these problems are amongst the first of those shown to be #P-hard, and the two-terminal version is listed in Valiant's original thirteen [Val79]. The general setup is that in a given (undirected or directed) graph, every edge (or arc) e has an independent probability p e to fail, and we are interested in various kinds of connectivity notions of the remaining graph. For example, the two-terminal connectedness [Val79] asks for the probability that for two vertices s and t, s is connected to t in the remaining graph, and the (undirected) all-terminal network reliability asks for the probability of all vertices being connected after edges fail. The latter can also be viewed as a specialization of the Tutte polynomial T G (x, y) with x = 1 and y > 1, yet another classic topic whose computational complexity is extensively studied [JVW90,VW92,GJ08,GJ14].
Prior to our work, the approximation complexity of network reliability problems remained elusive despite their importance. There is no known efficient approximation algorithm (for any variant), but nor is there any evidence that such an algorithm does not exist. A notable exception is Karger's fully polynomial-time randomized approximation scheme (FPRAS) for (undirected) all-terminal network unreliability [Kar99] (see also [HS14,Kar16,Kar17] for more recent developments). Although approximating unreliability is potentially more useful in practice, it does not entail an approximation of its complement.
In this paper, we give an FPRAS for the all-terminal network reliability problem, defined below and denoted Reliability.
Name: Reliability Instance: A (undirected) graph G = (V, E), and failure probabilities p = (p e ) e∈E . Output: Z rel (G; p), which is the probability that if each edge e fails with probability p e , the remaining graph is connected.
When p e is independent of e, Reliability is an evaluation of the Tutte polynomial. The Tutte polynomial is a two-variable polynomial T G (x, y) associated with a graph G, which encodes much interesting information about G. As (x, y) ranges over R 2 or C 2 we obtain a family of graph parameters, the so-called Tutte plane. As already noted, the study of the computational complexity of these parameters has a long history. Reliability with a uniform failure probability 0 < p < 1 is equivalent to evaluating the Tutte polynomial T G (x, y) on the line x = 1 and y = 1 p > 1. Our algorithm is the first positive result on the complexity of the Tutte plane since Jerrum and Sinclair presented an FPRAS for the partition function of the ferromagnetic Ising model, which is equivalent to the Tutte polynomial on the positive branch of the hyperbola The work described here was supported by the EPSRC research grant EP/N004221/1 "Algorithms that Count". (x − 1)(y − 1) = 2 [JS93]. It also answers a well-known open problem from 1980s, when the #Phardness of Reliability was established [Jer81,PB83] and the study of approximate counting initiated. This problem is explicitly proposed in, for example, [Wel93,Conjecture 8.7.11] and [Kar99]. We note that many conjectures by Welsh ([Wel93, Chapter 8.7] and [Wel99]) remain open, and we hope that our work is only a beginning to answering these questions.
Another related and important reliability measure is reachability, introduced and studied by Ball and Provan [BP83]. A directed graph G = (V, A) with a distinguished root r is said to be root-connected if all vertices can reach r. Reachability, denoted Z reach (G, r; p) for failure probabilities p = (p e ) e∈A , is the probability that, if each arc e fails with probability p e independently, the remaining graph is still root-connected.
We define the computational problem formally.

Name: Reachability
Instance: A directed graph G = (V, A) with root r, and failure probabilities p = (p e ) e∈A . Output: Z reach (G, r; p).
Exact polynomial-time algorithms are known when the graph is acyclic [BP83] or has a small number of cycles [Hag91]. However, in general the problem is #P-hard [PB83]. Ball [Bal80] showed that Reliability is equivalent to Reachability in bi-directed graphs. A bi-directed 1 graph is one where every arc has an anti-parallel twin with the same failure probability. It is shown [Bal80] that Z rel (G; p) = Z reach ( − → G , r; p ′ ), where − → G and p ′ are obtained by replacing every undirected edge in G with a pair of anti-parallel arcs having the same failure probability in either direction, and r is chosen arbitrarily. See Lemma 12.
Our FPRAS for Reliability utilizes this equivalence via approximating Reachability in bi-directed graphs. The core ingredient is the "cluster-popping" algorithm introduced by Gorodezky and Pak [GP14]. The goal is to sample root-connected subgraphs with probability proportional to their weights, and then the reduction from counting to sampling is via a sequence of contractions. A cluster is a subset of vertices not including the root and without any out-going arc. The sampling algorithm randomizes all arcs independently, and then repeatedly resamples arcs going out from minimal clusters until no cluster is left, at which point the remaining subgraph is guaranteed to be root-connected. This approach is similar to Wilson's "cyclepopping" algorithm [Wil96] for rooted spanning trees, and to the "sink-popping" algorithm [CPP02] for sink-free orientations. Gorodezky and Pak [GP14] have noted that cluster-popping can take exponential time in general, but they conjectured that in bi-directed graphs, the algorithm runs within polynomial-time.
We confirm this conjecture. Let p max be the maximum failure probability of edges (or arcs). Let m be the number of edges (or arcs) and n the number of vertices.
Theorem 1. There is an FPRAS for Reliability (or equivalently, Reachability in bidirected graphs). The expected running time is O ε −2 (1 − p max ) −3 m 2 n 3 for an (1±ε)-approximation. There is also an exact sampler to draw (edge-weighted) connected subgraphs with expected run- We analyze the cluster-popping algorithm [GP14] under the partial rejection sampling framework [GJL17], which is a general approach to sampling from a product distribution conditioned on avoiding a number of "bad" events. Partial rejection sampling is inspired by the Moser-Tardos algorithm for the Lovász Local Lemma [MT10]. It starts with randomizing all variables independently, and then gradually eliminating "bad" events. At every step, we need to find an appropriate set of variables to resample. We call an instance extremal [KS11,She85], if any two bad events are either disjoint or independent. For extremal instances, the resampling set can be simply chosen to be the set of all variables involved in occurring bad events [GJL17], and the algorithm becomes exactly the same as the Moser-Tardos resampling algorithm [MT10]. In particular, all three "popping" algorithms [Wil96,CPP02,GP14] are special cases of partial 1 There are other definitions of "bi-directed graphs" in the literature. Our definition is sometimes also called a symmetric directed graph. rejection sampling for extremal instances. In case of cluster-popping, the bad events are exactly minimal clusters.
The advantage of the partial rejection sampling treatment is that we have an explicit formula for the expected number of resampling events for any extremal instance [KS11,GJL17], which equals to the ratio between the probability of having exactly one bad event and the probability of avoiding all bad events. In order to bound this ratio, we use a combinatorial encoding idea and design a mapping from subgraphs with a unique minimal cluster to root-connected subgraphs. To make this mapping injective, we record an extra vertex and an arc so that we can recover the pre-image. This extra cost is upper-bounded by a polynomial in the size of the graph.
Cluster-popping only draws root-connected subgraphs in the bi-directed setting. In order to sample connected subgraphs in the undirected setting, we provide an alternative proof of the equivalence between Reliability and Reachability in bi-directed graphs, which essentially is a coupling argument. This coupling has a new consequence that, once we have a sample of a root-connected subgraph, it is easy to generate a connected subgraph according to the correct distribution.
In Section 2 we introduce the cluster-popping algorithm and the partial rejection framework. In Section 3 we analyze its running time in bi-directed graphs. For completeness, in Section 4 we include the approximate counting algorithm due to Gorodezky and Pak [GP14]. In Section 5 we give a coupling proof of the equivalence between Reliability and Reachability in bi-directed graphs. In Section 6 we use our sampling algorithm to show how to approximately count the number of connected subgraphs of a fixed size. In Section 7 we conclude by mentioning a few open problems.

Cluster-popping
Let G = (V, A) be a directed 2 graph with root r. The graph G is called root-connected if there is a directed path in G from every non-root vertex to r. Let 0 < p e < 1 be the failure probability of arc e, and define the weight of a subgraph S to be wt(S) := e∈S (1− p e ) e ∈S p e . Then reachability, Z reach (G, r; p), is defined as follows, Here, p = (p e : e ∈ A) denotes the vector of failure probabilities.
Let π G (·) (or π(·) for short) be the distribution resulting from choosing each arc e independently with probability 1 − p e , and conditioning on the resulting graph being root-connected. In other words, the support of π(·) is the collection of all root-connected subgraphs, and the probability of each subgraph S is proportional to its weight wt(S). Then Z reach (G, r; p) is the normalizing factor of the distribution π(·). Gorodezky and Pak [GP14] have shown that approximating Z reach (G, r; p) can be reduced to sampling from π(·) when the graph is bi-directed.
The cluster-popping algorithm of Gorodezky and Pak [GP14], to sample root-connected subgraphs from π(·), can be viewed as a special case of partial rejection sampling [GJL17] for extremal instances. With every arc e of G we associate a random variable that records whether that arc has failed. Bad events are characterized by the following notion of clusters.
We say C is a minimal cluster if C is a cluster and for any proper subset C ′ ⊂ C, C ′ is not a cluster.
If (V, A) contains no cluster, then it is root-connected. For each vertex v, let A out (v) be the set of outgoing arcs from v. We also abuse the notation to write A out (S) = v∈S A out (v) for a subset S ⊂ V of vertices. Notice that A out (S) contains edges between vertices inside S. To "pop" a cluster C, we re-randomize all arcs in A out (C). However, re-randomizing clusters does not yield the desired distribution. We will instead re-randomize minimal clusters.

Claim 3. Any minimal cluster is strongly connected.
Proof. Let C be a minimal cluster, and v ∈ C be an arbitrary vertex in C. We claim that v can reach all vertices of C. If not, let C ′ be the set of reachable vertices of v and C ′ C. Since C ′ does not have any outgoing arcs, C ′ is a cluster. This contradicts to the minimality of C.
Claim 4. If C 1 and C 2 are two distinct minimal clusters, then C 1 ∩ C 2 = ∅.
Proof. By Claim 3, C 1 and C 2 are both strongly connected components. If C 1 ∩ C 2 = ∅, then they must be identical.
For every subset C ⊆ V of vertices, we define a bad event B C , which occurs if C is a minimal cluster. Observe that B C relies only on the status of arcs in A out (C). Thus, if C 1 ∩ C 2 = ∅, then B C 1 and B C 2 are independent, even if some of their vertices are adjacent. By Claim 4, we know that two bad events B C 1 and B C 2 are either independent or disjoint. Thus the aforementioned extremal condition is met. Moreover, it was shown [GJL17, Theorem 8] that if the instance is extremal, then at every step, we only need to resample variables involved in occurring bad events. This leads to the cluster-popping algorithm of Gorodezky and Pak [GP14], which is formally described in Algorithm 1.

Algorithm 1 Cluster Popping
Let S be a subset of arcs by choosing each arc e with probability 1 − p e independently.
while There is a cluster in (V, S). do Let C 1 , . . . , C k be all minimal clusters in (V, S), and The correctness of Algorithm 1 is first shown by Gorodezky and Pak [GP14]. It can also be easily verified using [GJL17, Theorem 8].
An advantage of thinking in the partial rejection sampling framework is that we have a closed form formula for the expected running time of these algorithms on extremal instances. Let Ω k be the collection of subgraphs with k minimal clusters, and Then Z 0 = Z reach (G, r; p), since any subgraph in Ω 0 has no cluster and is thus root-connected.
Theorem 6 ( [GJL17]). Let T be the number of resampled events of the partial rejection sampling algorithm for extremal instances. Then In particular, for Algorithm 1, T is the number of popped clusters.
Theorem 6 can be shown via manipulating generating functions. The less-than-or-equal-to direction of Theorem 6 was shown by Kolipaka and Szegedy [KS11], which is the direction we will need later. The other direction is useful to show running-time lower bounds, but that is not our focus in this paper.

Running time of Algorithm 1 in bi-directed graphs
Gorodezky and Pak [GP14] have given examples of directed graphs in which Algorithm 1 requires exponential time. In the following we focus on bi-directed graphs. A graph G is called bi-directed if u → v is present in G, then v → u is present in G as well, and the failure probabilities are the same for these two arcs. We use Bi-directed Reachability to denote Reachability in bi-directed graphs. For an arc e = u → v, let e := v → u denote its reverse arc. Then in a bi-directed graph, p e = p e . Lemma 7. Let G = (V, A) be a root-connected bi-directed graph with root r. We have that Z 1 ≤ max e∈A pe 1−pe mnZ 0 , where n = |V |, and m = |A|. Proof. We construct an injective mapping ϕ : Ω 1 → Ω 0 × V × A. For each subgraph S ∈ Ω 1 , ϕ(S) is defined by "repairing" S so that no minimal cluster is present. We choose in advance an arbitrary ordering of vertices and arcs. Let C be the unique minimal cluster in S and v be the first vertex in C. Let R denote the set of all vertices which can reach the root r in the subgraph S.
where S fix ∈ Ω 0 is defined next. Figure 1 is an illustration of these objects.
We consider the directed acyclic graph (DAG) of strongly which is the set of edges to be flipped. Notice that S[W ] is different from S flip , namely all arcs that are inside strongly connected components are ignored in S flip . Now we are ready to define S fix . We reverse all arcs in S flip and add the arc u → u ′ to fix the minimal cluster. Formally, let We verify that S fix ∈ Ω 0 . For any x ∈ R, x can still reach r in (V, S fix ) since the path from x to r in (V, S) is not changed. Since u → u ′ ∈ S fix , u can reach u ′ ∈ R and hence r. For any y ∈ W , y can reach u as [u] is the unique sink in H fix [ W ]. For any z ∈ U \ W , z can reach v ∈ W since the path from z to v in (V, S) is not changed.
Next we verify that ϕ is injective. To do so, we show that we can recover S given S fix , u → u ′ , and v. First remove u → u ′ from S fix . The set of vertices which can reach r in (V, S fix \{u → u ′ }) r u ′ u v R U Figure 2. An example of S flip (red arcs) in the subgraph (V, S). Dashed arcs are to be added to S fix . The underlying graph has more arcs than are drawn here.
is exactly R in (V, S). Namely we can recover U and R. As a consequence, we can recover all arcs in S that are incident with R, as these arcs are not changed.
What is left to do is to recover arcs in S[U ]. To do so, we need to find out which arcs have been flipped. We claim that H fix is acyclic. Suppose there is a cycle in H fix . Since H is acyclic, the cycle must involve flipped arcs and thus vertices in W . To summarize, given S fix , u → u ′ , and v, we may uniquely recover S. Hence the mapping ϕ is injective. Moreover, flipping arcs does not change the weight as p e = p e , and only adding the arc u → u ′ would. We have that wt(S fix ) = 1−p u→u ′ p u→u ′ wt(S). The lemma follows.
We remark that an alternative way of repairing S in the proof above is to reverse all arcs in S[W ] without defining S flip . The key point is that doing so leaves the strongly connected components intact. However this makes the argument less intuitive.
Let p max = max e∈A p e . Combining Theorem 6 and Lemma 7, we have the following theorem. Notice that for each popping, we resample only a subset of arcs.

Approximate counting
We include the approximate counting algorithm of Gorodezky and Pak [GP14] for completeness. Let G = (V, A) be an instance of Bi-directed Reachability with root r and parameters p. We construct a sequence of graphs G 0 , .., G n−1 where n = |V | and G 0 = G. Given G i−1 , choose two arbitrary adjacent vertices u i and v i , remove all arcs between u i and v i (in either direction), and identify u i and v i to get G i = (V i , A i ). Namely we contract all arcs between u i and v i , but parallel arcs in the resulting graph are preserved. If one of u i and v i is r, the new vertex is labelled r. Thus G n−1 = ({r}, ∅). Since A i is always a subset of A, we denote by p i the parameters p restricted to A i . For i = 1, . . . , n − 1, define a random variable R i as follows: where S i−1 ⊂ A i−1 is a random root-connected subgraph drawn from the distribution π G i (·), together with all arcs e between u i and v i added independently with probability 1 − p e . It is easy to see that Let p max = max e∈A p e and s = ⌈5(1 − p max ) −2 (n − 1)ε −2 ⌉ where s is the desired precision. We estimate E R i by the empirical mean of s independent samples of Z i , denoted by R i , and let Z = n−1 i=1 R i and Z = Z reach (G, r; p). Gorodezky and Pak [GP14] showed the following.
In order to sample Z i , we use Algorithm 1 to draw independent samples of root-connected subgraphs. Theorem 8 implies that each sample takes at most pmax 1−pmax m 2 n time in expectation. We need O n ε 2 (1−pmax) 2 samples for each Z i . Putting everything together, we obtain the following theorem.
A natural question is what if 1 − p max is close to 0. We can answer this in the case of uniform failure probabilities, i.e., when p e = p for all e ∈ A. Let p * = 1 − 1/(3m). If p ≤ p * then run Algorithm 1 as usual, to produce a sample in time O(m 3 n). Otherwise, run the algorithm with modified weights p e = p * for all e ∈ A, and let the output be S, so that (V, S) is a root-connected subgraph. Suppose n − 1 ≤ k < m. Note that any root-connected subgraph with k edges can be augmented to one with k + 1 edges in at most m ways. Also, any root-connected subgraph with k + 1 edges can be obtained by augmentation from at least one with k edges. Thus, It follows that Pr(|S| = n − 1) ≥ 1 2 , i.e., there is a significant probability of observing an arborescence or directed tree. Of course, the output distribution is not quite the one we want, but we can deal issue with that by (usual) rejection sampling: simply retain S with probability , and otherwise run Algorithm 1 again to produce a fresh sample. Note that the rejection probability is at most 1 2 , so the expected overall running time is still O(m 3 n). This deals with exact sampling. Since the number of arborescences can be computed exactly in polynomial time, an FPRAS for the case p > p * follows easily. It is not clear whether this method can be adapted to varying failure probabilities p.

Coupling between reliability and bi-directed reachability
In this section, we give an alternative proof of Ball's equivalence between Reliability and Bi-directed Reachability [Bal80, Corollary 1]. Our proof constructs a coupling, between the (edge-weighted) distribution of connected subgraphs in the undirected setting, and the (edgeweighted) distribution of root-connected subgraphs in the bi-directed setting. This coupling, together with Algorithm 1, yields an efficient exact sampler for connected subgraphs.
We use {u, v} to denote an undirected edge, and (u, v) or (v, u) to denote a directed one (namely an arc). Let G = (V, E) be an undirected graph, and p = (p e ) e∈E be a vector of failure probabilities. Let − → G = (V, A) be the bi-directed graph obtained by replacing every edge in G with a pair of anti-parallel arcs. Namely, Consider the following coupling between the product distribution over edges of G and the one over arcs of − → G . We reveal edges in a breadth-first search (BFS) fashion in both graphs, from the same "root" vertex r. If an edge {u, v} is present in the subgraph of G, we couple it with the arc (u, v) or (v, u), whose direction is pointing towards r in the subgraph of − → G . The arc in the other direction is drawn independently from everything else. The key observation is that to decide the set of vertices that can reach r, at any point, only one direction of a bi-directed edge is useful and the other is irrelevant. One can verify that in the end, the subgraph of G is connected if and only if the subgraph of − → G is root-connected. We will formalize this intuition next.
Fix an arbitrary ordering of V , which will be used for the exploration, and let the first vertex be a distinguished root r. Let P(S) denote the power set of S for a set S. Define a mapping Φ : P(E) → P(A) as follows. For S ⊆ E, we explore all vertices that can reach r in (V, S) in a deterministic order, and add arcs to Φ(S) in the direction towards r. To be more specific, we maintain the set of explored and the set of active vertices, denoted by V e and V a , respectively. At the beginning, V e = ∅ and V a = {r}. Given V e and V a , let v be the first vertex (according to the predetermined ordering) in V a . For all u ∈ V \ V e , if {u, v} ∈ S, add (u, v) to Φ(S) and add u to V a (u may be in V a already). Then move v from V a to V e . This process ends when all vertices that can reach r in (V, S) are explored. Let σ S be the arriving order of V e . We will call σ S the traversal order. We remark that if {u, v} ∈ S then exactly one of the arcs (u, v) and (v, u) is in Φ(S), and otherwise neither arc is in Φ(S).
Strictly speaking, the exploration above is not a BFS (V a may contain a newly added vertex that is lower in the predetermined ordering than all other older vertices). To perform a BFS we need to in addition maintain a layer ordering, which seems unnecessary. The key properties of the exploration are: 1) all edges incident to the current vertex are processed together, as a group; 2) V e is always connected (or root-connected for Ψ below).
Similarly, define Ψ : P(A) → P(E) as follows. For S ′ ⊆ A, we again maintain V e and V a , and initialize V e = ∅ and V a = {r}. Given V e and V a , let v be the first vertex in V a . For all u ∈ V \ V e , if (u, v) ∈ S ′ , add {u, v} to Ψ(S ′ ) and add u to V a . Then move v from V a to V e . This process ends when all vertices that can reach r in (V, S ′ ) are explored. Analogously, let σ S ′ be the arriving order of V e . We remark that if (u, v) ∈ S ′ , and v is visited before u, then {u, v} ∈ Ψ(S ′ ), even in case of (v, u) ∈ S ′ .
(1) It is easy to verify that, at any point of the construction of Φ, all vertices in V e can reach r, in both (V, S) and (V, Φ(S)). If S ∈ Ω, then V e = V at the end of Φ. Hence (V, Φ(S)) is root-connected, and Φ(S) ∈ − → Ω .
The claim together with (1) implies that Proof. First notice that The lemma follows.
Lemma 12 is first shown by Ball [Bal80, Corollary 2] via modifying edges one by one. Instead, our proof is essentially a coupling argument and has a new consequence that Algorithm 1 can be used to sample edge-weighted connected subgraphs. Recall our notation π G (·), and generalise it to undirected graphs. Thus, for an undirected (or directed) graph G, π G (·) is the distribution resulting from drawing each edge (or arc) e independently with probability 1 − p e , and conditioning on the graph drawn being connected (or root-connected).
There is also a coupling going the reversed direction of Lemma 13, by drawing a random connected subgraph S from π G (·), mapping it to Φ(S), and excluding all arcs in Φ c (S). All other arcs are drawn independently. The resulting S ′ has distribution π− → G (·). Its correctness is not hard to prove, given Lemma 11, but it is not the direction of use to us and we omit its proof.
Theorem 10 and Lemma 12 imply the counting part of Theorem 1. Theorem 8 and Lemma 13 imply the sampling part of Theorem 1.

Counting connected subgraphs of a specified cardinality
In this section, we show that the sampling algorithm in Theorem 1 also leads to an FPRAS for the number of connected subgraphs of any fixed size.
For a connected (undirected) graph G = (V, E), as usual let n = |V | and m = |E|. For n − 1 ≤ t ≤ m, let H t ⊂ E be the set of connected (and spanning) subgraphs of size t, and N t = |H t |. Notice that N m = 1, and N n−1 is the number of spanning trees, which can be computed in polynomial time exactly due to Kirchhoff's matrix-tree theorem.
The complements of connected subgraphs are independent sets of the co-graphic matroid associated with G, and co-graphic matroids are representable [Oxl92]. Hence, by a breakthrough result of Huh and Katz [HK12] (see also [Len13] for a detailed derivation), (N t ) t is a log-concave sequence.
Proposition 14. For any n ≤ t ≤ m − 1, We remark that log-concavity of such a sequence has now been established for all matroids [AHK18], but here we only need the case of representable matroids.
Once we have the log-concavity and the sampling algorithm in Theorem 1, we can apply a technique of Jerrum and Sinclair [JS89, Section 5] to efficiently approximate N t for any n − 1 ≤ t ≤ m.
Theorem 15. For any n − 1 ≤ t ≤ m, there is an FPRAS for N t .
Here we sketch the outline of the algorithm. We will only consider a uniform failure probability p over all edges in the following. Also, we make no attempt to optimise the exponent in the polynomial running time. The basic idea is to tune p in the sampler of Theorem 1 so that connected subgraphs of the desired size show up frequently enough. First notice that Proposition 14 implies that the ratios N t−1 Nt is monotonically increasing. It is straightforward to see that We will use r = 1−p p to denote the edge weight when the failure probability of an edge is p. With a little abuse of notation, let π r (·) be the distribution over connected subgraphs when each edge is removed with probability p = 1 1+r independently. (So π r (·) is a product distribution on the edges, conditioned on the result being connected.) It is easy to see that for a connected subgraph R ⊂ E, π r (R) ∝ r |R| . We note that π rt (H t−1 ) = π rt (H t ), and for any i < t, where we used (2). Similarly, for any i > t, π rt (H t ) ≥ π rt (H i ). Note that m i=n−1 π rt (H i ) = 1. We conclude that π rt (H t−1 ) = π rt (H t ) ≥ 1 m .
Thus, if we run the sampling algorithm of Theorem 1 with p t = 1 1+rt , there is a significant probability to see subgraphs in H t .
To utilise the argument above, we need to know r t . This can be done inductively, since where we used (2) and (3). Rewrite N t as and our estimator of N t will be the product of estimators for r i where i ∈ [t + 1, m]. A complete description is given in Algorithm 2. We should set T to be a sufficiently large number (but still polynomial in n) so that the variances of the estimators are small enough. Notice that N m−1 is easy to compute since it is just the number of edges in G that are not bridges. The analysis of Algorithm 2 is identical to the proof of [JS89, Theorem 5.3] and thus omitted. Theorem 15 is a direct consequence of Algorithm 2.

Concluding remarks
In this paper we give an FPRAS for Reliability (or, equivalently, Bi-directed Reachability), by confirming a conjecture of Gorodezky and Pak [GP14]. We also give an exact sampler for edge-weighted connected subgraphs with polynomial running time in expectation. The core ingredient of our algorithms is the cluster-popping algorithm to sample root-connected subgraphs, namely Algorithm 1. We manage to analyze it using the partial rejection sampling framework.
Reliability is equivalent to counting weighted connected subgraphs, which is the evaluation of the Tutte polynomial T G (x, y) for points x = 1 and y > 1. An interesting question is about the dual of this half-line, namely for points x > 1 and y = 1, whose evaluation is to count weighted acyclic subgraphs. It is well known that for a planar graph G, T G (x, 1) = T G * (1, x) where G * is the planar dual of G [Oxl92]. Hence, Theorem 1 implies that in planar graphs, T G (x, 1) can be efficiently approximated for x > 1. Can we remove the restriction of planar graphs?
Another interesting direction is to generalize Algorithm 1 beyond bi-directed graphs. What about Eulerian graphs? Is approximating Reachability NP-hard in general?