dynamic algorithms for planar point location kanat tangwongsan in collaboration with guy blelloch,...

20
Dynamic Algorithms for Dynamic Algorithms for Planar Point Location Planar Point Location Kanat Tangwongsan in collaboration with Guy Blelloch, Umut Acar, Srinath Sridhar. Aladdin Center - Summer 2004

Upload: eleanore-lynch

Post on 18-Dec-2015

223 views

Category:

Documents


0 download

TRANSCRIPT

Dynamic Algorithms for Dynamic Algorithms for Planar Point LocationPlanar Point Location

Kanat Tangwongsan

in collaboration withGuy Blelloch, Umut Acar, Srinath Sridhar.

Aladdin Center - Summer 2004

Planar Point Location Planar Point Location

• Classical geometric retrieval problem.Classical geometric retrieval problem.• Subdivide a Euclidean plane into polygons by line Subdivide a Euclidean plane into polygons by line

segments. (These segments intersect only at their segments. (These segments intersect only at their endpoints).endpoints).

• Identify which polygon the query point (red spot) is Identify which polygon the query point (red spot) is in.in.

Static vs Dynamic Static vs Dynamic

• Static: fixed structure Static: fixed structure • Dynamic: possible insertion/deletion of segmentsDynamic: possible insertion/deletion of segments

Motivation Motivation

• Applications of Point LocationApplications of Point Location– Geographic Information Systems (GIS)Geographic Information Systems (GIS)– User Interface (Mouse/Windows relation)User Interface (Mouse/Windows relation)– Graphics and CAD/CAM Graphics and CAD/CAM – etc.etc.

• Why dynamic?Why dynamic?– InterestingInteresting– Heavy use in circuit layout, computer graphics, etc.Heavy use in circuit layout, computer graphics, etc.

Some Previous WorkSome Previous Work

• Many solutions to this problem:Many solutions to this problem:– [Kirkpatrick 1983]; [Edelsbrunner, Guibas 1986]; [Kirkpatrick 1983]; [Edelsbrunner, Guibas 1986]; [Overmars 1985]; [Sarnak, Tarjan 1986], etc.[Overmars 1985]; [Sarnak, Tarjan 1986], etc.

• Various approaches and techniques: persistent Various approaches and techniques: persistent trees, segment trees, etc.trees, segment trees, etc.

• See Chiang and Tamassia’s “Dynamic Algorithms in See Chiang and Tamassia’s “Dynamic Algorithms in Computational Geometry” for pointers to these.Computational Geometry” for pointers to these.

• Close look at Sarnak-Tarjan solution.Close look at Sarnak-Tarjan solution.

Sarnak-Tarjan SolutionSarnak-Tarjan Solution

• Idea: (partial) persistence Idea: (partial) persistence – OO(log (log nn))-query-time, -query-time, OO((nn)-)-space solution.space solution.

• Static: unable to insert/delete segments.Static: unable to insert/delete segments.

• Relies on Cole’s observation and Dobkin-Lipton Relies on Cole’s observation and Dobkin-Lipton construction.construction.

Dobkin-Lipton ConstructionDobkin-Lipton Construction• Draw a vertical line through each vertex, splitting Draw a vertical line through each vertex, splitting

the plane into vertical slabs.the plane into vertical slabs.

• Locate a point with two binary searches - Locate a point with two binary searches - OO(log (log nn)-)-query time.query time.

• Nice but space inefficient – can cause Nice but space inefficient – can cause OO((nn22))..

• ((nn)) segments in each slabs segments in each slabs, and , and ((nn)) slabs.slabs.

• If storing a tree for each slab, order If storing a tree for each slab, order nn22 space usage.space usage.

timetime

A B

• Sets of line segments intersecting contiguous slabs Sets of line segments intersecting contiguous slabs are similar.are similar.

Cole’s ObservationCole’s Observation

• Reduces the problem to storing a “persistent” sorted Reduces the problem to storing a “persistent” sorted set.set.

