/
Randomized Algorithms Randomized Algorithms

Randomized Algorithms - PowerPoint Presentation

natalia-silvester
natalia-silvester . @natalia-silvester
Follow
429 views
Uploaded On 2016-04-05

Randomized Algorithms - PPT Presentation

CS648 Lecture 17 Miscellaneous applications of Backward analysis 1 Minimum spanning tree 2 Minimum spanning tree 3 b a c d h x y u v 18 7 1 19 22 10 3 12 3 15 11 5 ID: 274407

random mst edges light mst random light edges spanning tree algorithm step minimum edge sample permutation set respect question analysis definition randomized

Share:

Link:

Embed:

Download Presentation from below link

Download Presentation The PPT/PDF document "Randomized Algorithms" is the property of its rightful owner. Permission is granted to download and print the materials on this web site for personal, non-commercial use only, and to display it on your personal computer provided you do not modify the materials and that you retain all copyright notices contained in the materials. By downloading content from our website, you accept the terms of this agreement.


Presentation Transcript

Slide1

Randomized AlgorithmsCS648

Lecture 17Miscellaneous applications of Backward analysis

1Slide2

Minimum spanning tree2Slide3

Minimum spanning tree 3

b

a

c

d

h

x

y

u

v

18

7

1

19

22

10

3

12

3

15

11

5

16

17

13

4

2

9

6Slide4

Minimum spanning tree Algorithms: Prim’s

algorithmKruskal’s algorithmBoruvka’s algorithm4

b

a

c

d

h

x

y

u

v

18

7

1

19

22

10

3

12

3

15

11

5

16

17

13

4

2

9

6

Less known but it is the first algorithm for MSTSlide5

Minimum spanning tree

: undirected graph with weights on edges,

.

Deterministic algorithms

:

Prim’s algorithm

O

((

+

)

log

) using

Binary

heap

O

( +

log ) using

Fibonacci heapBest deterministic algorithm: O(

+

) bound

Too complicated to design and analyzeFails to beat Prim’s algorithm using Binary heap

 

5Slide6

Minimum spanning treeWhen finding an efficient solution of a problem appears hard, one should strive to design an efficient verification algorithm.

MST verification algorithm: [King, 1990]Given a graph and a spanning tree

, it takes

O

(

+

) time to

d

etermine if

is MST of

.

Interestingly, no deterministic algorithm for MST could use this algorithm to achieve

O

(

+

)

time.

 

6Slide7

Minimum spanning tree

: undirected graph with weights on edges,

.

Randomized algorithm

:

Karger

-Klein-

Tarjan

’s

algorithm [

1995

]

Las Vegas algorithm

O

(

+

) expected timeThis algorithm uses Random samplingMST verification algorithm

Boruvka’s algorithmElementary data structure

 

7Slide8

Minimum spanning tree

: undirected graph with weights on edges,

.

Randomized algorithm

:

Karger

-Klein-

Tarjan

’s

algorithm [

1994

]

Las Vegas algorithm

O

(

+

) expected timeRandom sampling :

How close is MST of a random sample of edges to MST of original graph ?

The notion of closeness is formalized in the following slide.

 

8Slide9

Light Edge

Definition: Let . An edge

is said to be

light

with respect to

if

Question

:

If

and |

|=

,

how many edges from

are light with respect to

on expectation ?

Answer

: ??

 

9

b

a

c

d

h

x

y

u

v

18

7

1

19

22

10

3

12

3

15

11

5

16

17

13

4

2

9

6

31

MST

(

)

MST

(

)

 

 Slide10

USING Backward analysis forMiscellaneous Applications10Slide11

problem 1SMALLEST Enclosing circle11Slide12

Smallest Enclosing Circle12Slide13

Smallest Enclosing CircleQuestion: Suppose we sample

points randomly uniformly from a set of points, what is the expected number of points that remain outside the smallest circle enclosing the sample?  

13

For

=

, the answer is

 Slide14

problem 2smallest length interval14Slide15

0

1

Sampling points from a

unit interval

Question:

Suppose we select

points from interval [

0

,

1

], what is expected length of the smallest sub-interval

?

for

, it is ??

for

, it is ?? General solution : ??

This bound can be derived using two methods.One method is based on establishing a relationship between uniform distribution and exponential distribution.

Second method (for nearly same asymptotic bound) using Backward analysis.

 

 

 

 Slide16

problem 3Minimum spanning tree16Slide17

Light Edge

Definition: Let . An edge

is said to be

light

with respect to

if

Question

:

If

and |

|=

,

how many edges from

are light with respect to

on expectation ?

 

17

b

a

c

d

h

x

y

u

v

18

7

1

19

22

10

3

12

3

15

11

5

16

17

13

4

2

9

6

31

MST

(

)

MST

(

)

 Slide18

using Backward analysis forThe 3 problems :A General framework

18Slide19

A General frameworkLet be the desired random variable in any of these problems/random experiment.

Step 1: Define an event related to the random variable . Step 2: Calculate probability of event

using

standard

method

based on

definition

. (This establishes a relationship between )

Step

3:

Express the underlying

random experiment

as a Randomized incremental construction and calculate the probability of the event

using Backward analysis.

Step 4

: Equate the expressions from Steps 1

and 2 to calculate E[

].

 19Slide20

problem 3Minimum spanning tree20Slide21

A Better understanding of light edges21Slide22

Minimum spanning tree 22

b

a

c

d

h

x

y

u

v

18

7

1

19

22

10

3

42

3

15

11

5

16

17

13

4

2

19

6

x

b

a

c

d

h

y

u

v

18

1

19

22

10

15

11

5

16

4

31

31

Random sampling

 

 Slide23

