24 views

Uploaded by scribdwt

- Alv Interactive
- 3
- Permutations and Combinations
- LSMW
- 15122written9
- cbgapi
- Computer Based Optimization Techniques
- Activity 5
- jj
- leetcode-cpp.pdf
- apk om
- Lecture 10
- c Lab Programs
- I Users Hunspau K-Base Papers Volume2 SDE2ch6.WPD
- a
- MC2014_Indv Assignment Problem-I and Problem-II (1)
- Deepa
- computer
- Apoo.arrangements
- Step by Step Approach to Delete and Recreate Secondary Indices in Process Chains

You are on page 1of 62

We have covered:

• interval trees for point queries

• mappings to higher dim. space for

interval range queries

structure for the interval queries

Range queries

• Consider a fixed set of intervals 1-d. Several

different types:

1. For a given interval I,

1. report all intervals that are contained in I.

2. report all intervals that intersect I.

3. report all intervals that contain I.

Mapping intervals to points in 2-d

• Every interval J can naturally be mapped into

the 2-d point, pj, so that the angle shown at pj,

is a right-angle.

transformation step 2

now rotate by 45o

queries

1. report all intervals that are contained in I

I

queries

2 report all intervals that intersect I.

I

queries

3. report all intervals that contain I

I

interpretation

Project on x-y axes;

J contains I iff

J has larger x-coordinate and larger y-coordinate than I

J’

J’ dominates I’

I

J

interpretation

J contains I iff

J has larger x-coordinate and larger y-coordinate than I

J’

J’ dominates I’

interpretation

J contains I iff

J has larger x-coordinate and larger y-coordinate than I

J’ dominates I’

J’ I’ dominates k’

k’ I’

the relation dominance

is transitive, so

J’ dominates k’

direct dominance

We say that J’ directly dominates I’

if J’ dominates I’ and should J’ dominate some k’ then

I’ dominates k’ or I’ and k’ are not related via the dominance relation

J’

k’ I’

the relation direct

dominance

k’ is not transitive!

Dominance/Direct Dominance

• As a result:

– the number of dominance pairs in direct

dominance is linear

– the number of dominance pairs in relation

dominance can be quadratic

– Dominance pairs are the transitive closure of

direct dominance i.e., each pair in the direct

dominance relation is taken to be in

dominance and then we build transitive

closure.

determining dominance pairs

4

1

2

6

1 2 3 4 5 6

determining dominance pairs

1. sort the points by one of the coordinates

say x-coordinate

points as they appear on

the y-axis

4

3. read this as a permutation

1 of the numbers

П with number k maps into

2 Пk

6

(3,6,2,1,4,5)

3

1 2 3 4 5 6

Dominance via permuations

We can now easily see that:

i dominates k iff

1. i > k and

2. П = (.., Пk , …, Пi )

i.e., Пi appears Пk after in П

determining dominance pairs

(3,6,2,1,4,5)

5

is a compact representation

of dominance!

4 That is linear space

1 for a possibly quadratic

relation.

2

You can also get direct

6 dominance by looking for

the first number appearing

after a given entry that

3

is larger than the entry.

1 2 3 4 5 6

back to 1-d

1-d range search for points can be

answered in O(log n + outputsize) with

linear space

query

range queries

search tree on the

x-coordinates as keys

1 2 3 4 5 6

half-open range queries

I. the balanced binary tree search component

1 2 3 4 5 6

query

half-open range queries

I. balanced binary tree search

II. each internal node has a 1-d range tree of all

elements in its subtree

1 2 3 4 5 6

query

range queries

find the nodes closest to the

root that cover all nodes

of the x-range for the query

in each of these perform

a range query on the y-coordinates

query time:

O(log n) * O(log n) + O(output) =

O(log2 n + output)

storage: O( n log n)

1 2 3 4 5 6

query

half-open range queries

report points

2,4 and 5

1 2 3 4 5 6 7 8

half-open range queries

I. Build a balanced binary

search tree on the

