CSE 525: Randomized Algorithms Spring 2026 Lecture 4: DNF Counting and Unreliability Lecturer: Shayan Oveis Gharan 04/06/2026 Scribe:
Disclaimer: These notes have not been subjected to the usual scrutiny reserved for formal publications.
4.1 Recap from CSE 521: Unbiased Estimators
We say a random variable is an unbiased estimator of if
It turns out the the number of samples is proportional to the relative variance of .
Definition 4.1 (Relative Variance).
Say is an unbiased estimator of , then, the relative variance of is defined as
| (4.1) |
where by is the variance of . We typically use to denote the relative variance.
The following theorem is the main result of this section.
Theorem 4.2.
Given , and an unbiased estimator of , . We can approximate within multiplicative factor using only independent samples of with probability .
Monte Carlo Simulation.
Suppose we want to estimate the size of a set . There is a generic approach called the Monte Carlo simulation. First, we find a univere that has the following two properties:
-
•
We know the size of
-
•
We can efficiently sample from .
We sample an element randomly from and test whether it belongs to . Let be the corresponding indicator random variable. It follows that is an unbiased estimator of with relative variance, . So, we can estimate within a multiplicative factor by generating many samples from .
4.2 FPRAS for DNF Counting
A DNF is conjunction of clauses where each of them is a disjunction of literals, e.g., . Consider a DNF with variables. Obviously the problem of finding a satisfying assignment for a DNF is in P. We want to count the number of satisfying assignment to a DNF. Here we prove the following theorem:
Theorem 4.3 ([KLM89]).
There is an FPRAS for the DNF counting problem.
Following the Monte Carlo sampling method, we can let be the set of satisfying assignments to the given DNF. If is the set of all truth assignments to the variables then it has the desired properties. So, by the discussion in the previous section we would need to generate many samples. So, this would work only if is within a polynomial factor of ; but what if it is exponentially smaller?
The ida of Karp, Luby and Madras [KLM89] is to choose the univese carefully such that is within a polynomial factor of . In fact, they consider a more general problem. Suppose we have sets of a ground set of elements and we want to estimate . First, of all observe that we always have
So, the idea is to construct an artificial universe of size . How can we do that? It is enough that for each ground element , and for every set where put a distinct copy of in :
By definition .
Now suppose we know the sizes of all ’s and we can sample a u.r. element from each efficiently. Then, we claim that is an ideal universe:
-
•
We can compute the size of exactly.
-
•
To sample an element uniformly at random from , we first sample with probability . Then, we sample a uniformly random element from .
Now, let and notice that . So, we need identify some of the elements of with ; in particular, for each element , let be the smallest index such that ; we identify with . So, to run the the Monte Carlo method, we first sample an element from and then we check whether by simply checking wether is the smallest index where contains .
In our DNF counting problem each corresponds to the set of assignments that satisfy the -th clause. Obviously if the -th clause has literals, , and we can sample efficiently from simply by fixing every literal that appears in to be true and choosing rest uniformly at random.
4.3 Network Unreliability
As an application we discuss an algorithm for the network unreliability problem. Given a network of vertices where each edge disappears independently with probability determine the probability that the surviving network is disconnected.
In this lecture for simplicity we assume that all ’s are equal to and we define to denote the failure probability of the whole network. We prove the following theorem of Karger [Kar95]. Also, see [Kar16] for a much faster algorithm.
Theorem 4.4 ([Kar95]).
There is an FPRAS for the network reliability problem. That is given , and the algorithm returns a multiplicative approximation to with probability .
Note that the success probability can be easily boosted up to by running independent copies of the algorithm and returning the median of the estimates.
First, let us discuss how the two problems are related. Suppose our graph have cuts, . Then, we can use the above algorithm to estimate the probability that all of the edges in one of these cuts fail. In particular, we write
where is the indicator (random variable) that edge fails. Then, every realization of failures that makes disconnected correspond to a satisfying assignment for the above DNF formula. So, we can use our FPRAS to get a approximation to the probability that at least one of the cuts fail.
Remark 4.5.
Note that there is a technical problem here, because each edge fails with probability whereas in the proof of Theorem 4.3 we assumed that every variable is true/false with 1/2 probability. We leave this as an exercise.
By the above discussion if has polynomially many cuts then we are already done. The problem is that has exponentially many cuts; i.e., we need to find the union of exponentially many sets. Karger’s idea is as follows: Let denote the size of the minimum cut of . Then, obviously,
| (4.2) |
Now, we consider two cases
Case 1:
In this case, we can simply use Monte Carlo method to obtain a approximation of using only many samples. In other words, we let be the universe of all realizations of .
Case 2:
As it will be clear we need to let be . Here the idea is to divide all cuts of into two groups: (i) Near minimum cuts and (ii) Large cuts. We use the following theorem of Karger to prove that there are only polynomialy many near minimum cut in any graph . So, we can use Theorem 4.3 to estimate the probability that at least one of these cuts fails. To deal with large cuts we also use the following theorem to argue that it is very unlikely that any of the large cuts fails.
Theorem 4.6 (Karger [Kar95]).
For any graph with vertices and with minimum cut , and for any , the number of cuts of size at most in is at most .
The above theorem can be proved by Karger’s contraction algorithm, see 521-Notes. Also, note that the statement of the above theorem is tight, as in a cycle of length there are cuts with edges.
Now, let be a parameter that we fix later. We want to show that with probability at most all cuts of size at least survive.
Lemma 4.7.
Let be all cuts of and let us sort them in the order of their size
For any , and we have
Proof.
Firstly, by Theorem 4.6, for any , we have . In other words,
| (4.3) |
By union bound can write
Say . We can write Therefore,
∎
So, to make sure that all large cuts survive it is enough to choose such that the above probability is at most . Observe that if we choose and making sure that we get , so
So, it is enough to solve the DNF counting problem for smallest cuts. These cuts can be found in polynomial time using Karger’s contraction algorithm.
4.4 Congestion Minimization Problem
A classical technique in the field of approximation algorithms is to write down a linear programming relaxation of a combinatorial problem. The linear program (LP) is then solved in polynomial time, and one rounds the fractional solution to an integral solution that is, hopefully, not too much worse than the optimal solution.
A classical example goes back to Raghavan and Thompson [RT87]. Let be a directed network, and suppose that we are given a sequence of terminal pairs where . The goal is to choose, for every , a directed - path in so as to minimize the maximum congestion of an arc :
This problem is NP-hard. Our goal will be to design an approximation algorithm that outputs a solution so that the congestion of every edge is at most , for as small as possible. The number is called the approximation factor of our algorithm. We will see that for this problem we will be able to achieve .
We start by writing a linear programming relaxation for this problem. Let be the set of (directed) paths from to and let . For every path , we have a variable to denote the amount of flow that we route along .
| (4.4) | |||||
| s.t. | |||||
A few observations are in order:
-
•
. This is simply because the optimum solution is a feasible solution in the above program. Note that the optimum solution satisfies all of the above constraints with the additional property that for all paths .
-
•
Although the above program has exponentially many variable one for every directed path connecting (for all ), its optimum solution can be computed in polynomial time. To do that we need two observations:
-
i)
We can write a linear program to find a flow of value 1 from to . We have a variable to denote the flow of every edge.
Having that, the congestion of due to the flow routed between the -th pair is ; so the total congestion of is .
-
ii)
A (fractional) flow (of value 1) from to can be decomposed into a distribution of paths from to . To see that, given the solution , greedily find a path from to on edges with positive flow; let be . Then, subtract from the flow of all edges along . We will obtain a new flow of value from to . So we repeat this procedure until we get the flow.
-
i)
4.5 Independent Rounding
Given a solution to (4.4), we want to round it to an integral solution. Namely, we want to choose exactly one path from each such that the union of the chosen paths have small congestion, at most .
We follow the independent rounding method. Recall that, by feasiblity of , for every , we know that . So, we can think of as providing a probability distribution over - paths. For every , independently, we choose one of the paths with probability . This procedure, by definition, gives a feasible set of directed paths from to for all . So, it remains to bound the maximum congestion. We prove the following theorem.
Theorem 4.8.
With probability at least the above algorithm produces a integral set of paths connecting all terminals with maximum congest at most
Let be the indicator random variable that is chosen. For an edge , let be the random variable that is the congestion of edge . So,
By linearity of expectations,
So, the expectations are small. We just need to use a Chernoff bound/union bound argument. Unfortunately, the random variables are not independent. So, we need to use a slightly different random variables that are truly independent.
The idea is to note that we always have exactly one path from to . So, let be the indicator random variable that the unique path from to uses edge . So, . It follows that ’s are independent. Let , and note that since . So, by Chernoff bound,
where in the last inequality we simply use that . Now, to get the strong concentration bound we need to choose large enough such that the RHS is at most . It turns out that for that purpose it is enough to let for a large enough constant .
Since, has at most edges, , by union bound
So, the algorithm succeeds with probability at least .
4.6 Future Works and Open Problems
Chuzhoy, Guruswami, Khanna and Talwar showed that min-congestion problem is NP-hard to approximate within any factor better than when the underlying graph is directed. Note that the same algorithm that we discussed here works if the underlying graph is undirected (we can just put two copies of every edge one in every direction). However, for undirected, the result of Raghavan-Thompson is still the best known approximation factor. The best hardness result is by Andrews-Zhang. It is a fundamental open problem in the field of network routing to beat the Raghavan-Thompson’s classical algorithm.