Trapezoidal decomposition:

Similar documents
Randomized incremental construction. Trapezoidal decomposition: Special sampling idea: Sample all except one item

Field: We have been doing geometry eg linear programming. But in computational geometry, key difference in focus: low dimension d

Linear Programming in Small Dimensions

SAMPLING AND THE MOMENT TECHNIQUE. By Sveta Oksen

Trapezoidal Maps. Notes taken from CG lecture notes of Mount (pages 60 69) Course page has a copy

Line Arrangements. Applications

9 Bounds for the Knapsack Problem (March 6)

6.856 Randomized Algorithms

CMSC 754 Computational Geometry 1

Today. Types of graphs. Complete Graphs. Trees. Hypercubes.

Notes on Binary Dumbbell Trees

Non-context-Free Languages. CS215, Lecture 5 c

1. Meshes. D7013E Lecture 14

/ Approximation Algorithms Lecturer: Michael Dinitz Topic: Linear Programming Date: 2/24/15 Scribe: Runze Tang

Figure 4.1: The evolution of a rooted tree.

Linear Programming Duality and Algorithms

Treewidth and graph minors

6 Randomized rounding of semidefinite programs

(2,4) Trees. 2/22/2006 (2,4) Trees 1

On Clarkson s Las Vegas Algorithms for Linear and Integer Programming When the Dimension is Small

Computational Geometry

Integer Programming ISE 418. Lecture 7. Dr. Ted Ralphs

Problem: Polygon Triangulation. Trapezoidal Map. Solution via Trapezoidal Map. The trapezoidal map of non-crossing line segments

Solutions to relevant spring 2000 exam problems

Computational Geometry

CS 372: Computational Geometry Lecture 10 Linear Programming in Fixed Dimension

Polygon Triangulation. (slides partially by Daniel Vlasic )

Polygon Triangulation. (slides partially by Daniel Vlasic )

Lecture 3: Art Gallery Problems and Polygon Triangulation

Lecture 3: Graphs and flows

We will show that the height of a RB tree on n vertices is approximately 2*log n. In class I presented a simple structural proof of this claim:

(2,4) Trees Goodrich, Tamassia (2,4) Trees 1

Algorithms for Euclidean TSP

Computing intersections in a set of line segments: the Bentley-Ottmann algorithm

Lecture 20 : Trees DRAFT

Lecture 5: Suffix Trees

Friday Four Square! 4:15PM, Outside Gates

Design and Analysis of Algorithms

THE EULER TOUR TECHNIQUE: EVALUATION OF TREE FUNCTIONS

CSCI2100B Data Structures Trees

Trees. 3. (Minimally Connected) G is connected and deleting any of its edges gives rise to a disconnected graph.

Algorithms. Red-Black Trees

14 More Graphs: Euler Tours and Hamilton Cycles

kd-trees Idea: Each level of the tree compares against 1 dimension. Let s us have only two children at each node (instead of 2 d )

The Simplex Algorithm for LP, and an Open Problem

Recitation 9. Prelim Review

Range Searching and Windowing

Parallel and Sequential Data Structures and Algorithms Lecture (Spring 2012) Lecture 16 Treaps; Augmented BSTs

Planar Point Location

Lecture Notes 2: The Simplex Algorithm

Theorem 2.9: nearest addition algorithm

THE EULER TOUR TECHNIQUE: EVALUATION OF TREE FUNCTIONS

Optimization I : Brute force and Greedy strategy

Matching Algorithms. Proof. If a bipartite graph has a perfect matching, then it is easy to see that the right hand side is a necessary condition.

4 Basics of Trees. Petr Hliněný, FI MU Brno 1 FI: MA010: Trees and Forests

Coverage Approximation Algorithms

CMPSCI611: The Simplex Algorithm Lecture 24

Binary Trees

CS251-SE1. Midterm 2. Tuesday 11/1 8:00pm 9:00pm. There are 16 multiple-choice questions and 6 essay questions.

In this lecture, we ll look at applications of duality to three problems:

Fundamental Properties of Graphs

Discrete mathematics

CS 161 Lecture 11 BFS, Dijkstra s algorithm Jessica Su (some parts copied from CLRS) 1 Review

U.C. Berkeley CS170 : Algorithms, Fall 2013 Midterm 1 Professor: Satish Rao October 10, Midterm 1 Solutions

Lecture 3 Randomized Algorithms

10. EXTENDING TRACTABILITY

Chapter 11: Graphs and Trees. March 23, 2008

Lecture notes on the simplex method September We will present an algorithm to solve linear programs of the form. maximize.

An Implementation of a Near-Linear Polygon Triangulation Algorithm for General Polygons

