lect4-2dmax2-asymptotics

lect4-2dmax2-asymptotics - Lecture Notes CMSC 251 In...

Info iconThis preview shows pages 1–2. Sign up to view the full content.

View Full Document Right Arrow Icon
Lecture Notes CMSC 251 In summary, there is no one way to solve a summation. However, there are many tricks that can be applied to either find asymptotic approximations or to get the exact solution. The ultimate goal is to come up with a close-form solution. This is not always easy or even possible, but for our purposes asymptotic bounds will usually be good enough. Lecture 4: 2-d Maxima Revisited and Asymptotics (Thursday, Feb 5, 1998) Read: Chapts. 2 and 3 in CLR. 2-dimensional Maxima Revisited: Recall the max-dominance problem from the previous lectures. A point p is said to dominated by point q if p.x q.x and p.y q.y . Given a set of n points, P = { p 1 ,p 2 ,...,p n } in 2-space a point is said to be maximal if it is not dominated by any other point in P . The problem is to output all the maximal points of P . So far we have introduced a simple brute-force algorithm that ran in Θ( n 2 ) time, which operated by comparing all pairs of points. The question we consider today is whether there is an approach that is significantly better? The problem with the brute-force algorithm is that uses no intelligence in pruning out decisions. For example, once we know that a point p i is dominated by another point p j , then we we do not need to use p i for eliminating other points. Any point that p i dominates will also be dominated by p j . (This follows from the fact that the domination relation is transitive , which can easily be verified.) This observation by itself, does not lead to a significantly faster algorithm though. For example, if all the points are maximal, which can certainly happen, then this optimization saves us nothing. Plane-sweep Algorithm: The question is whether we can make an significant improvement in the running time? Here is an idea for how we might do it. We will sweep a vertical line across the plane from left to right. As we sweep this line, we will build a structure holding the maximal points lying to the left of the sweep line. When the sweep line reaches the rightmost point of P , then we will have constructed the complete set of maxima. This approach of solving geometric problems by sweeping a line across the plane is called plane sweep . Although we would like to think of this as a continuous process, we need some way to perform the plane sweep in discrete steps. To do this, we will begin by sorting the points in increasing order of their x -coordinates. For simplicity, let us assume that no two points have the same y -coordinate. (This limiting assumption is actually easy to overcome, but it is good to work with the simpler version, and save the messy details for the actual implementation.) Then we will advance the sweep-line from point to point in n discrete steps. As we encounter each new point, we will update the current list of maximal points.
Background image of page 1

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
Image of page 2
This is the end of the preview. Sign up to access the rest of the document.

Page1 / 4

lect4-2dmax2-asymptotics - Lecture Notes CMSC 251 In...

This preview shows document pages 1 - 2. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online