SlideServe
Menu
Préférences
© SlideServe · v2026

Randomized Algorithms CS648

deiondre avatar
20 diapositives · 635 Views · Aug 09, 2014

Randomized Algorithms CS648. Lecture 15 Randomized Incremental Construction (building the background). Partition Theorem. A set of events ,…, defined over a probability space ( , P ) is said to induce a partition of if = = ∅ for all P artition Theorem:. B. Ω.

Randomized Algorithms CS648 - slide 1
01 / 20Randomized Algorithms CS648
1 / 17

Télécharger la présentation

Randomized Algorithms CS648
Une image / un lien ci-dessous est fourni (tel quel) pour télécharger la présentation

Politique de téléchargement : le contenu du site vous est fourni TEL QUEL pour votre information et votre usage personnel ; il ne peut être vendu, concédé sous licence ni partagé sur d’autres sites sans l’accord de son auteur.Le contenu vous est fourni TEL QUEL, pour votre information et votre usage personnel uniquement. Téléchargez la présentation en cliquant sur ce lien. Lors du téléchargement, si vous ne parvenez pas à télécharger une présentation, l’éditeur a peut-être supprimé le fichier de son serveur.Pendant le téléchargement, si vous ne parvenez pas à obtenir une présentation, le fichier a peut-être été supprimé par l’éditeur.

F I N

Plus de contenu associé

Transcription de la présentation
  1. Randomized AlgorithmsCS648 Lecture 15 Randomized Incremental Construction (building the background)

  2. Partition Theorem A set of events ,…,defined over a probability space (,P) is said to induce a partition of if • = • =∅for all Partition Theorem: B Ω This theorem solves many difficult problems magically. But one needs some experience in order to apply it effectively. You will realize it soon. • P(B)= ) • )∙ )

  3. problem 1find-min Problem

  4. Find-Min algorithm Find-Min(A[1..]) {  A[1]; For to do { if ( ?? ) ?? } return ; } Question:If elements of A are permuted randomly uniformly, what is the expected number of times variable is updated ? : no. of times is updated.  A[]  A[] ; ?? A 8 5 16 11 32 4 57 6 19 82 7 42 2 23 1 2 3 4 5 6 7 8 9 10 11 12 13 14

  5. Find-Min algorithm First elements = Probability that A[] is smaller than {A[],…, A[]} Notations: • : set of all subsets of A of size . • For any , : first elements of A are (some permutation of) . Using Partition Theorem, = Though this equation is perfectly correct, you won’t be able to proceed from this point onwards to find. Can you find the reason behind its uselessness ? A 12…

  6. problem 2Closest Pair of Points

  7. Closest Pair of Points Problem Definition: Given a set of points in plane, compute the pair of points with minimum Euclidean distance. Deterministic algorithms: • O() : Trivial algorithm • O() : Divide and Conquer based algorithm Randomized algorithm: • O() : Randomized Incremental Construction based algorithm

  8. Notations and assumptions Notations: • : set of points in plane. • Coordinates of each point are positive integers. • distance(,) : Euclidean distance between and . Assumption: • Distance between each pair of points is distinct.

  9. A discrete math exercise Exercise: What is the maximum number of points that can be placed in a unit square such that the minimum distance is at least 1 ? Answer:4. This exercise is used is deterministic algorithm as well the randomized algorithm that we shall discuss now. If there are more than 4 points, at least one of the four small squares will have more than 1 points. 1

  10. Overview of the randomized algorithm • Incremental algorithm: starts with a set of 2 points, computes their distance; inserts 3rd point and updates the closest pair distance; inserts 4th point and updates the closest pair distance; … • Uses an efficient data structure, called Grid, to facilitate efficient processing during ith step: - To determine if ith point is going to change the closest pair distance.

  11. Grid() A data structure with operations: • Locate_cell(,): Locates the cell to which belongs. • Report_points(,): Report all points belonging to cell . • Insert_point(,): Insert point in grid . • Build_Grid(): Build grid forwith parameter. : set of points : distance between closest pair of points in .

  12. Grid() The following time bounds are possible. Excluding Insert_point()operation, show as a homework, that we can achieve all other bounds using static hashing discussed in this course.

  13. Closest Pair of Points Closest-pair-algorithm() Let <,,…, > be a uniformly random permutation of ;  distance(,); Build_Grid(,); For to do { Step 1: locate the cell of the grid containing ; Step 2: find the point closest to ; let = distance(, ); Step 3: If ; Insert(,); Else ;  Build_Grid(,); } return ;

  14. th iteration We just need to insert 

  15. th iteration We need to rebuild the grid 

  16. th iteration

  17. Analysis of th iteration Closest-pair-algorithm() Let <,,…, > be a uniformly random permutation of ;  distance(,); Build_Grid(,); For to do { Step 1: locate the cell of the grid containing ; Step 2: find the point closest to ; let = distance(, ); Step 3: If ; Insert(,); Else ;  Build_Grid(,); } return ; O(1) O(1) O(1) for constant

  18. running time of th iteration : running time of th iteration E[] = ?? Question: What is ? depends upon which depends upon the first points. So we need to use Partition theorem to calculate . O(1) + ∙

  19. Calculating Notations: • : set of all subsets of of size. • For any , : first points are (some permutation of) . = Though this equation is perfectly correct, you won’t be able to proceed from this point onwards to find Can you find the reason behind its uselessness ?

  20. Homework Exercise • Investigate the cause of problem in our forwardanalysis for each of the two problems. • Try to find alternate approach for analysis. (Backward analysis  ) • Provide efficient implementation of Grid data structure. I am hopeful that at least one of you will reinvent this technique on his/her own before next class.