kinetic algorithms data structure for mobile data

56
Kinetic Algorithms Data Structure for Mobile Data

Upload: lilian-shelton

Post on 18-Dec-2015

228 views

Category:

Documents


5 download

TRANSCRIPT

Page 1: Kinetic Algorithms Data Structure for Mobile Data

Kinetic Algorithms

Data Structure for Mobile Data

Page 2: Kinetic Algorithms Data Structure for Mobile Data

Plan Motivation Introduction Illustrative example Applications

2-D Convex Hull Closest pair in 2-D

Others Issues

Page 3: Kinetic Algorithms Data Structure for Mobile Data

Motivation Maintain an attribute of interest in a

system of geometric objects undergoing continuous motion.

Take advantage of the coherence present in continuous motion to process a minimal number of combinatorial event.

Page 4: Kinetic Algorithms Data Structure for Mobile Data

Introduction Problems such as convex hull and

closest pair maintenance have been extensively studied: Static objects Insertion and deletion operations

Wasteful of computation Compute form scratch

Page 5: Kinetic Algorithms Data Structure for Mobile Data

IntroductionKDS?

KDS: Kinetic Data Structure Process of discrete events associated

with continuously changing data. Kinetisation

Process of transforming an algorithm on static data into a data structure which is valid for continuously changing data.

Page 6: Kinetic Algorithms Data Structure for Mobile Data

IntroductionThe Big Picture

Resemble to a sweep-line/plane algorithm

Use of a global event queue as interface between KDS and object in motion.

Time

Sweep line

Page 7: Kinetic Algorithms Data Structure for Mobile Data

IntroductionFlight plan

Use of flight plans The motion of the objects is known in

advance BUT:

• Can be imprecise (use of intervals)• Can be updated

Page 8: Kinetic Algorithms Data Structure for Mobile Data

IntroductionHow does it work?

The correctness of whatever configuration can be guaranteed with a conjunction of low-degree algebraic conditions involving a bounded number of objects each.

A

B

C

A B C

AB C

To Collinear

Inverse

Page 9: Kinetic Algorithms Data Structure for Mobile Data

IntroductionCertificates

A certificates will guarantee the correctness of any configurations

Page 10: Kinetic Algorithms Data Structure for Mobile Data

IntroductionTimeline

Event queue contains KDS events corresponding to times (precise / interval) when certificates might change sign.

IF ( flight plan of O updated )THEN

All the certificates involving O must be recalculated and updated.

Page 11: Kinetic Algorithms Data Structure for Mobile Data

Recapitulation Attribute certificates for any

configurations Keep track of the change in the

certificates and update when necessary

TimeCertificates

Update

Page 12: Kinetic Algorithms Data Structure for Mobile Data

Definitions Certificates

Guarantee the correctness Complexity

Number of points moving in a system.

Small cost If it running time of the order

or

n

O n for small O Poly log(n)

Page 13: Kinetic Algorithms Data Structure for Mobile Data

Definitions Internal events (IE)

Events process by the structure for its internal needs

External events (EE) Events affecting the configuration we

are maintaining. Lower bound for IE

Page 14: Kinetic Algorithms Data Structure for Mobile Data

Definitions Efficiency

If the ratio IE / EE is small. Range: 1 to Infinity

Responsiveness Worst-case cost of processing a certificate

Size Maximum number of events it needs to

schedule in the event queue

Page 15: Kinetic Algorithms Data Structure for Mobile Data

Definitions Compact

If size linear to the number of moving objects

Local If the maximum number of events in

the event queue that depend on a single object is small

Page 16: Kinetic Algorithms Data Structure for Mobile Data

Illustrative example Consider the following1D situation

Given a set of n points moving continuously along the y-axis, we are interested to know which is the topmost point.• Constant speed• Arbitrary initial configuration

Y

Page 17: Kinetic Algorithms Data Structure for Mobile Data

Solution 1Trivial Case

Draw the lines in the ty-plane Compute the upper envelope of the

set of lines. Efficient algorithm but does not

support update of the flight plan.

O n log(n)

Page 18: Kinetic Algorithms Data Structure for Mobile Data

Solution 2Schedule-Deschedule