100 x-coordiantes as keys

80 y-coordinate

70

60

50

40

30

20

1 2 3 4 5 6 7 8

Priority Search Tree

(McCreight)

Heap 100

on y-values 80 40

70 50 20 30

60 - - - - - - -

[ y-values 70 50 20 80 100 40 30 60 ]

x1 x2 x3 x4 x5 x6 x7 x8

half-open range queries can be solved

in linear space and O(log n + outputsize)

report points

2,4 and 5

1 2 3 4 5 6 7 8

range queries can be solved through

two half-open range queries

report points

2 and 4

1 2 3 4 5 6 7 8

Range queries through half-open range

queries Important note: this requires

Intersecting the outputs of both

half-open range queries,

thus NOT output sensitive.

+∞ query output: 2,4,5

-∞ query output: 2,3,4

output: 2 and 4

1 2 3 4 5 6 7 8

Point location problems

cont’d

• We discussed the O(n) point location

algorithm based on Jordan’s Theorem.

• We will be discussing three methods which

allow preprocessing and then faster point

location.

• Note: point location in planar subdivision or

polygons is a key task and a step in many

algorithms.

Point location methods

1. Slab method

2. Chain decomposition

3. Kirkpatrick

Slab Method

• Consider a planar subdivision

• In a preprocessing step we

construct horizontal slab through each of

the vertices of the subdivision.

Slab Method

Slab Method

x-coordinate, The endpoints on the upper and lower slab

boundaries list the corresponding segments in the same order.

Slab Method

The binary search must be done carefully.

Binary search

Binary search with a slab

II. thus in O(log n) a binary search can be performed inside a slab

Binary search on slabs

using the y-coordinates for slabs and query point.

query

Total cost for query

subdivision on n edges can be carried out in O(log n) time.

query

Total cost for preprocessing

Theorem: The slab method requires O(n2) storage and preprocessing time.

query

Total cost for preprocessing

Theorem: The slab method requires O(n2) storage and preprocessing time.

∑si = O(n2)

O(n2) preprocessing time

Note: Brute force preprocessing O(n2)

Alternate method use plane sweep method in O(n log n + output)

∑si = O(n2)

Pros and Cons of Slab Method

+ simple to implement

- storage quadratic

- preprocessing time

Chain decomposition

• This method improves on the previous in

terms of storage and preprocessing time.

• However, we pay for this with increased

query time.

Chain decomposition

• The idea is to partition the planar

subdivsion edges into a set of chains.

• These chains will all be monotonic in the

y-direction.

• This allows for binary search between

chains.

2 Chains point location

• Consider two chains that are monotonic

and that have a common highest and

lowest vertex.

(We actually assume

that the chains are going

to infinity on both ends.)

2 Chains point location

• Consider two chains that are monotonic

and that have a common highest and

lowest vertex.

In O(log n) time we can

determine if a query point

falls inside or outside the

polygon formed by these two

chains.

2 Chains point location

• We do this by performing two separate

location tests: one against the left and one

against the right

chain.

2 Chains point location

• Each test is using the left-turn/right-turn

primitive.

2 Chains point location

• Assume, for a moment, that the planar

subdivision is partitioned into

a monotonic (in y)

polygons.

Chain decomposition

We aim for the following properties for that

partitioning:

chain

bottom-most vertex (if not unique use

the x-coordinate as secondary key to make

the decision).

Chain decomposition:

regular vertices

First assume that each vertex in the

subdivision is regular, i.e., it is

connected

to at least one vertex above it and to one

vertex below it.

Later we will see how to guarantee

this condition.

Chain decomposition

The idea is to perform two plane sweeps

one top-to-bottom and one bottom-to-top.

(Preparata and Shamos Computational

Geometry book is a good reference.)

4

2 3

assume that the number of chains (to be constructed)

sharing the edges into the vertex are at least 2, 4, 3

6 3 then there must be at least 9= 2+4+3 outgoing chains

and we can “arbitrarily” assign those to the

outgoing edges, say here: 6 + 3

