cs 372: computational geometry lecture 4 lower bounds for ... · element distinctness theorem in...

28
CS 372: Computational Geometry Lecture 4 Lower Bounds for Computational Geometry Problems Antoine Vigneron King Abdullah University of Science and Technology September 20, 2012 Antoine Vigneron (KAUST) CS 372 Lecture 4 September 20, 2012 1 / 28

Upload: others

Post on 22-Sep-2020

4 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: CS 372: Computational Geometry Lecture 4 Lower Bounds for ... · Element Distinctness Theorem In the algebraic computation tree model, the complexity of element distinctness is (

CS 372: Computational GeometryLecture 4

Lower Bounds for Computational Geometry Problems

Antoine Vigneron

King Abdullah University of Science and Technology

September 20, 2012

Antoine Vigneron (KAUST) CS 372 Lecture 4 September 20, 2012 1 / 28

Page 2: CS 372: Computational Geometry Lecture 4 Lower Bounds for ... · Element Distinctness Theorem In the algebraic computation tree model, the complexity of element distinctness is (

1 Introduction

2 Algebraic computation trees

3 Topological lower bound

4 Discussion

5 3SUM-hardness

Antoine Vigneron (KAUST) CS 372 Lecture 4 September 20, 2012 2 / 28

Page 3: CS 372: Computational Geometry Lecture 4 Lower Bounds for ... · Element Distinctness Theorem In the algebraic computation tree model, the complexity of element distinctness is (

OutlineHardness results for some geometric problems.

Examples:

Line segment intersection detection.

Diameter of a point-set.

Degeneracy testing.

Two techniques:

Topological lower bound.

Reduction from 3-SUM.

References:

Textbook by Preparata and Shamos.

Dave Mount’s lecture notes, Lecture 26.

Ben-Or’s paper.

Gajentaan and Overmars paper.

Antoine Vigneron (KAUST) CS 372 Lecture 4 September 20, 2012 3 / 28

Page 4: CS 372: Computational Geometry Lecture 4 Lower Bounds for ... · Element Distinctness Theorem In the algebraic computation tree model, the complexity of element distinctness is (

Introduction

In the algorithms course (CS 260), you saw that:

Theorem (Lower bound for sorting)

Any comparison-based sorting algorithm makes Ω(n log n) comparisons inthe worst case.

Proof (sketch):

Model the algorithm as a binary decision tree.

Each internal node is a comparison, branching to its two children.

There are n! possible outcomes, i.e. permutation of the input.

Hence there are at least n! leaves.

So the tree has height Ω(log(n!)) = Ω(n log n).

Antoine Vigneron (KAUST) CS 372 Lecture 4 September 20, 2012 4 / 28

Page 5: CS 372: Computational Geometry Lecture 4 Lower Bounds for ... · Element Distinctness Theorem In the algebraic computation tree model, the complexity of element distinctness is (

Introduction

In Lecture 2, we showed that it yields the same Ω(n log n) lower bound forcomputing a convex hull.

Proof: After mapping a set of numbers to a parabola, the numbersappear in sorted order along the convex hull.

So the argument holds because a convex hull algorithm outputs apoint sequence.

This argument does not work if the output has constant size.Examples:

Intersection detection. (Output: a boolean.)

Diameter. (Output: a real number.)

We will give a different technique that yields an Ω(n log n) lower bound forthese two problems, and others.

Antoine Vigneron (KAUST) CS 372 Lecture 4 September 20, 2012 5 / 28

Page 6: CS 372: Computational Geometry Lecture 4 Lower Bounds for ... · Element Distinctness Theorem In the algebraic computation tree model, the complexity of element distinctness is (

Algebraic Computation Trees

fv1 := x3 − x1Node v1:

fv1 ≥ 0?Node v3:

fv2 ≥ 0? fv2 ≥ 0?

≥ <

fv2 := x4 − x2Node v2:

v4 v5

≥ <

fv6 := x2 − x3 YES fv8 := x4 − x1YES

≥ <

fv6 ≥ 0? fv8 ≥ 0?≥

YES NO

<

YES NO

≥<

Example (1)

Given (x1, x2, x3, x4) ∈ R4

such that x1 6 x2 andx3 6 x4, this AlgebraicComputation Tree (ACT)decides whether[x1, x2] ∩ [x3, x4] 6= ∅.

Antoine Vigneron (KAUST) CS 372 Lecture 4 September 20, 2012 6 / 28

Page 7: CS 372: Computational Geometry Lecture 4 Lower Bounds for ... · Element Distinctness Theorem In the algebraic computation tree model, the complexity of element distinctness is (

Algebraic Computation Trees

fv1 := x3 − x1Node v1:

fv3 := fv1× fv2Node v3:

fv2 := x6 − x2Node v2:

NOYES

fv4 := x5 − x1Node v4:

fv6 := fv4× fv5Node v6:

fv5 := x4 − x2Node v5:

fv7 := fv3− fv6Node v7:

fv7 > 0?Node v8:

Example (CCW predicate)

Given (x1, x2, x3, x4, x5, x6) ∈ R6, thisACT decides whether the triangle((x1, x2), (x3, x4), (x5, x6)) iscounterclockwise.

Antoine Vigneron (KAUST) CS 372 Lecture 4 September 20, 2012 7 / 28

Page 8: CS 372: Computational Geometry Lecture 4 Lower Bounds for ... · Element Distinctness Theorem In the algebraic computation tree model, the complexity of element distinctness is (

Algebraic Computation TreesFormal definition from Ben-Or’s paper:

Definition (Algebraic computation tree)

An algebraic computation tree with input (x1, . . . , xn) ∈ Rn is a binary treeT with a function that assigns:

to any vertex v with exactly one child an operational instruction ofthe form

fv := f 1v f 2

v or fv := c f 1v or fv :=

√f 1v

where f iv = fvi for an ancestor vi of v , or f i

v ∈ x1, . . . , xn, ∈ +,−,×, /, and c ∈ R is a constant.

to any vertex v with two children (branching vertex) a test instructionof the form

f 1v > 0 or f 1

v > 0 or f 1v = 0.

where f 1v is fv1 for an ancestor v1 of v , or f 1

v ∈ x1, . . . , xn.to any leaf an output YES or NO.

Antoine Vigneron (KAUST) CS 372 Lecture 4 September 20, 2012 8 / 28

Page 9: CS 372: Computational Geometry Lecture 4 Lower Bounds for ... · Element Distinctness Theorem In the algebraic computation tree model, the complexity of element distinctness is (

Algebraic Computation Trees

Informally:

Given an input x = (x1, . . . , xn) ∈ Rn, the program traverses a pathP(x) from the root to a leaf of T .

Along the path, it applies operations +,−, /,×,√· to input numbersxi or intermediate results obtained at previous nodes along P(x).

It may also branch using a test >,>,=.

At the leaf, it outputs YES or NO.

Definition

Let T be an algebraic computation tree with input x ∈ Rn. Let W ⊂ Rn

be the set of points x ∈ Rn such that T outputs YES. We say that Tdecides W .

Antoine Vigneron (KAUST) CS 372 Lecture 4 September 20, 2012 9 / 28

Page 10: CS 372: Computational Geometry Lecture 4 Lower Bounds for ... · Element Distinctness Theorem In the algebraic computation tree model, the complexity of element distinctness is (

Topological Lower Bound

Theorem (Ben-Or, 1983)

Any algebraic computation tree that decides a set W ⊂ Rn has heightΩ(log(#W )− n), where #W is the number of connected components ofW .

Interpretation:

The height of an ACT is its worst-case running time.

A program can often be unfolded onto an ACT.I Then its worst-case running time is at least the height of the ACT.

But some operations cannot be simulated by an ACT in O(1) time.Examples:

I The floor function.I Bitwise operations on integers (AND, OR, XOR).I Random number generation.

Antoine Vigneron (KAUST) CS 372 Lecture 4 September 20, 2012 10 / 28

Page 11: CS 372: Computational Geometry Lecture 4 Lower Bounds for ... · Element Distinctness Theorem In the algebraic computation tree model, the complexity of element distinctness is (

Element Distinctness

Problem (Element Distinctness)

Determine whether the elements of a list of numbers are distinct. That is,given (x1, . . . , xn) ∈ Rn, determine whether xi 6= xj for all i 6= j .

Let W + denote the set of positive instances of Element Distinctness:

W + = (x1, . . . , xn) ∈ Rn | ∀i 6= j , xi 6= xj.

Note that an instance of Element Distinctness is modeled as a singlepoint in Rn. Hence W + is a subset of Rn.

How many connected components are there in W +?

Antoine Vigneron (KAUST) CS 372 Lecture 4 September 20, 2012 11 / 28

Page 12: CS 372: Computational Geometry Lecture 4 Lower Bounds for ... · Element Distinctness Theorem In the algebraic computation tree model, the complexity of element distinctness is (

Element Distinctness

Lemma

The set W + of positive instances of Element Distinctness has exactly n!connected components.

Proof.

Done in class.

Antoine Vigneron (KAUST) CS 372 Lecture 4 September 20, 2012 12 / 28

Page 13: CS 372: Computational Geometry Lecture 4 Lower Bounds for ... · Element Distinctness Theorem In the algebraic computation tree model, the complexity of element distinctness is (

Element Distinctness

Theorem

In the algebraic computation tree model, the complexity of elementdistinctness is Θ(n log n).

Proof.

By Ben-Or’s theorem, since W + has n! connected components, any ACTsolving the element distinctness problem has height Ω(log(n!)− n), whichis Ω(n log n).

Conversely, there is an ACT with depth O(n log n) that solves elementdistinctness: First it sorts the input, then checks consecutive values. Forinstance, mergesort can be unfolded into a Θ(n log n)-depth ACT.

Antoine Vigneron (KAUST) CS 372 Lecture 4 September 20, 2012 13 / 28

Page 14: CS 372: Computational Geometry Lecture 4 Lower Bounds for ... · Element Distinctness Theorem In the algebraic computation tree model, the complexity of element distinctness is (

Element Distinctness

Let W− denote the set of negative instances of Element Distinctness:

W− = Rn \W +.

How many connected components are there in W−?

Antoine Vigneron (KAUST) CS 372 Lecture 4 September 20, 2012 14 / 28

Page 15: CS 372: Computational Geometry Lecture 4 Lower Bounds for ... · Element Distinctness Theorem In the algebraic computation tree model, the complexity of element distinctness is (

Application: Line Segment Intersection Detection

Theorem

Any ACT that solves the line segment intersection detection problem hasheight Ω(n log n). Hence, the complexity of line segment intersectiondetection is Θ(n log n) in the ACT model.

Proof.

Suppose T is an ACT that solves the line segment intersection detectionproblem. Let (x1, . . . , xn) ∈ Rn. We construct an ACT T ′ by plugging(x1, 0, x1, 1, x2, 0, x2, 1, . . . , xn, 0, xn, 1) to the input of T . That is, T ′

detects intersection between the segments [(xi , 0), (xi , 1)]. So T ′ solvesthe element distinctness problem. Thus height(T ′) = Ω(n log n). But byconstruction, height(T ′) = height(T ) + 4n. Thereforeheight(T ) = Ω(n log n).

Antoine Vigneron (KAUST) CS 372 Lecture 4 September 20, 2012 15 / 28

Page 16: CS 372: Computational Geometry Lecture 4 Lower Bounds for ... · Element Distinctness Theorem In the algebraic computation tree model, the complexity of element distinctness is (

Set Disjointness

Problem (Set Disjointness)

Given two sequences (a1, . . . , an) ⊂ R and (b1, . . . , bm) ⊂ R such thatm 6 n, determine whether there exists a pair i , j such that ai = bj .

Theorem

Any ACT that solves the set disjointness problem has height Ω(n log n).

Proof?

Done in class.

Note: The numbers a1, . . . , an are not necessarily distinct, so a directreduction to Element Distinctness fails.

Antoine Vigneron (KAUST) CS 372 Lecture 4 September 20, 2012 16 / 28

Page 17: CS 372: Computational Geometry Lecture 4 Lower Bounds for ... · Element Distinctness Theorem In the algebraic computation tree model, the complexity of element distinctness is (

Diameter

P

diam(P )

Problem (Diameter of a Point-Set)

The diameter diam(P) of a set P = p1, . . . , pn of n points is themaximum distance between any two points:

diam(P) = maxi ,j

d(pi , pj).

Antoine Vigneron (KAUST) CS 372 Lecture 4 September 20, 2012 17 / 28

Page 18: CS 372: Computational Geometry Lecture 4 Lower Bounds for ... · Element Distinctness Theorem In the algebraic computation tree model, the complexity of element distinctness is (

Maximum Gap

Problem (maximum gap)

Given a set of n (unsorted) numbers, the maximum gap problem is to findthe largest gap between two consecutive numbers in sorted order.

Example:

INPUT: 0.5, 2, 5, 4.5, -1

OUTPUT: 2.5

−1 0.5 2 4.5 5

0Maxgap

Antoine Vigneron (KAUST) CS 372 Lecture 4 September 20, 2012 18 / 28

Page 19: CS 372: Computational Geometry Lecture 4 Lower Bounds for ... · Element Distinctness Theorem In the algebraic computation tree model, the complexity of element distinctness is (

Optimization Algorithms

The ACT model deals with decision problems: problems with aYES-NO answer.

We will abuse notation and use ACTs for optimization problems:I The 2D-diameter problem.I Maximum gap.

In fact, our lower bound argument will be for the associated decisionproblems: For some δ ∈ R,

I Is the diameter at least δ?I Is the maximum gap at most δ?

An optimization problem is at least as hard as the correspondingdecision problem, because once you have the optimal value, you cancompare it with δ in O(1) time.

So a lower bound on the decision problem implies a lower bound onthe optimization problem.

Antoine Vigneron (KAUST) CS 372 Lecture 4 September 20, 2012 19 / 28

Page 20: CS 372: Computational Geometry Lecture 4 Lower Bounds for ... · Element Distinctness Theorem In the algebraic computation tree model, the complexity of element distinctness is (

Diameter

Ox

y

y = bjx

y = aix

pi

p′j

1

1

Given an instance A,B of setdisjointness, we map A to theright side and B to the leftside of the unit circle,respectively.

Antoine Vigneron (KAUST) CS 372 Lecture 4 September 20, 2012 20 / 28

Page 21: CS 372: Computational Geometry Lecture 4 Lower Bounds for ... · Element Distinctness Theorem In the algebraic computation tree model, the complexity of element distinctness is (

Diameter

Ox

y

pi

p′j

1

1

The diameter is 2 iff twopoints pi , p

′j are diametrically

opposed, that is ai = bj .

Antoine Vigneron (KAUST) CS 372 Lecture 4 September 20, 2012 21 / 28

Page 22: CS 372: Computational Geometry Lecture 4 Lower Bounds for ... · Element Distinctness Theorem In the algebraic computation tree model, the complexity of element distinctness is (

Diameter

Theorem

In the ACT model, the complexity of the 2D-diameter problem isΩ(n log n).

Proof.

An instance of set disjointness is mapped to the unit circle as follows:

Each ai is mapped to the point pi = (xi , yi ) such that yi = aixi ,xi > 0, and x2

i + y2i = 1.

Each bj is mapped to the point p′j = (x ′j , y′j ) such that yj = bjxj ,

xj < 0, and x2j + y2

j = 1.

Then the diameter of p1, . . . , pn, p′1, . . . , p

′n is 2 iff pi = −p′j for some

i , j , which means that ai = bj and hence A ∩ B 6= ∅.

Remark: it is crucial in this argument that the coordinates of pi and p′i canbe computed in constant time by an ACT.

Antoine Vigneron (KAUST) CS 372 Lecture 4 September 20, 2012 22 / 28

Page 23: CS 372: Computational Geometry Lecture 4 Lower Bounds for ... · Element Distinctness Theorem In the algebraic computation tree model, the complexity of element distinctness is (

Maximum Gap

Theorem

In the ACT model, the maximum gap problem has complexity Θ(n log n).

Proof?

Problem: there is a simple O(n)-time algorithm.

This linear-time algorithm uses the floor-function, hence it cannot betranslated into an ACT.

Antoine Vigneron (KAUST) CS 372 Lecture 4 September 20, 2012 23 / 28

Page 24: CS 372: Computational Geometry Lecture 4 Lower Bounds for ... · Element Distinctness Theorem In the algebraic computation tree model, the complexity of element distinctness is (

Discussion

It would seem that the ACT model is not powerful enough, as the lowerbound for maxgap can be broken using the floor function.

However, it is not reasonable to allow the use of the floor function:It has been proved that the floor function together with +,−,×, /allows to solve NP-hard problems in polynomial time.(Schonhage, On the power of random access machines, ICALP 79.)

In fact, the ACT model is very powerful:

It allows exact computation in constant time per arithmetic operation.

Even with high degree polynomials, or square roots.

Antoine Vigneron (KAUST) CS 372 Lecture 4 September 20, 2012 24 / 28

Page 25: CS 372: Computational Geometry Lecture 4 Lower Bounds for ... · Element Distinctness Theorem In the algebraic computation tree model, the complexity of element distinctness is (

Discussion

Ben-Or’s theorem often gives Ω(n log n) lower bounds for geometricproblems.

Optimal for several fundamental problems. (Intersection detection,2D-diameter...)

But it often gives the same bound in cases where no near-linear timealgorithm is known.

I Example: 4D diameter, Hopcroft’s problem.I Does not always give Ω(n log n): it gives Ω(n2) for knapsack. But this

problem is NP-hard.

Another approach: show that your problem is harder than somewell-known problem, for which no near-linear time algorithm is known.

3-SUM. Best algorithm runs in O(n2). (See following slides.)

Hopcroft’s problem. Best algorithm runs in roughly O(n4/3).

Antoine Vigneron (KAUST) CS 372 Lecture 4 September 20, 2012 25 / 28

Page 26: CS 372: Computational Geometry Lecture 4 Lower Bounds for ... · Element Distinctness Theorem In the algebraic computation tree model, the complexity of element distinctness is (

3SUM

Problem (3SUM)

Given a set S of n real numbers, is there a triple a, b, c ∈ S such thata + b + c = 0?

3SUM can be solved in O(n2) time. (How?)

There is an Ω(n log n) lower bound in the ACT model. (How?)

Despite a lot of effort, no better bound is known with usual models ofcomputation.

Hence, if we can argue that a problem is harder than 3SUM, it meansthat an o(n2)-time algorithm is currently out of reach.

Antoine Vigneron (KAUST) CS 372 Lecture 4 September 20, 2012 26 / 28

Page 27: CS 372: Computational Geometry Lecture 4 Lower Bounds for ... · Element Distinctness Theorem In the algebraic computation tree model, the complexity of element distinctness is (

3SUM-Hardness

Definition (3SUM-hard)

A problem is 3SUM-hard if an o(n2)-time algorithm for this problemimplies an o(n2)-time algorithm for 3SUM.

We give an example in the next slide. Other examples can be found in thepaper by Gajentaan and Overmars, for instance.

Antoine Vigneron (KAUST) CS 372 Lecture 4 September 20, 2012 27 / 28

Page 28: CS 372: Computational Geometry Lecture 4 Lower Bounds for ... · Element Distinctness Theorem In the algebraic computation tree model, the complexity of element distinctness is (

3SUM-Hardness

Problem (2D degeneracy-testing)

Given a set P of n points in the plane, the 2D degeneracy-testing problemis to decide whether there are three collinear points in P.

Theorem

2D degeneracy-testing is 3SUM-hard.

Proof.

Based on the following fact:For any three distinct numbers a, b, c ,a + b + c = 0 iff the points (a, a3), (b, b3), (c , c3) are collinear.

Antoine Vigneron (KAUST) CS 372 Lecture 4 September 20, 2012 28 / 28