Maintain, on-line, the sorted order along the y-axis

Schedule event that is the first time when two consecutive points cross. Destroy and create 2 adjacencies Schedule and deschedule up to 2 new events

Not efficient: process up to events.

Page 19: Kinetic Algorithms Data Structure for Mobile Data

Solution 3Heap

For each link in the heap, a certificate guarantees that the child point is below the parent point.

We associate an event at the time these points meet.

Page 20: Kinetic Algorithms Data Structure for Mobile Data

Solution 3Heap

For an event we may interchange parent and child

Page 21: Kinetic Algorithms Data Structure for Mobile Data

Solution 4Kinetic Tournament Consider a divide-and-conquer

algorithm, like a tournament from bottom to up for computing a global leader. comparisons

As long as each of the comparison remain valid the identity of the maximum remains valid.

O n

Page 22: Kinetic Algorithms Data Structure for Mobile Data

Solution 4Kinetic Tournament Imagine that a particular comparison

involved flip and precolated up the tree.

For a balanced tree the computation is made in time and can affect at most certificates.

O n log(n) O log(n)

Page 23: Kinetic Algorithms Data Structure for Mobile Data

Solution 4Kinetic Tournament For points with constant speed, similar to

the computation of the upper-envelope in the ty-plane.

In the worst case we have new leaders, each computed in time, for a total worst case running time of O n log(n)

O log(n) n

Page 24: Kinetic Algorithms Data Structure for Mobile Data

Solution 4Kinetic Tournament KDS

efficient compact local

Winner

Page 25: Kinetic Algorithms Data Structure for Mobile Data

2D Convex Hull Problem

Maintain the convex hull of a set of moving points in 2D.

Dual form Point (p,q) to the line y=px+q

Page 26: Kinetic Algorithms Data Structure for Mobile Data

2D Convex Hull

Goal: Maintain the upper envelope of the set of lines

Page 27: Kinetic Algorithms Data Structure for Mobile Data

2D Convex Hull Perform a kinetic tournament. From a red and a blue chain maintain the

purple upper envelope of the 2 chains

O n log(n)

Page 28: Kinetic Algorithms Data Structure for Mobile Data

2D Convex HullKinetisation

We keep a record of the entire computation in a balanced binary tree

Each node is in charge of maintaining the upper envelope of two upper envelopes computed by its children

If a event creates a change, the event is process through the tree.

Page 29: Kinetic Algorithms Data Structure for Mobile Data

2D Convex HullOperators

<x X value comparison <y Y value comparison <s Slope comparison

Ce(ab) Contender edge Color of the vertex ...

Page 30: Kinetic Algorithms Data Structure for Mobile Data

2D Convex HullCertificates

Page 31: Kinetic Algorithms Data Structure for Mobile Data

2-D Convex HullCertificates

Page 32: Kinetic Algorithms Data Structure for Mobile Data

2D Convex HullExample

Page 33: Kinetic Algorithms Data Structure for Mobile Data

2-D Convex Hull Lemma 2.1

Consider a configuration C of two convex piecewise linear functions and the certificate list L for their upper envelope as defined earlier. Let C’ be a configuration for which all the certificates of L hold. Then the upper envelope of C’ has the same combinatorial description as that of C.

Page 34: Kinetic Algorithms Data Structure for Mobile Data

2D Convex HullProof

The x-certificates prove the correctness of the contender edge pointer.

Any vertex that has a y-certificate in L is also guaranteed to be placed in C’ and in C.

Page 35: Kinetic Algorithms Data Structure for Mobile Data

2D Convex HullProof

We can show that the vertices without y-certificates can not be placed differently in C and C’

Page 36: Kinetic Algorithms Data Structure for Mobile Data

2D Convex Hull Certificate updates

Lemma 2.2 The following

procedure correctly updates the certificate list when the configuration events happen

Page 37: Kinetic Algorithms Data Structure for Mobile Data

2D Convex Hull Analysis

Theorem 2.3• The KDS for maintaining the convex hull is

efficient, responsive, compact and local Proof

• Responsive: • Compact :• Local:• Efficient: in the worst case

O log(n)

O n2

Page 38: Kinetic Algorithms Data Structure for Mobile Data