Chain decomposition

in the second phase (bottom-up)

we make sure that the number of

chains on each vertex matches

in both directions.

4

2 3

6 3

Chain decomposition

in the second phase (bottom-up) 1

we make sure that the number of 1 1

chains on each vertex matches 1

1

in both directions.

1 1

1 1 1

2

1 2

3

1 2

2 3

1 3

6

Chain decomposition

6

in the second phase (bottom-up) 31

we make sure that the number of 1 1

2

chains on each vertex matches 1

2 1

in both directions.

1 1

1 1 1

2

1 2

3

1 2

2 3

1 3

6 6

Query using chains

6

Once we have the chain decomposition, 31

we can carry out two nested binary 1 1

2

searches: 1

2 1

one over the chains the other

for each chains (left/right of chain) 1 1

1 1 1

2

The query then takes:

1 2

O( log2 n) time. 3

1 2

2 3

1 3

6 6

Regularization

Finally, we need to guarantee that all

vertices are regular.

This is done by a procedure called

regularization. Regularization is useful

for other problems too.

Regularization

Finally, we need to guarantee that all

vertices are regular.

This is done by a procedure called

regularization. Regularization is useful

for other problems too.

an outgoing edge (connected v

to a lower vertex).

Regularization

Recall out plane sweep technique similar to

line segment intersection.

We know for every event point which

edges are to the left and right

(immediate).

That means that these two edges

are visible horizontally.

v

Consider now the the higher of these

two vertices.

Either it is visible or an

event point (a vertex) is visible.

Regularization

Consider now the the higher of these

two vertices.

Either it is visible or an

event point (a vertex) is visible.

v

it is visible

Regularization

Based on these observations, a simple

plane sweep method can be designed.

it is visible

Chain method complexities

We obtain:

Theorem: In O(log2 n) time, after O(n log n) preprocessing and linear storage,

point location queries in planar subdivisions on n vertices can be answered.

To obtain linear storage one must store the chains in such a manner as to

avoid storing multiple chains sharing an edge.

Kirkpatrick complexity

The best method is due to Kirkaptrick. Optimal is preprocessing, storage and

query.

point location queries in planar subdivisions can be answered.

see class

- Alv InteractiveUploaded bynsony
- 3Uploaded by8840113
- Permutations and CombinationsUploaded byShaheen Mahmud
- LSMWUploaded bySekhar Valla
- 15122written9Uploaded byBatman
- cbgapiUploaded byAde Armadi
- Computer Based Optimization TechniquesUploaded byDìlìn PI
- Activity 5Uploaded byAnonymous OgLihi32M
- jjUploaded bySurendra Kumar Singh
- leetcode-cpp.pdfUploaded byMardokay M
- apk omUploaded byRio Hatta
- Lecture 10Uploaded byapi-3717835
- c Lab ProgramsUploaded bysowmya8929
- I Users Hunspau K-Base Papers Volume2 SDE2ch6.WPDUploaded byabc
- aUploaded byAbrar Hyder
- MC2014_Indv Assignment Problem-I and Problem-II (1)Uploaded byvnn1223
- DeepaUploaded byKarim Lamraoui
- computerUploaded bym a
- Apoo.arrangementsUploaded byPragyanand Tiwari
- Step by Step Approach to Delete and Recreate Secondary Indices in Process ChainsUploaded bycrazy1_7998158
- ImportantUploaded bysumitgaita
- Project i VasUploaded bypulsar_viki
- 5_semantic_analysis_basico.pdfUploaded byNera Ajahh
- 01 Cvis Bp GeneralUploaded byCamilla Rodrigues de Oliveira
- Aster Group 10 Report Training - 08 FormattingUploaded bySatya Mulagala
- docie.psUploaded byFaggot
- 02 or IntuitiveUploaded byPreetam Suresh Rathod
- Infected FilesUploaded byOscar Creyente Rap
- programming and web 11-20-14Uploaded byapi-304963493
- CG07 - Bresenham Line Drawing AlgorithmUploaded bysalmansami01