Minimum spanning tree 23

b

a

c

d

h

x

y

u

v

18

7

1

19

22

10

3

42

3

15

11

5

16

17

13

4

2

19

6

x

b

a

c

d

h

y

u

v

1

19

10

15

11

5

16

4

31

18

22

31

MST(

)

 

 

 Slide24

Minimum spanning tree 24

b

a

c

d

h

x

y

u

v

18

7

1

19

22

10

3

42

3

15

11

5

16

17

23

4

2

19

6

b

a

c

d

h

x

y

u

v

1

19

10

15

11

5

16

4

7

3

42

3

17

23

2

19

6

31

MST(

)

 

 

 

 Slide25

Minimum spanning tree 25

b

a

c

d

h

x

y

u

v

18

7

1

19

22

10

3

42

3

15

11

5

16

17

23

4

2

19

6

b

a

c

d

h

x

y

u

v

7

1

19

10

3

42

3

15

11

5

16

17

23

4

2

19

6

31

MST(

)

 

 

 

 

LightSlide26

First useful insight

Lemma1: An edge is light with respect to if and only if

belongs to

MST

(

).

 

26Slide27

Minimum spanning tree 27

b

a

c

d

h

x

y

u

v

18

7

1

19

22

10

3

42

3

15

11

5

16

17

23

4

2

19

6

b

a

c

d

h

x

y

u

v

7

1

19

10

3

42

3

15

11

5

16

17

23

4

2

19

6

31

MST(

)

 

 

 

 

Light

heavySlide28

Minimum spanning tree 28

b

a

c

d

h

x

y

u

v

7

1

3

3

5

4

2

6

b

a

c

d

h

x

y

u

v

7

1

19

10

3

3

15

11

5

16

17

4

2

42

23

19

6

MST(

)

 

 

 

 

Light

heavy

MST(

)

 

Is there any relationship among MST

(

),

MST(

)

and Light edges from

?

 Slide29

Second useful insightLemma2: Let

and be the set of all edges from

that are

light

with respect to

.

Then

MST

(

)

=

MST(

)

This lemma is used in the design of randomized algorithm for MST as follows (just a sketch):

Compute MST of a sample of

edges (recursively). Let it be T’.There will be expected

edges light edges among all unsampled

edges.Recursively compute MST of

T’

edges which are less than

on expectation.

 

29Slide30

Light Edge

Definition: Let . An edge

is said to be

light

with respect to

if

Question

:

If

and |

|=

,

how many edges from

are

light

with respect to

on expectation ?

 

30

b

a

c

d

h

x

y

u

v

18

7

1

19

22

10

3

12

3

15

11

5

16

17

13

4

2

9

6

31

MST

(

)

MST

(

)

 

We shall answer the above question using the Generic framework. But before that, we need to get a better understanding of the corresponding random variable.Slide31

31

 

 

 

MST(

)

 Slide32

32

 

 

 

MST(

)

 

LightSlide33

33

 

 

 

Light

heavy

MST(

)

 Slide34

: random variable for the number of light edges in

when is a random sample of edges.

: set of all subsets of

of size

.

: number of light edges in

when

.

= ??

 

34

 

Can you express

in terms of

and

only ?

 Slide35

Step 1Question: Let

be a uniformly random sample of edges from .What is the prob. that an edge selected randomly from

is a light edge ?

 

35

Two methods to find

 Slide36

Step 2Calculating using definition

 36Slide37

Step 2 Calculating using definition

 37

 

 

 

MST(

)

 

Light

heavy

Light edges

=

 Slide38

Step 2Calculating using definition

: set of all subsets of of size .The probability

is equal to

 

38

 

 Slide39

Step 3Expressing the entire experiment as Randomized Incremental ConstructionA slight difficulty in this process is the following:

The underlying experiment talks about random sample from a set.But RIC involves analyzing a random permutation of a set of elements. Question: What is relation between random sample from a set and a random permutation of the set ?Spend some time on this question before proceeding further.

39Slide40

random sample and random permutation Observation:

is indeed a uniformly random sample of  

40

Random permutation of

 

 

 

 

 Slide41

Step 3The underlying random experiment as Randomized Incremental Construction:

Permute the edges randomly uniformly.Find the probability that th edge is light relative to the first edges.

Question:

Can you now calculate probability

?

Spend some time on this question before proceeding further.

 

41Slide42

Step 3

42

Random permutation of

 

 

 

 

 Slide43

Step 3

: a random variable taking value 1 if is a light

edge with respect to

MST

(

).

 

43

Random permutation of

 

 

 

 

 

 Slide44

Step 3

: a random variable taking value 1 if is a

light

edge with respect to

MST

(

).

Question:

What is relation between

and

’s?

Answer:

??

 

44

Random permutation of

 

 

 

 

 

 

 Slide45

Calculating ).

 

: set of all subsets of

of size

.

) =

depends upon

 

45

Forward analysis

 

 

 

 

MST(

)

 

Random permutation of

 Slide46

Calculating ).

 

: set of all subsets of

of size

.

)=

 

46

Backward analysis

 

 

 

 

Random permutation of

 Slide47

 

= ??

??

 

47

Backward analysis

 

 

 

 

MST(

)

 

 

Random permutation of

 

Use Lemma 2.

 Slide48

Calculating )

 

: set of all subsets of

of size

.

)=

 

48

Backward analysis

 

 

 

 

Random permutation of

 Slide49

Combining the two methods for calculating  

Using method 1:

Using

method

2

:

)

Hence:

 

49Slide50

Theorem: If we sample

edges uniformly randomly from an undirected graph on vertices and edges, the number of light edges among the unsampled edges will be less than

on expectation.

 

50