Lecture 21 - Randomized Algorithms Flashcards
Why do we use randomized algorithms?
Can lead to simplest, fastest, or only known algorithm for a particular problem.
Define the Global Min Cut problem in words.
Given a connected, undirected graph G=(V,E), find a cut with minimum cardinality.
Explain the Network solution to Gobal Min Cut.
- Replace every edge (u,v) with 2 antiparallel edges (u,v) & (v,u)
- Pick some vertex s, and compute min s-v cut for each other vertex v.
True or False:
Global min-cut is harder that min s-t cut.
False
Explain the Contraction algorithm.
・Pick an edge e = (u, v) uniformly at random.
・Contract edge e.
- replace u and v by single new super-node w
- preserve edges, updating endpoints of u and v to w
- keep parallel edges, but delete self-loops
・Repeat until graph has just two nodes v1 and v1.
・Return the cut (all nodes that were contracted to form v1)
Does the contraction algorithm always return the optimal solution?
No.
Prove:
The contraction algorithm returns a min cut with prob ≥ 2 / n^2.
Consider a global min-cut (A, B) of G.
・Let F* be edges with one endpoint in A* and other in B.
・Let k = |F| = size of min cut
・in first step, algorithm contract an edge in F* with probability k/ |E|
・Every node has degree >= k since otherwise (A,B) would not be a min-cut => |E| >= 1/2 k n <=> k/ |E| <= 2/n
・Thus, algorithm contracts an edge in F with probability <= 2/n.
ITERATE
・Let G’ be graph after j iterations. There are n’ = n – j supernodes.
・Suppose no edge in F* has been contracted. The min-cut in G’ is still k.
・Since value of min-cut is k, | E’ | ≥ ½ k n’.
・Thus, algorithm contracts an edge in F* with probability ≤ 2 / n’.
・Let Ej = event that an edge in F* is not contracted in iteration j
Pr[E1 ∩E2 … ∩ En−2 ] = Pr[E1] × Pr[E2 | E1] × … × Pr[En−2 | E1∩ E2…∩ En−3]
≥ ( 1 - 2/n) (1-2/(n-1)) … (1-2/4) ( 1-2/3)
= 2/n(n-1)
≥ 2/n^2
In the contraction algorithm, why does every node have a degree >= k? (VERY IMPORTANT)
If one node had less than k degrees, we could put that node in one partition vs every other node, and that cut would be the new min-cut.
What’s the probability of the algorithm failing after n^2ln*n times?
<= 1/n^2
Define the maximum 3-satisfiability problem.
Given a 3-SAT formula, find a truth assignment that satisfies as many clauses as possible.
ex:
C1 = x2 or not(x3) or not(x4) etc..
Prove:
Given a 3-SAT formula with k clauses, the expected number of clauses satisfied by a random assignment is 7k / 8.
Consider random variable
Zj = 1 if clause Cj is satisfied
0 otherwise
Let Z = weight of clauses satisfied by assignment Zj
E[Z] = sum(j=1->k) E[Zj]
= sum(j=1->k) Pr [ Clause Cj is satisfied]
= 7/8k
Prove: For any instance of 3-SAT, there exists a truth assignment that satisfies at least a 7/8 fraction of all clauses.
Random variable is at least its expectation some of the time.
Prove: The probability that a random assignment satisfies ≥ 7k / 8 clauses is at least 1 / (8k).
Pf. Let pj be probability that exactly j clauses are satisfied;
let p be probability that ≥ 7k / 8 clauses are satisfied.
see slide (17)
Rearranging terms yields p ≥ 1 / (8k). ▪
What’s the Johnson’s algorithm?
Repeatedly generate random truth assignments until one of them satisfies ≥ 7k / 8 clauses.
Prove the following: Johnson’s algorithm is a 7/8-approximation algorithm
By previous lemma, each iteration succeeds with probability ≥ 1 / (8k).
By the waiting-time bound, the expected number of trials to find the satisfying assignment is at most 8k. ▪