lect4-2dmax2-asymptotics

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

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

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.

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

View Full Document
This is the end of the preview. Sign up to access the rest of the document.

{[ snackBarMessage ]}

### What students are saying

• As a current student on this bumpy collegiate pathway, I stumbled upon Course Hero, where I can find study resources for nearly all my courses, get online help from tutors 24/7, and even share my old projects, papers, and lecture notes with other students.

Kiran Temple University Fox School of Business ‘17, Course Hero Intern

• I cannot even describe how much Course Hero helped me this summer. It’s truly become something I can always rely on and help me. In the end, I was not only able to survive summer classes, but I was able to thrive thanks to Course Hero.

Dana University of Pennsylvania ‘17, Course Hero Intern

• The ability to access any university’s resources through Course Hero proved invaluable in my case. I was behind on Tulane coursework and actually used UCLA’s materials to help me move forward and get everything together on time.

Jill Tulane University ‘16, Course Hero Intern