50
Randomized Algorithms CS648 Lecture 17 Miscellaneous applications of Backward analysis 1

Lecture 17-cs648

Embed Size (px)

Citation preview

Page 1: Lecture 17-cs648

Randomized AlgorithmsCS648

Lecture 17

Miscellaneous applications of Backward analysis

1

Page 2: Lecture 17-cs648

MINIMUM SPANNING TREE

2

Page 3: Lecture 17-cs648

Minimum spanning tree

3

b

ac

d

h x

y

u

v

18

7

1

19

22

10

312

3

15

11

5

16

17

13

4 2

9

6

Page 4: Lecture 17-cs648

Minimum spanning tree

Algorithms:

• Prim’s algorithm

• Kruskal’s algorithm

• Boruvka’s algorithm

4

b

ac

d

h x

y

u

v

18

7

1

19

22

10

312

3

15

11

5

16

17

13

4 2

9

6

Less known but it is the first algorithm for MST

Page 5: Lecture 17-cs648

Minimum spanning tree

5

Page 6: Lecture 17-cs648

Minimum spanning tree

6

Page 7: Lecture 17-cs648

Minimum spanning tree

7

Page 8: Lecture 17-cs648

Minimum spanning tree

8

Page 9: Lecture 17-cs648

Light Edge

9

b

ac

d

h x

y

u

v

18

7

1

19

22

10

312

3

15

11

5

16

17

13

4 2

9

6 31

Page 10: Lecture 17-cs648

USING BACKWARD ANALYSIS FORMISCELLANEOUS APPLICATIONS

10

Page 11: Lecture 17-cs648

PROBLEM 1SMALLEST ENCLOSING CIRCLE

11

Page 12: Lecture 17-cs648

Smallest Enclosing Circle

12

Page 13: Lecture 17-cs648

Smallest Enclosing Circle

13

Page 14: Lecture 17-cs648

PROBLEM 2SMALLEST LENGTH INTERVAL

14

Page 15: Lecture 17-cs648

0 1

Sampling points from a unit interval

Page 16: Lecture 17-cs648

PROBLEM 3MINIMUM SPANNING TREE

16

Page 17: Lecture 17-cs648

Light Edge

17

b

ac

d

h x

y

u

v

18

7

1

19

22

10

312

3

15

11

5

16

17

13

4 2

9

6 31

Page 18: Lecture 17-cs648

USING BACKWARD ANALYSIS FORTHE 3 PROBLEMS :

A GENERAL FRAMEWORK

18

Page 19: Lecture 17-cs648

A General framework

19

Page 20: Lecture 17-cs648

PROBLEM 3MINIMUM SPANNING TREE

20

Page 21: Lecture 17-cs648

A BETTER UNDERSTANDING OF LIGHT EDGES

21

Page 22: Lecture 17-cs648

Minimum spanning tree

22

b

ac

d

h x

y

u

v

18

7

1

19

22

10

342

3

15

11

5

16

17

13

4 2

19

6

x

b

ac

d

h

y

u

v

181

19

22

10 15

11

5

16

4

31

31

Random sampling

Page 23: Lecture 17-cs648

Minimum spanning tree

23

b

ac

d

h x

y

u

v

18

7

1

19

22

10

342

3

15

11

5

16

17

13

4 2

19

6

x

b

ac

d

h

y

u

v

1

19

10 15

11

5

16

4

31

18

22

31

Page 24: Lecture 17-cs648

Minimum spanning tree

24

b

ac

d

h x

y

u

v

18

7

1

19

22

10

342

3

15

11

5

16

17

23

4 2

19

6

b

ac

d

h x

y

u

v

1

19

10 15

11

5

16

4

7

342

3

17

23

2

19

6

31

Page 25: Lecture 17-cs648

Minimum spanning tree

25

b

ac

d

h x

y

u

v

18

7

1

19

22

10

342

3

15

11

5

16

17

23

4 2

19

6

b

ac

d

h x

y

u

v

7

1

19

10

342

3

15

11

5

16

17

23

4 2

19

6

31

Light

Page 26: Lecture 17-cs648

First useful insight

26

Page 27: Lecture 17-cs648

Minimum spanning tree

27

b

ac

d

h x

y

u

v

18

7

1

19

22

10

342

3

15

11

5

16

17

23

4 2

19

6

b

ac

d

h x

y

u

v

7

1

19

10

342

3

15

11

5

16

17

23

4 2

19

6

31

Light heavy

Page 28: Lecture 17-cs648

Minimum spanning tree

28

b

ac

d

h x

y

u

v

7

1

3 3

54 2

6

b

ac

d

h x

y

u

v

7

1

19

10

3 3

15

11

5

16

17

4 2

42

23

19

6

Light heavy

Page 29: Lecture 17-cs648

Second useful insight

29

Page 30: Lecture 17-cs648

Light Edge

30

b

ac

d

h x

y

u

v

18

7

1

19

22

10

312

3

15

11

5

16

17

13

4 2

9

6 31

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.

Page 31: Lecture 17-cs648

31

Page 32: Lecture 17-cs648

32Light

Page 33: Lecture 17-cs648

33Light heavy

Page 34: Lecture 17-cs648

34

Page 35: Lecture 17-cs648

Step 1

35

Page 36: Lecture 17-cs648

Step 2

36

Page 37: Lecture 17-cs648

Step 2

37Light heavy

Page 38: Lecture 17-cs648

Step 2

38

Page 39: Lecture 17-cs648

Step 3

Expressing the entire experiment as Randomized Incremental Construction

A 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.

39

Page 40: Lecture 17-cs648

random sample and random permutation

40

Page 41: Lecture 17-cs648

Step 3

41

Page 42: Lecture 17-cs648

Step 3

42

Page 43: Lecture 17-cs648

Step 3

43

Page 44: Lecture 17-cs648

Step 3

44

Page 45: Lecture 17-cs648

45

Forward analysis

Page 46: Lecture 17-cs648

46

Backward analysis

Page 47: Lecture 17-cs648

47

Backward analysis

Use Lemma 2.

Page 48: Lecture 17-cs648

48

Backward analysis

Page 49: Lecture 17-cs648

49

Page 50: Lecture 17-cs648

50