- QoS OTTAWA Seminaire v2Uploaded byscribdwt
- Installation GuideUploaded byscribdwt
- Installation GuideUploaded byscribdwt
- ELG5191 Design of Distributed System Software ChapterUploaded byscribdwt
- ELG5191 Design of Distributed System Software ChapterUploaded byscribdwt
- EZilla GroupUploaded byscribdwt
- EZilla GroupUploaded byscribdwt
- LicenseUploaded byanon-444297
- A USB MonitorUploaded byscribdwt
- Standard Budget EnUploaded byscribdwt
- Presentation HAVE April 2007Uploaded byscribdwt
- Practice Quiz3Uploaded byscribdwt
- ADM 2350 Winter 2009 Assign 1Uploaded byscribdwt
- Apache Wink User GuideUploaded byscribdwt
- Intern Finance Ch05 F2008Uploaded byscribdwt
- A 3Uploaded byscribdwt
- QoS for IP (2)Uploaded byscribdwt
- ADM3305 Final Exam ReviewUploaded byscribdwt
- Web-Based Mapping of Real-Time GIS DataUploaded byscribdwt
- Gis Spatial Data StructuresUploaded byscribdwt
- ELG5191 Design of Distributed System Software Chapter8 SOAP With AttachmentsUploaded byscribdwt
- Intern Finance Ch00 F2008Uploaded byscribdwt

- Bioaccumulation in Tissues of Fresh Water Fish Cirrhina Mrigala on ChronicUploaded byESSENCE - International Journal for Environmental Rehabilitation and Conservaion
- Athanasopoulos and Hyndman (2008)Uploaded byvoranoth
- 1_NOTICE43 Recognition of Non Malta Certificates of Competence for Service on Maltese ShipsUploaded byElena Shulyak
- The Economics of Oil A Primer Including Geology, Energy, Economics, Politics.pdfUploaded bymaveryq
- TP48200E-D09A1 Outdoor Power System Datasheet for Enterprise 01-20130507Uploaded byZaheer Ahmed Tanoli
- f 0463842Uploaded byInternational Organization of Scientific Research (IOSR)
- Sembcorp _ NewsUploaded byqlfang
- 3 Battlecard Virtual CloudUploaded bygutin
- AutoCAD Asd Reinforcement Manual Eng 2011Uploaded byHegdeVenugopal
- University of Hawaii Dairy WasteUploaded byElif Kobak
- Robert Woods Johnson Foundation Influence on Tobacco Control Efforts and Lack of Media Objectivity.Uploaded byKaye Beach
- Almuete v PeopleUploaded bydorian
- CB Project Frooti by abhishek pathakUploaded byAbhishek Pathak
- Tugas BITUploaded byRahma Aqrarina W
- Unit-1Uploaded bySanjeev Chaudhary
- AutoCAD Associate Sample QuestionsUploaded byKelly Gan
- APC_ch12sol.2011Uploaded byShealalyn1
- Dean Riano PR and CAUploaded bybloome9cee
- study the comparison of ELSS mutual fund marketed at Karvy private WealthUploaded byBharat Narula
- JPIA CBLUploaded byAngelica Catalla
- HospitalLicensingRulesCh133_2012-11-11Uploaded bycarlcrow
- 2011 Award AbstractsUploaded byMark Reinhardt
- AP 03302520256Uploaded byInternational Journal of computational Engineering research (IJCER)
- Timer LavarropasUploaded bytesaurus
- Policy server implementation and maintenanceUploaded byserverwench
- Sison-Barias vs. Rubia*Uploaded byRaya Alvarez Teston
- Anatomy of a CoupUploaded byARFoundation
- [Marketing] Final Report AdidasUploaded byLinh Nguyen
- Computer Assisted Language.Learning. Learnig Activity 1.3Uploaded byJorge Chuva
- V‐Goods and the Role of the Urban Informal Sector in DevelopmentUploaded byJohn Basil Manuel