Some Notions of PersistencySome Notions of Persistency

• Ephemeral data structure: cannot go back in time.Ephemeral data structure: cannot go back in time.

• Persistent data structure: keeps all previous versions accesible. Persistent data structure: keeps all previous versions accesible. – Partial persistence Partial persistence

• Various solutions: see e.g. Driscoll et al., Overmars, etc. Various solutions: see e.g. Driscoll et al., Overmars, etc.

• Trees:Trees:– ““path-copying” is simple and powerfulpath-copying” is simple and powerful

– Native to functional programming languages e.g. ML, Scheme, Native to functional programming languages e.g. ML, Scheme, etc.etc.

Path-copying illustratedPath-copying illustrated

22

11 44

22

11 4411

55 5533

Insert 3Insert 3

22

11

22

44 44

5533

Version DictionaryVersion Dictionary

Friendly “Dynamic/Stability” Friendly “Dynamic/Stability” 101101

• What is a “Dynamic Algorithm”?What is a “Dynamic Algorithm”?– Maintains its input/output relationship as the input Maintains its input/output relationship as the input

changes.changes.

• Some Words of the DaySome Words of the Day– to “to “dynamizedynamize” an algorithm is to make it dynamic.” an algorithm is to make it dynamic.– ““dynamizationdynamization” is the process of making an ” is the process of making an

algorithm dynamic.algorithm dynamic.

• ““stable” = a change to the input does not change the stable” = a change to the input does not change the execution trace (function call tree) too dramatically.execution trace (function call tree) too dramatically.

Dynamizing Persistent Data Dynamizing Persistent Data StructureStructure

• Acar et al (SODA 2004) shows a way to dynamize Acar et al (SODA 2004) shows a way to dynamize static algorithms.static algorithms.

• The efficiency depends on “stability”.The efficiency depends on “stability”.

• Traditional linked-list is bad for look-up [Traditional linked-list is bad for look-up [OO((nn))]]..

• An additional layer saves a lot of “probing”.An additional layer saves a lot of “probing”.

• Achieve Achieve OO(log (log nn) ) by adding a few more layers. by adding a few more layers. – Say with Say with nn/4/4, , nn/8/8 and so forth nodes. and so forth nodes.– Sadly, maintaining this perfect structure is hard.Sadly, maintaining this perfect structure is hard.

Digression #1: Skip ListsDigression #1: Skip Lists

0 1 2 3 4 5 6 7

0 2 4 6

0 4

0

1

1

1

1

0 1 2 3 4 5 6 7

0 2 4 6

1

1

0 1 2 3 4 5 6 7 1

Digression #1: Skip ListsDigression #1: Skip Lists

• Pugh[1990] invented “skip lists”.Pugh[1990] invented “skip lists”.

0

0

1

1

1

1

2 3

3

4 5 6

6

6

7

7

7

7

8 9

9

!

!

!

!

!

1

1

1

1

1

• The level of a node is drawn from the geometric The level of a node is drawn from the geometric distribution i.e. a node has level distribution i.e. a node has level k k --11 with probability with probability 11//22kk

• Skip Lists: expected Skip Lists: expected OO((nn))-space, and expected -space, and expected OO(log (log nn)) insert/delete/look-up. insert/delete/look-up.

Our Unified GoalsOur Unified Goals

• Dynamize Sarnak-Tarjan Dynamize Sarnak-Tarjan – use the idea of persistent data structure and be able to use the idea of persistent data structure and be able to

support insertion/deletion/lookup on-the-fly.support insertion/deletion/lookup on-the-fly.

• ““stability” is the key to efficiency.stability” is the key to efficiency.

• Treaps and skip lists looks promising.Treaps and skip lists looks promising.

• ““path-copying” as the starting point.path-copying” as the starting point.

• Benchmark against existing techniques.Benchmark against existing techniques.

Questions?Questions?

Thank you!Thank you!