Randomized Algorithms and Randomized Rounding - PowerPoint PPT Presentation

1 / 31
About This Presentation
Title:

Randomized Algorithms and Randomized Rounding

Description:

Let say the sets picked have an expected total cost of at most clog(n) LP. ... The claim follows by substituting E[X]=clog(n)LP and t=4clog(n)LP. Wrap Up ... – PowerPoint PPT presentation

Number of Views:95
Avg rating:3.0/5.0
Slides: 32
Provided by: CSE
Category:

less

Transcript and Presenter's Notes

Title: Randomized Algorithms and Randomized Rounding


1
Randomized Algorithms and Randomized Rounding
G
0.3
0.6
0.2
0.7
0.4
n2 leaves
  • Lecture 21 April 13

2
Minimum Cut
A cut is a set of edges whose removal disconnects
the graph.
Minimum cut Given an undirected multigraph G
with n vertices, find a cut of minimum
cardinality (a min-cut).
This problem can be solved in polynomial by the
max-flow algorithm.
However, using randomness, we can design a really
simple algorithm.
3
Edge Contraction
5
5
1
4
4
3
3
2
1,2
Contraction of an edge e (u,v) Merge u and v
into a single vertex uv.
For any edge (w,u) or (w,v), this edge becomes
(w,uv) in the resulting graph.
Delete any edge which becomes a self-loop, i.e.
an edge of the form (v,v).
4
Edge Contraction
5
5
1
4
4
3
3
2
1,2
Observation an edge contraction would not
decrease the min-cut size.
This is because every cut in the graph at any
intermediate stage is a cut in the original
graph.
5
A Randomized Algorithm
Running time Each iteration takes O(n)
time. Each iteration has one fewer vertices. So,
there are at most n iteration. Total running time
O(n2).
  • Algorithm Contract
  • Input A multigraph G(V,E)
  • Output A cut C
  • H lt- G.
  • while H has more than 2 vertices do
  • 2.1 choose an edge (x,y) uniformly at random
    from the edges in H.
  • 2.2 H lt- H/(x,y). (contract the edge (x,y))
  • 3. C lt- the set of vertices corresponding to one
    of the two meta-vertices in H.

6
Analysis
Obviously, this algorithm will not always
work. How should we analyze the success
probability?
Let C be a minimum cut, and E(C) be the edges
crossing C.
Claim 1 C is produced as output if and only if
none of the edges in E(C) is
contracted by the algorithm.
So, we want to estimate the probability that an
edge in E(C) is picked.
What is this probability?
7
Analysis
Let k be the number of edges in E(C).
How many edges are there in the initial graph?
Claim 2 The graph has at least nk/2 edges.
Because each vertex has degree at least k.
So, the probability that an edge in E(C) is
picked at the first iteration is at most 2/n.
8
Analysis
In the i-th iteration, there are n-i1 vertices
in the graph.
Observation an edge contraction would not
decrease the min-cut size.
So the min-cut still has at least k edges.
Hence there are at least (n-i1)k/2 edges in the
i-th iteration.
The probability that an edge in E(C) is picked is
at most 2/(n-i1).
9
Analysis
So, the probability that a particular min-cut is
output by Algorithm Contract with probability at
least ?(n-2).
10
Boosting the Probability
To boost the probability, we repeat the algorithm
for n2log(n) times.
What is the probability that it still fails to
find a min-cut?
So, high probability to find a min-cut in
O(n4log(n)) time.
11
Ideas to an Improved Algorithm
Key The probability that an edge in E(C) is
picked is at most 2/(n-i1).
Observation at early iterations, it is not very
likely that the algorithm fails.
Idea share the random choices at the beginning!
In the previous algorithm, we boost the
probability by running the Algorithm Contract
(from scratch) independently many times.
G
n contractions
n2 leaves
12
Ideas to an Improved Algorithm
Idea share the random choices at the beginning!
G
G
n/2 contractions
n contractions
n/4 contractions

n/8 contractions
n2 leaves
n2 leaves
Previous algorithm.
New algorithm.
log(n) levels
13
A Fast Randomized Algorithm
  • Algorithm FastCut
  • Input A multigraph G(V,E)
  • Output A cut C
  • n lt- V.
  • if n lt 6, then compute min-cut by brute-force
    enumeration else
  • 2.1 t lt- (1 n/v2).
  • 2.2 Using Algorithm Contract, perform two
    independent contraction sequences to obtain
    graphs H1 and H2 each with t vertices.
  • 2.3 Recursively compute min-cuts in each of H1
    and H2.
  • 2.4 return the smaller of the two min-cuts.

