Randomized and Approximation Algorithms - Slides | CSE 591, Study notes of Computer Science

Material Type: Notes; Class: Introduction to Image Processing and Analysis; Subject: Computer Science and Engineering; University: Arizona State University - Tempe; Term: Fall 2008;

Typology: Study notes

Pre 2010

Uploaded on 09/02/2009

koofers-user-6fn
koofers-user-6fn 🇺🇸

10 documents

1 / 25

Toggle sidebar

This page cannot be seen from the preview

Don't miss anything!

bg1
CSE 591 Randomized and Approximation
Algorithms
Goran Konjevod
Department of Computer Science and Engineering
Arizona State University
ASU, Fall 2008
pf3
pf4
pf5
pf8
pf9
pfa
pfd
pfe
pff
pf12
pf13
pf14
pf15
pf16
pf17
pf18
pf19

Partial preview of the text

Download Randomized and Approximation Algorithms - Slides | CSE 591 and more Study notes Computer Science in PDF only on Docsity!

CSE 591 Randomized and Approximation

Algorithms

Goran Konjevod

Department of Computer Science and Engineering Arizona State University

ASU, Fall 2008

Logistics 1

Instructor: Goran Konjevod, BY450, [email protected] Office Hours: TTh 13:30–15: TA: Melih Onus, [email protected] Office Hours: TBA

Randomization

Leaving decisions to chance. Randomized algorithm: allowed to invoke a random event and use the outcome to determine the next step. Basic random events: (^1) Basic: generate a random bit (^2) Complex: generate a random number (int/float) (^3) Complex: generate a random object of some general type

Uses of randomization

Randomization may make complicated algorithms simpler make inefficient computations efficient (quicksort, mincut) make possible things we don’t know how to do deterministically (primality testing in P, matching in parallel) make possible things that are provably impossible to do deterministically (volume computation, distributed protocols)

Randomized quicksort analysis

Let s 1 ≤ s 2 ≤... ≤ sn be the set S in order. Let Xij =

1 si is compared to sj 0 si is not compared to sj Number of comparisons made is Tn =

∑n i=

j>i Xij^.

Digression: discrete probability (1)

Sample space: set Ω of all possible outcomes (quicksort: the set of all possible runs of the algorithm on input S) Events: subsets of Ω (example: let x be an element of S. The set Ax of all possible runs where the first element selected is x) Probability of an event (Pr[Ax ] = 1/n). Random variable: mapping from Ω to real numbers (Xij ). Expectation of a random variable: its “average value”,

E[X ] =

ω∈Ω

Pr[ω] · X (ω)

(E[Xij ] = Pr[Xij = 1] · 1 + Pr[Xij = 0] · 0 = Pr[Xij = 1]).

Randomized quicksort analysis

Xij = 1 if and only if si and sj are compared. When are si and sj compared? Exactly if either si or sj is selected before any of the elements si , si+1,... , sj− 1 , sj. The probability of this happening is 2/(j − i + 1).

Randomized quicksort analysis

E[Tn] =

∑^ n

i=

j>i

Pr[Xij = 1] =

∑^ n

i=

j>i

j − i + 1

∑^ n

i=

n−∑i+

k=

k

∑^ n

i=

∑^ n

k=

k

≤ 2 nHn = O(n ln n).

Minimum cut problem

Input: (multi)graph G = (V , E ). Output: a cut of minimum cardinality in G. Polynomially solvable, O(n^3 ) time (but not simple). Need n minimum st-cuts or the Stoer-Wagner algorithm.

Simple randomized algorithm for mincut

(^1) Pick an edge e uniformly at random. (^2) Contract e. (^3) Repeat until there are only two vertices left.

Randomized mincut analysis (2)

Let k be the minimum cut cardinality. Let C be a minimum cut. G has at least kn/2 edges. For i = 1,... , n − 2, let Ai be the event that no edge of C was contracted in the i-th step. If all of the events A 1 ,... An− 2 happen, then the algorithm finds the minimum cut C.

Randomized mincut analysis (3)

Pr[A 1 ] ≥ 1 −

n

n − 2 n

If A 1 happens, then before the second step of the algorithm there are at least k(n − 1)/2 edges in the graph.

Pr[A 2 | A 1 ] ≥ 1 −

n − 1

n − 3 n − 1

In general, if A 1 ,... , Ai− 1 happen, then before the i-th step there are at least k(n − i + 1)/2 edges in the graph and so

Pr[Ai | A 1 , A 2 ,... Ai− 1 ] ≥ 1 −

n − i + 1

n − i − 1 n − i + 1

Digression: discrete probability (3)

Two events A and B are independent, if

Pr[A ∩ B] = Pr[A] Pr[B].

The conditional probability of A given B is defined by

Pr[A | B] =

Pr[A ∩ B] Pr[B]

For any two events A, B, we have

Pr[A ∩ B] = Pr[A | B] · Pr[B].

In general,

Pr[A 1 ∩A 2 ∩· · ·∩Ak ] = Pr[Ak | A 1 ∩· · ·∩Ak− 1 ] · · · Pr[A 2 | A 1 ]·Pr[A 1 ].

Randomized mincut analysis (5)

The probability that no edge of C is contracted is

Pr[A 1 ∩ A 2 ∩ · · · ∩ An− 2 ] ≥ n − 2 n

n − 3 n − 1

n − 4 n − 2

n(n − 1)