2D Convex HullDemo

Demo

Page 39: Kinetic Algorithms Data Structure for Mobile Data

Closest Pair in 2DProblem definition

Given a set S of n moving points find the two closest points in S.

Traditional static algorithms are ill-adapted for the kinematisation.

Page 40: Kinetic Algorithms Data Structure for Mobile Data

Closest Pair in 2DStatic Algorithm

We divide the space around each vertex into six 60º wedges, the nearest neighbor of each point is the closest of the nearest neighbor in the six wedges.

ADD PICTURE

Page 41: Kinetic Algorithms Data Structure for Mobile Data

Closest Pair in 2DDefinitions

Dom(p): The right extending wedge that make ±30º angles with the x axis.

Circ(p, r): The circle of radius r centered at p.

We denote the closest pair in S, (a,b)

Page 42: Kinetic Algorithms Data Structure for Mobile Data

Closest Pair in 2DProblem definition

Lemma 3.1 Point b is not contained in Dom(p) for

any third point p with a to the left of b. Lemma 3.2

The leftmost point in Dom(a) is b.

Page 43: Kinetic Algorithms Data Structure for Mobile Data

Closest Pair in 2DContradictions

Lemma 3.1 Lemma 3.2

Page 44: Kinetic Algorithms Data Structure for Mobile Data

Closest Pair in 2DAlgorithm

The plane sweep algorithm performs a set of operation three times, for S rotated by 0 and ±60º.

Page 45: Kinetic Algorithms Data Structure for Mobile Data

Closest Pair in 2DAlgorithm

For each point p in S from right to left Set Cands(p) = Maxima Dom(p) Set lcand(p) to be the leftmost element of

cands(p) Delete points of Cands(p) from Maxima Insert p into Maxima at its proper place in

y-order Repeat for the three directions

Page 46: Kinetic Algorithms Data Structure for Mobile Data

Closest Pair in 2DAlgorithm

Analysis Sorting: Compute Cands(p): Finding lcand(p): in the worst case Splitting and inserting:

Total:

O n log(n)

O n log(n)

O log(n) O n

O log(n)

Page 47: Kinetic Algorithms Data Structure for Mobile Data

Closest Pair in 2DKinetisation

Certificates The projection of the point on x for S

rotated by 0 and ±60º. Each point belong to a maximum of six

certificates, involving is two neighbors in each of the three sorted order.

Page 48: Kinetic Algorithms Data Structure for Mobile Data

Closest Pair in 2DEvents

Three types of event: Change of order in x Change of order in ±60º

Page 49: Kinetic Algorithms Data Structure for Mobile Data

Closest Pair in 2DUpdates

Page 50: Kinetic Algorithms Data Structure for Mobile Data

Closest Pair in 2DUpdates

Page 51: Kinetic Algorithms Data Structure for Mobile Data

Closest Pair in 2DAnalysis

The KDS for the closest pair problem is efficient, responsive, compact and local. Efficient: The number of events process

by the KDS is a logarithmic factor more then the maximum number of external events.

Page 52: Kinetic Algorithms Data Structure for Mobile Data

Closest Pair in 2DAnalysis

Compact:• There is events in the queue at any

time, for the certificates and for the kinetic tournament.

Local:• Each point belongs to ar most six

certificates and to at most three pair and in pair participate

to at most events in the kinetic tournament

)log(nO

nO33 n )(nO

)(, plcandp

Page 53: Kinetic Algorithms Data Structure for Mobile Data

Closest Pair in 2DDemo

Demo

Page 54: Kinetic Algorithms Data Structure for Mobile Data

Summary The way it works

Page 55: Kinetic Algorithms Data Structure for Mobile Data

Further Issues Avoid the problem related to the

finite precision arithmetic. (sequencing of the events)

Change the definition of efficiency to make it proportional to the number if external events

Adapt the algorithm to real time computation

Page 56: Kinetic Algorithms Data Structure for Mobile Data

References J. Basch and J.Guilbas. Data

Structures for Mobile Data. J. of Algorithms 31, 1-28 (1999).

J. Basch and al. Data Structures for Mobile Data. SODA 1997, 756-767.

http://graphics.stanford.edu