61
Well-Separated Pair Decomposition Seminar on Geometric Approximation Algorithms, Spring 2012 Eyal Altshuler

Well-Separated Pair Decomposition

  • Upload
    brand

  • View
    28

  • Download
    0

Embed Size (px)

DESCRIPTION

Seminar on Geometric Approximation Algorithms, Spring 2012 Eyal Altshuler. Well-Separated Pair Decomposition. Topics To Be Covered. Motivation WSPD – Basic Definitions WSPD – The Construction Algorithm Applications of WSPD Approximating the diameter Closest pair Spanners - PowerPoint PPT Presentation

Citation preview

Page 1: Well-Separated Pair Decomposition

Well-Separated Pair Decomposition

Seminar on Geometric Approximation Algorithms, Spring 2012Eyal Altshuler

Page 2: Well-Separated Pair Decomposition

Topics To Be Covered

Motivation WSPD – Basic Definitions WSPD – The Construction Algorithm Applications of WSPD

Approximating the diameter Closest pair Spanners Approximated minimum spanning tree

Page 3: Well-Separated Pair Decomposition

Motivation Given a set P of points in , We want to

represent the distances between them efficiently

Suggestions: ▪ explicitly listing the distances

▪ listing arrays of coordinates

We will see a more compact representation

Page 4: Well-Separated Pair Decomposition

Motivation Suppose that all we care about are approximate

distances

Want to capture that: s and q are close together as far as p is concerned s and q have the “same distance” from p

A “spoiler” for today’s data structure: () We will see how to build it

p

q

s

Page 5: Well-Separated Pair Decomposition

WSPD – Basic Definitions

[ All works in , we will concentrate on ]

Let P be a set of n points in

Page 6: Well-Separated Pair Decomposition

WSPD – Basic Definitions

Denote by

The set of all (unordered) pairs of points formed by two sets of points – A and B

Informally we will refer to as the pair of the sets A and B

Page 7: Well-Separated Pair Decomposition

WSPD – Basic Definitions

For a point set P, a pair decomposition of P is a set of pairs –

such that:▪ for every i▪ = for every i▪ =

Page 8: Well-Separated Pair Decomposition

WSPD – Basic Definitions

