610 likes | 769 Views
Homework # 1~4(5) Review. Grading. 10 points for each homework. Exercise 5.1. Recurrence equation Master theorem Substitution method Lower bound for kd -tree query time :. Exercise 5.1. An example for the lower bound. Query range. Exercise 5.3. Kd-tree in d-dimensional space.
E N D
Grading • 10 points for each homework
Exercise 5.1 • Recurrence equation • Master theorem • Substitution method • Lower bound for kd-tree query time :
Exercise 5.1 • An example for the lower bound Query range
Exercise 5.3 • Kd-tree in d-dimensional space
Exercise 5.3 • Query time analysis • for reporting points where T(n) is number of internal nodes visited by the query • query time : • Constructuion time :
Exercise 5.10 • Range counting queries in the range tree • Simply label each nodes in the construction time that how many leaves it has as its descendant • (c) - fractional cascading • Generalize our 2d fractional cascading to d-dimension recursively
Exercise 2.10 • Skip! • Usual plane sweep algorithm • See in Ex 6.8
Exercise 6.2 Query point
Exercise 6.8 • Deterministic algorithm for computing the trapezoidal map • Plane sweep algorithm
Exercise 6.8 • Event queue Q : endpoints sorted by x coordinate • Balanced binary tree • Sweep line status S : set of segments intersecting the sweep line in sorted order (from top to bottom) • Balanced binary tree • Output T : trapezoidal map of given line segments
Exercise 6.8 • Add the endpoints of segments to Q (sorted order) 8 2 5 3 11 7 4 1 6 10 9
Exercise 6.8 • Add bounding horizontal lines to S 8 2 5 3 11 7 4 1 6 10 9
Exercise 6.8 • Extract min event 8 2 5 3 11 7 4 1 6 10 9
Exercise 6.8 • If the event point is a left endpoint, add its segments to S 8 2 5 3 11 7 4 1 6 10 9
Exercise 6.8 • Draw a vertical extension between two surrounding line segments in S 8 2 5 3 11 7 4 1 6 10 9
Exercise 6.8 • Draw a vertical extension between two surrounding line segments in S } 8 2 5 3 11 7 4 1 6 10 9
Exercise 6.8 • Draw a vertical extension between two surrounding line segments in S } 8 2 5 3 11 7 4 1 6 10 9
Exercise 6.8 • Right endpoint event } 8 2 5 3 11 7 4 1 6 10 9
Exercise 6.8 • Delete its segment in S } 8 2 5 3 11 7 4 1 6 10 9
Exercise 6.8 • Delete its segment in S } 8 2 5 3 11 7 4 1 6 10 9
Exercise 6.8 • Repeat until Q becomes empty } 8 2 5 3 11 7 4 1 6 10 9
Exercise 6.8 • Analysis • Sorting : • One left endpoint event : • One right endpoint event : • Total :
Exercise 6.12 • 5 possible cases • ① line is contained in a trapezoid
Exercise 6.12 • 5 possible cases • ②~④ line is contained in several trapezoids
Exercise 9.16 • : maximize the minimum distance between cluster • Draw a circle with diameter pq. If is not a Delaunay edge, There must be a point r inside the circle. - r is in or - r isin other partitions in both cases, contradiction
Exercise 9.16 • : maximize the minimum distance between cluster (b) - Each point becomes a partition itself (n partitions) - Compute Delaunay triangulation - Sort the set of Delaunay edges by its distance in increasing order - while there are k partitions extract the minimum distance Delaunay edge merge two partition(if possible) using the edge
Exercise 4.14 • Worst case : • when we pick elements in decreasing order • Recurrence equation Probability that the maximum element is picked
Exercise 4.14 • Worst case : • when we pick elements in decreasing order • Recurrence equation Probability that the maximum element is picked If the maximum, m, is picked first, it must be bigger than or equal to the return value of PARANOIDMAXIMUM(A\{m}), so we have to compare m with all other elements =>
Exercise 4.14 • Worst case : • when we pick elements in decreasing order • Recurrence equation Probability that the maximum element is not picked The picked element p must be smaller than the return value m of PARANOIDMAXIMUM(A\{p}), so we just return m =>
Exercise 4.15 • A simple polygon P is star-shaped if and only if the intersection of halfplanes, each of which has its boundary as an edge of P and heading inside of the polygon with respect to that edge is nonempty. • Pf) =>) p must be in the intersection <=) any point in the intersection satisfies the star -shaped condition
Exercise 4.15 Objective function
Exercise 4.15 Objective function
Exercise 8.1 • Incident preserving • (=>) , so . • (<=) , so . • Order preserving • (=>) b > ma + n , so –n > am – b. • (<=) –n > am – b, so b > ma + n.
Exercise 8.2 • The line segment can be expressed as . • The dual transform of these points are infinite set of lines, . • It forms a left-right double wedge, which is bounded by .
Exercise 8.7 • Line separator between two sets of points • Using duality transform!!
Exercise 11.8 • Halfplane intersection using a conflict graph
Exercise 11.8 • Pick two halfplanes randomly, and initialize Halfplanes not inserted yet Current intersection
Exercise 11.8 • Pick two halfplanes randomly, and initialize Halfplanes not inserted yet Current intersection