J Linear Programming Algorithms

Lecture 3 February 9, 2010

Assignment 5: Solutions

Brief History. Graph Theory. What is a graph? Types of graphs Directed graph: a graph that has edges with specific directions

Week 5. Convex Optimization

CS70 - Lecture 6. Graphs: Coloring; Special Graphs. 1. Review of L5 2. Planar Five Color Theorem 3. Special Graphs:

Polygon Partitioning. Lecture03

Orthogonal Range Search and its Relatives

CS675: Convex and Combinatorial Optimization Spring 2018 Consequences of the Ellipsoid Algorithm. Instructor: Shaddin Dughmi

1 i n (p i + r n i ) (Note that by allowing i to be n, we handle the case where the rod is not cut at all.)

Delaunay Triangulations

Exercise set 2 Solutions

Solving LP in polynomial time

! Linear programming"! Duality "! Smallest enclosing disk"

Question 7.11 Show how heapsort processes the input:

Design and Analysis of Algorithms (VII)

Graph theory. Po-Shen Loh. June We begin by collecting some basic facts which can be proved via bare-hands techniques.

Uses for Trees About Trees Binary Trees. Trees. Seth Long. January 31, 2010

princeton univ. F 15 cos 521: Advanced Algorithm Design Lecture 2: Karger s Min Cut Algorithm

Dist(Vertex u, Vertex v, Graph preprocessed) return u.dist v.dist

Advanced Operations Research Techniques IE316. Quiz 1 Review. Dr. Ted Ralphs

implementing the breadth-first search algorithm implementing the depth-first search algorithm

Quiz 1 Solutions. (a) f(n) = n g(n) = log n Circle all that apply: f = O(g) f = Θ(g) f = Ω(g)

Discrete mathematics II. - Graphs

Integer Programming Theory

Given a graph, find an embedding s.t. greedy routing works

Lecture 4: September 11, 2003

11.9 Connectivity Connected Components. mcs 2015/5/18 1:43 page 419 #427

4 Fractional Dimension of Posets from Trees

Computational Geometry

Fixed-Parameter Algorithms, IA166

Transcription:

Trapezoidal decomposition: Motivation: manipulate/analayze a collection of segments e.g. detect segment intersections e.g., point location data structure Definition. Draw verticals at all points binary search for slab binary search inside slab problem: O(n 2 ) space draw altitudes from each intersection till hit a segment. trapezoid graph is planar (no crossing edges) each trapezoid is a face show a face. one face may have many vertices (from altitudes that hit the outside of the face) max vertex degree is 6 (assuming nondegeneracy) so total space O(n + k) for k intersections. number of faces also O(n + k) (each face needs one edge) (or use Euler s theorem: n v n e + n f 2) standard clockwise pointer representation lets you walk around a face Randomized incremental construction: to insert segment, start at left endpoint draw altitudes from left end (splits a trapezoid) traverse segment to right endpoint, adding altitudes whenever intersect traverse again, erasing (half of) altitudes cut by segment Implementation clockwise ordering of neighbors allows traversal of a face in time proportional to number of vertices 1

for each face, keep a (bidirectional) pointer to all not-yet-inserted left-endpoints in face to insert line, start at face containing left endpoint traverse face to see where leave it create intersection, update face (new altitude splits in half) update left-end pointers segment cuts some altititudes: destroy half removing altitude merges faces update left-end pointers Analysis: Overall, update left-end-pointers in faces neighboring new line time to insert s is where f F (s) (n(f) + l(f)) F (s) is faces s bounds after insertion n(f) is number of vertices in face f l(f) is number of left-ends in f. So if S i is first i segmenets inserted, expected work of insertion i is 1 i s S i f F (s) Note each f appears at most 4 times in sum so O( 1 i f (n(f) + l(f))). Bound endpoint contribution: note l(f) = n i so contributes n/i so total O(n log n) Bound intersection contribution n(f) is O(k i + i) if k i intersections (n(f) + l(f)) 2

so cost is E[k i ] intersection present if both segments in first i insertions so expected cost is O((i 2 /n 2 )k) so cost contribution (i/n 2 )k sum over i, get O(k) note: adding to RIC, assumption that first i items are random. Total: O(n log n + k) Search structure Goal: apply binary search in slabs, without n 2 space Idea: trapezoidal decomp is important part of vertical lines problem: slab search no longer well defined but we show ok The structure: A kind of search tree x nodes test against an altitude y nodes test against a segment leaves are trapezoids each node has two children so works like a search tree bf But node may have many parents sharing descendants saves space. Inserting an edge contained in a trapezoid update trapezoids build a 4-node subtree to replace leaf Inserting an edge that crosses trapezoids sequence of traps i if 0 has left endpoint, replace leaf with x-node for left endpoint and y-node for new segment 3