The pair Q and R is (-separated if

where

Page 9: Well-Separated Pair Decomposition

WSPD – Basic Definitionsmax (𝑑𝑖𝑎𝑚 (𝑄 ) , 𝑑𝑖𝑎𝑚 (𝑅 ) )≤𝜀∗𝒅 (𝑄 ,𝑅 )

Q

R

Page 10: Well-Separated Pair Decomposition

WSPD – Basic Definitions

For a point set P, a well-separated pair decomposition (WSPD) of P with parameter ( is a pair decomposition of P with a set of pairs-

such that, for any i, the sets and are ( separated

Page 11: Well-Separated Pair Decomposition

Example

a b

c

d e

f

Page 12: Well-Separated Pair Decomposition

Building a WSPD

How to represent a WSPD efficiently? Construct a Tree T having the points

of P as leaves.

Every Pair {} will be just a pair of nodes (, such that

denotes the points of P stored in the sub-tree of v

Page 13: Well-Separated Pair Decomposition

Reminder - Quadtrees

a b

c

d e

f

Page 14: Well-Separated Pair Decomposition

Reminder - Quadtrees

a

b c

d f e

a b

c

d e

f

Page 15: Well-Separated Pair Decomposition

Reminder - Quadtrees

Denote by the cell that contains the points that are in the subtree of v

Working with compressed quadtrees – time construction

Page 16: Well-Separated Pair Decomposition

Building a WSPD

Build T as a compressed quadtree

a

b c

d f e

Page 17: Well-Separated Pair Decomposition

Building a WSPD

Find the pairs of vertices that define a WSPD

a

b c

d f e

Page 18: Well-Separated Pair Decomposition

Notes

The quadtree decomposes the points such that the diameter of a point set stored in a node drops quickly as we go down the tree

A given tree can be used to represent many possible WSPDs. We are looking for the WSPD that is “minimal”

Page 19: Well-Separated Pair Decomposition

Notes Suppose we find, for a given , the pairs of

nodes that represent -separated point sets

This is the WSPD compact representation we want to achieve

It will be convenient, for each point set in a pair, to choose an arbitrary representative. Calculating distances between pairs will be done using these representatives

Page 20: Well-Separated Pair Decomposition

The Construction Algorithm Given – A set of n points P in

First, compute the quadtree T of P

Next, be greedy – by calling

algWSPD(root,root)

Page 21: Well-Separated Pair Decomposition

Some More Definitions

- the “diameter” of the cell associated with

for a leaf, otherwise

Page 22: Well-Separated Pair Decomposition

Examples

a

b c

d f

e

a b

c

d e

f

v

u

g g

?

Page 23: Well-Separated Pair Decomposition

Examples

a

b c

d f

e

a b

c

d e

f

v

u

g g

? 0

Page 24: Well-Separated Pair Decomposition

Examples

a

b c

d f

e

a b

c

d e

f

v

u

g g

𝒅 (𝑢 ,𝑣 )?

Page 25: Well-Separated Pair Decomposition

algWSPD(u,v) If and then

return // Don’t pair a leaf with itself

If then Exchange and

If then return

// - the children of return

Page 26: Well-Separated Pair Decomposition

Analysis

Computing the com-pressed quadtree T of P can be done in time (see previous lecture)

We will prove that constructing an -WSPD takes time

running time

Page 27: Well-Separated Pair Decomposition

Analysis

Lemma 1: Let be a cell of a grid G of with cell

diameter . For , the number of cells in G at distance at most from is

Proof:

x yy

y

y

Page 28: Well-Separated Pair Decomposition

Analysis

Lemma 2 (validity): algWSPD terminates and computes a

valid pair decomposition

Proof: Termination – always stops if both and

are leaves Every pair of points is covered – by

induction Every pair is valid -

Page 29: Well-Separated Pair Decomposition

Analysis

Lemma 3: (-WSPD) For the WSPD generated by algWSPD,

we have that for any pair in the WSPD,

and , for any ,

Page 30: Well-Separated Pair Decomposition

Analysis

Proof:𝑃𝑢𝑃𝑣

𝑑𝑖𝑎𝑚 (𝑃𝑢)≤△ (𝑢)𝑑𝑖𝑎𝑚 (𝑃𝑣 )≤△ (𝑣 )

,

Page 31: Well-Separated Pair Decomposition

Analysis

We got that the algorithm always return a valid -WSPD.

Note that the running time of the algorithm is clearly linear in its output size.

So, what is the output size?

Page 32: Well-Separated Pair Decomposition

Analysis

For a pair computed by algWSPD, we have that-

where denotes that parent of in T

Page 33: Well-Separated Pair Decomposition

Analysis

[

Proof: Trivial that-

Let us show that

Page 34: Well-Separated Pair Decomposition

Analysis

[

Consider the set of recursive calls𝑎𝑙𝑔𝑊𝑆𝑃𝐷 (𝑢𝑜 ,𝑢0)

𝑎𝑙𝑔𝑊𝑆𝑃𝐷 (𝑢1 ,𝑣1)

𝑎𝑙𝑔𝑊𝑆𝑃𝐷 (𝑢𝑠=𝑢 ,𝑣 𝑠=𝑣)

Page 35: Well-Separated Pair Decomposition

Analysis

[

Assume

𝑎𝑙𝑔𝑊𝑆𝑃𝐷 (𝑢𝑜 ,𝑢0)

𝑎𝑙𝑔𝑊𝑆𝑃𝐷 (𝑢1 ,𝑣1)

𝑎𝑙𝑔𝑊𝑆𝑃𝐷 (𝑢𝑠=𝑢 ,𝑣 𝑠=𝑣)

Page 36: Well-Separated Pair Decomposition

Analysis

[ Assume

Clearly,

△ (𝑢) △𝑝 (𝑣)

Page 37: Well-Separated Pair Decomposition

Analysis

[ Similarly consider the index t where-

Clearly,

△ (𝑣𝑡 −1)△𝑝 (𝑢)

Page 38: Well-Separated Pair Decomposition

Analysis

Lemma: (WSPD’s size)The number of pairs in the computed WSPD is

Corollary: For , one can construct an -WSPD of size , and the construction time is

Page 39: Well-Separated Pair Decomposition

Analysis

Proof: Suppose in the output Suppose was called by

“charge” for that Show that can’t be charged too

much

Page 40: Well-Separated Pair Decomposition

Analysis

If:

Then: △ (𝑢) △ (𝑝 (𝑢))

△ (𝑣 ′ )

Page 41: Well-Separated Pair Decomposition

Analysis

In addition-

Because the pair is not in the output

Denote-

Page 42: Well-Separated Pair Decomposition

Analysis

Suppose the three possibilities Each one can happen at most times

(show on board)

There are n possible s, thus the total number of charges is

△ (𝑢) △ (𝑝 (𝑢))△ (𝑣 ′ )

Page 43: Well-Separated Pair Decomposition

Applications

Page 44: Well-Separated Pair Decomposition

remember from algWSPD For an -WSPD , it holds, for any pair ,

that:

Will be very important in the application side

Page 45: Well-Separated Pair Decomposition

Applications – Approximating The Diameter Given a set P of n points in , find a

pair such that , where is the diameter of P

Approximation vs. time, space

Page 46: Well-Separated Pair Decomposition

Applications – Approximating The Diameter

Page 47: Well-Separated Pair Decomposition

Applications – Approximating The Diameter The affect of choosing the correct

epsilon Compute a -WSPD W of P

From the result-

Return the representatives of that have maximal distance between them

Page 48: Well-Separated Pair Decomposition

Applications – Approximating The Diameter

𝑃𝑢

𝑃𝑣

q

s

𝑑(𝑢 ,𝑣 )

Page 49: Well-Separated Pair Decomposition

Applications – Approximating The Diameter Consider the pair realizing the

diameter of P Let be the pair that contain the

points 𝑃𝑢

𝑃𝑣

q

s

𝑑(𝑢 ,𝑣 )

Page 50: Well-Separated Pair Decomposition

Applications – Closest Pair Let P be a set of points in . We would

like to compute the closest pair. (first lecture)

Let be an -WSPD.

Let us look at closest points p and q in P, and consider the pair that separates them

Page 51: Well-Separated Pair Decomposition

Applications – Closest Pair𝑃𝑢

𝑃𝑣p

s q

‖𝑝−𝑠‖≤𝑑𝑖𝑎𝑚 (𝑃𝑢)≤ 𝜀∗𝑑 (𝑢 ,𝑣 )≤ 𝜀‖𝑝−𝑞‖<‖𝑝−𝑞‖Contradiction for

Page 52: Well-Separated Pair Decomposition

Applications – Closest Pair Thus, The pair of the closest points

will contain the as singletons

Compute a 2-WSPD ( ) Scan all the pairs of W, and take the

minimum distance between pairs that connects singletons

=

Page 53: Well-Separated Pair Decomposition

Applications - spanners

Describe distances between n points by using a sparse graph

Useful if it has edges

Implicit representation of all the (approximated) distances

Page 54: Well-Separated Pair Decomposition

Applications - spanners

The model -

Graph distance - for every

Page 55: Well-Separated Pair Decomposition

Applications - spanners

A t-spanner of a set of points is a weighted graph

For any we have-

t is called the stretch of q and s in G

The stretch of G is the maximal stretch between two points

Page 56: Well-Separated Pair Decomposition

Applications - spanners

Theorem: Given a set P of n points in and a

parameter , we can construct a -spanner of P

Num of edges - ) time

Page 57: Well-Separated Pair Decomposition

Applications - spanners

Let C be an arbitrary constant Denote

Compute a -WSPD For every pair , add an edge

between and with weight

Correctness: by induction

Page 58: Well-Separated Pair Decomposition

Applications - spanners

𝑑

𝑃𝑢𝑃𝑣

𝑥𝑦

𝑟𝑒𝑝𝑢𝑟𝑒𝑝𝑣

Page 59: Well-Separated Pair Decomposition

Applications- Approximated Minimum Spanning Tree Given a point set P of n points,

compute a spanning tree T of weight-

Where M is a minimum spanning tree

, compared to deterministic

Page 60: Well-Separated Pair Decomposition

Applications- Approximated Minimum Spanning Tree Compute a -spanner G of P

Compute a MST(G), and return it

Intuitively – use spanner as sparse graph, it will be approximated enough for a minimum spanning tree

Page 61: Well-Separated Pair Decomposition

Applications- Approximated Minimum Spanning Tree Computation time –

Required approximation- - shortest path in G By spanners - ) Find a spanning sub-graph of

of weight