14
A Surprise
Theorem 1 Algorithm Fastcut runs in O(n2 log(n))
time.
Theorem 2 Algorithm Fastcut succeeds with
probability ?(1/log(n)).
By a similar boosting argument, repeating Fastcut
for log2(n) times would succeed with high
probability.
Total running time O(n2 log3(n))! It is much
faster than the best known deterministic
algorithm, which has running time O(n3).
Min-cut is faster than Max-Flow!
15
Complexity
Theorem 1 Algorithm Fastcut runs in O(n2 log(n))
time.
Formal Proof Let T(n) be the running time of
Fastcut when given an n-vertex graph.
And the solution to this recurrence is
Q.E.D.
16
Complexity
G
n/2 contractions
n/4 contractions
log(n) levels
n/8 contractions
n2 leaves
First level complexity 2 x (n2/2) n2.
Second level complexity 4 x (n2/4) n2.
Total time n2 log(n).
The i-th level complexity 2i x (n2/2i) n2.
17
Analysis
Theorem 2 Algorithm Fastcut succeeds with
probability ?(1/log(n)).
G
n/2 contractions
n/4 contractions
log(n) levels
n/8 contractions
n2 leaves
Claim for each branch, the survive probability
is at least ½.
18
Analysis
Claim for each branch, the survive probability
is at least ½.
19
Analysis
Theorem 2 Algorithm Fastcut succeeds with
probability ?(1/log(n)).
Proof Let k denote the depth of recursion, and
p(k) be a lower bound on the success probability.
For convenience, set it to be equality
20
Analysis
Theorem 2 Algorithm Fastcut succeeds with
probability ?(1/log(n)).
We want to prove that p(k) ?(1/k), and then
substituting klog(n) would do.
It is more convenient to replace p(k) by q(k)
4/p(k)-1, and we have
A simple inductive argument now establishes that
So q(k) O(k)
where
21
Remarks
Fastcut is fast, simple and cute.
Just for fun A randomized algorithm for minimum
k-cut with running time O(nf(k))?
Open question 1 A deterministic algorithm for
min-cut with running time close to O(n2)?
Open question 2 A randomized algorithm for
min-cut with running time close to O(m)?
Open question 3 Is minimum cut really easier
than maximum flow?
22
Set Cover
Set cover problem Given a ground set U of n
elements, a collection of subsets of U, S
S1,S2,,Sk, where each subset has a cost c(Si),
find a minimum cost subcollection of S that
covers all elements of U.
Vertex cover is a special case, why?
A convenient interpretation
sets
elements
Choose a min-cost set of white vertices to
cover all black vertices.
23
Linear Programming Relaxation
for each element e.
for each subset S.
How to round the fractional solutions?
Idea View the fractional values as
probabilities, and do it randomly!
24
Algorithm
First solve the linear program to obtain the
fractional values x.
Then flip a (biased) coin for each set with
probability x(S) being head.
0.3
0.6
0.2
0.7
0.4
sets
elements
Add all the head vertices to the set cover.
Repeat log(n) rounds.
25
Performance
Theorem The randomized rounding gives an
O(log(n))-approximation.
Claim 1 The sets picked in each round have an
expected cost of at most LP.
Claim 2 Each element is covered with high
probability after O(log(n)) rounds.
So, after O(log(n)) rounds, the expected total
cost is at most O(log(n)) LP, and every element
is covered with high probability, and hence the
theorem.
Remark It is NP-hard to have a better than
O(log(n))-approximation!
26
Cost
Claim 1 The sets picked in each round have an
expected cost of at most LP.
Q.E.D.
27
Feasibility
Claim 2 Each element is covered with high
probability after O(log(n)) rounds.
First consider the probability that an element e
is covered after one round.
Let say e is covered by S1, , Sk which have
values x1, , xk.
By the linear program, x1 x2 xk gt 1.
Pre is not covered in one round (1 x1)(1
x2)(1 xk).
This is maximized when x1x2xk1/k, why?
Pre is not covered in one round lt (1 1/k)k
28
Feasibility
Claim 2 Each element is covered with high
probability after O(log(n)) rounds.
First consider the probability that an element e
is covered after one round.
Pre is not covered in one round lt (1 1/k)k
So,
What about after O(log(n)) rounds?
29
Feasibility
Claim 2 Each element is covered with high
probability after O(log(n)) rounds.
So,
So,
30
Remark
Let say the sets picked have an expected total
cost of at most clog(n) LP.
Claim The total cost is greater than 4clog(n) LP
with probability at most ¼.
This follows from the Markov inequality, which
says that
Proof of Markov inequality
The claim follows by substituting EXclog(n)LP
and t4clog(n)LP
31
Wrap Up
Theorem The randomized rounding gives an
O(log(n))-approximation.
This is the only known rounding method for set
cover.
Randomized rounding has many other applications.
Write a Comment
User Comments (0)
About PowerShow.com