Same for last middle : cut off pieces form new trapezoids (leaves) replace each cut trapezoid with a y-node for new segment two children of y-node point to appropriate traps note trap can have several incoming nodes Proof of correctness: Claim after each insert, valid search for current segments consider last insertion search gets to correct place before insertion new nodes continue search to correct place Search time analysis depth increases by one for new trapezoids below new segment RIC argument shows depth O(log n) Linear programming. define assumptions: nonempty, bounded polyhedron minimizing x 1 unique minimum, at a vertex exactly d constraints per vertex definitions: hyperplanes H basis B(H) of hyperplanes that define optimum optimum value O(H) Simplex exhaustive polytope search: walks on vertices runs in O(n d/2 ) time in theory 4

often great in practice polytime algorithms exist (ellipsoid) but bit-dependent (weakly polynomial)! OPEN: strongly polynomial LP goal today: polynomial algorithms for small d Random sampling algorithm Goal: find B(H) Plan: random sample solve random subproblem keep only violating constraints V recurse on leftover problem: violators may not contain all of B(H) bf BUT, contain some of B(H) opt of sample better than opt of whole but any point feasible for B(H) no better than O(H) so current opt not feasible for B(H) so some B(H) violated revised plan: random sample discard useless planes, add violators to active set repeat sample on whole problem while keeping active set claim: add one B(H) per iteration Algorithm SampLP: set S of active hyperplanes. if n < 9d 2 do simplex (d d/2+o(1) ) pick R H S of size d n x SampLP(R S) V hyperplanes of H that violate x if V 2 n, add to S Runtime analysis: 5

mean size of V at most n each iteration adds to S with prob. 1/2. each successful iteration adds a B(H) to S deduce expect 2d iterations. O(dn) per phase needed to check violating constraints: O(d 2 n) total recursion size at most 2d n T (n) 2dT (2d n) + O(d 2 n) = O(d 2 O(log d) n log n) + (log n) (Note valid use of linearity of expectation) Must prove claim, that mean V n. Lemma: suppose H S = m. sample R of size r from H S then expected violators d(m r 1)/(r d) book broken: only works for empty S Let C H be set of optima of subsets T S, T H Let C R be set of optima of subsets T S, T R note C R C H, and O(R S) is only point violating no constraints of R Let v x be number of constraints in H violated by x C H, Let i x indicate x = OP T (R S) decide Pr[v x ] ( m r ) equally likely subsets. how many have optimum x? E[ V ] = E[ v x i x ] = v x Pr[i x ] let q x be number of planes defining x not already in S must choose q x planes to define x all others choices must avoid planes violating x. prob. ( ) ( ) m vx q x m / = (m v ( ) ( ) x q x ) (r q x ) + 1 m vx q x m / r q x r r q x r q x 1 r ( ) ( ) (m r + 1) m vx q x m / r d r q x 1 r 6

deduce E[V ] m r + 1 r d ( ) ( m vx q x m vx / r q x 1 r summand is prob that x is a point that violates exactly one constraint in r. must pick q x constraints defining x must pick r q x 1 constraints from m v x q x nonviolators must pick one of v x violators therefore, sum is expected number of points that violate exactly one constraint in R. but this is only d (one for each constraint in basis of R) ) Result: saw sampling LP that ran in time O((log n) O(log d) + d 2 n log n + d O(d) key idea: if pick r random hyperplanes and solve, expect only dm/r violating hyperplanes. Iterative Reweighting Get rid of recursion and highest order term. idea: be softer regarding mistakes plane in V gives evidence it s in B(H) Algorithm: give each plane weight one pick 9d 2 planes with prob. proportional to weights find optimum of R find violators of R if then double violator weights repeat till no violators Analysis h V w h (2 h H show weight of basis grows till rest is negligible. claim O(d log n) iterations suffice. claim iter successful with prob. 1/2 w h )/(9d 1) 7

deduce runtime O(d 2 n log n) + d d/2+o(1) log n. proof of claim: after each iter, double weight of some basis element after kd iterations, basis weight at least d2 k total weight increase at most (1 + 2/(9d 1)) kd n exp(2kd/(9d 1)) after d log n iterations, done. so runtime O(d 2 n log n) + d O(d) log n Can improve to linear in n Randomized incremental algorithm T (n) T (n 1, d) + d (O(dn) + T (n 1, d 1)) = O(d!n) n Incomparable to prior bound. Can improve to O(d 4 2 d N) (see book) Can improve to O(d 2 n + b d log d log n ) 8