This action might not be possible to undo. Are you sure you want to continue?

BooksAudiobooksComicsSheet Music### Categories

### Categories

### Categories

### Publishers

Scribd Selects Books

Hand-picked favorites from

our editors

our editors

Scribd Selects Audiobooks

Hand-picked favorites from

our editors

our editors

Scribd Selects Comics

Hand-picked favorites from

our editors

our editors

Scribd Selects Sheet Music

Hand-picked favorites from

our editors

our editors

Top Books

What's trending, bestsellers,

award-winners & more

award-winners & more

Top Audiobooks

What's trending, bestsellers,

award-winners & more

award-winners & more

Top Comics

What's trending, bestsellers,

award-winners & more

award-winners & more

Top Sheet Music

What's trending, bestsellers,

award-winners & more

award-winners & more

P. 1

ALGORITHMS DESIGN TECHNIQUES AND ANALYSIS|Views: 9,685|Likes: 55

Published by Meena Bhagavathula

See more

See less

https://www.scribd.com/doc/50591134/ALGORITHMS-DESIGN-TECHNIQUES-AND-ANALYSIS

05/05/2013

text

original

In geometric algorithms, the main objects considered are usually points,

line segments, polygons and others in two-dimensional, three-dimensional

and higher dimensional spaces. Sometimes, a solution to a problem calls

for “sweeping” over the given input objects to collect information in order

to ﬁnd a feasible solution. This technique is called plane sweep in the

two-dimensional plane and space sweep in the three-dimensional space. In

its simplest form, a vertical line sweeps from left to right in the plane

stopping at each object, say a point, starting from the leftmost object to

the rightmost object. We illustrate the method in connection with a simple

problem in computational geometry.

Deﬁnition 18.1 Let p1 = (x1,y1) and p2 = (x2,y2) be two points in

the plane. p2 is said to dominate p1, denoted by p1 p2, if x1 ≤ x2 and

y1 ≤ y2.

Deﬁnition 18.2 Let S be a set of points in the plane. A point p ∈ S is

a maximal point or a maximum if there does not exist a point q ∈ S such

that p = q and p q.

The following problem has a simple algorithm, which is a good example

of a geometric sweeping algorithm.

maximal points: Given a set S of n points in the plane, determine the

maximal points in S.

This problem can easily be solved as follows. First, we sort all the points

in S in nonincreasing order of their x-coordinates. The rightmost point (the

463

464

Geometric Sweeping

one with maximum x-value) is clearly a maximum. The algorithm sweeps

the points from right to left and for each point p it determines whether it

is dominated on the y-coordinate by any of the previously scanned points.

The algorithm is given as Algorithm maxima.

Algorithm 18.1 maxima

Input: A set S of n points in the plane.

Output: The set M of maximal points in S.

1. Let A be The points in S sorted in nonincreasing order of their x-

coordinates. If two points have the same x-coordinate then the one

with larger y-coordinate appears ﬁrst in the ordering.

2. M←{A[1]}

3. maxy←y-coordinate of A[1]

4. for j←2 to n

5. (x,y)←A[j]

6. if y > maxy then

7.

M←M ∪{A[j]}

8.

maxy←y

9. end if

10. end for

Figure 18.1 illustrates the behavior of the algorithm on a set of points.

As shown in the ﬁgure, the set of maxima {a,b,c,d} forms a staircase.

Note that, for example, e is dominated by a only, whereas f is dominated

by both a and b, and g is dominated by c only.

x

y

The sweep line

a

b

c

d

e

f

g

Fig. 18.1 A set of points with their maxima.

Geometric Preliminaries

465

It is easy to see that the running time of the Algorithm maxima is

dominated by the sorting step, and hence is O(nlogn).

The above example reveals the two basic components of a plane sweep

algorithm. First, there is the event point schedule, which is a sequence of the

x-coordinates ordered from right to left. These points deﬁne the “stopping”

positions of the sweeping line, which is in this case a vertical line. Unlike

the case in the previous example, in some plane sweep algorithms, the event

point schedule may be updated dynamically, and thus data structures that

are more complex than a simple array or a queue may be required for

eﬃcient implementation.

The other component in the plane sweep method is the sweep line status.

This is an appropriate description of the geometric objects at the sweeping

line. In the above example, the sweep line status consists of a “description”

of the most recent maximal point detected. This description is simply the

value of its y-coordinate. In other geometric algorithms, the sweep line

status may require storing the relevant information needed in the form of

a stack, a queue, a heap, etc.

NAAC-SSR _2015_AITS.pdf

vnit nagput eee.pdf

Data Analytics With SAS

DAA

OOP

AC14_sol

We Ka Tutorial

Survey 2000

IT Syllabus

Eecs 140 Vhdl Tutorial

10.1.1.167

c Interview Questions Tech Preparation

- Read and print without ads
- Download to keep your version
- Edit, email or read offline

DAA

full notes

Design and Analysis of Algorithms

Graph

Graphs

shortest common superstring1

Intro Notes

Algo Notes Tirupattur

Graphs 1

C++ Network Programming Volume 1

Introduction to Lisp

451lects

27100004-C

selva

Johnson's Algorithm

Intro Notes 2

DAA2M

intro_notes

CS2251-QB

Min Cost Flow and Succsesive Shortest Path Algorithm

ln1ntroduction

CS502_all

Graphs

daa

Algorithm Graphs with solution

Algorithm Analysis and Design

Problems on Algorithms 2nd Edition

Introduction to the Design & Analysis of Algorithms 2ND Edition by Anany Levitin

daa 1mark questions and answers

Time Complexities of Sorting Algorithms

Are you sure?

This action might not be possible to undo. Are you sure you want to continue?

CANCEL

OK

You've been reading!

NO, THANKS

OK

scribd

/*********** DO NOT ALTER ANYTHING BELOW THIS LINE ! ************/ var s_code=s.t();if(s_code)document.write(s_code)//-->