AMS 345/CSE 355 Computational Geometry Lecture 1: Introduction Joe Mitchell

Preview:

Citation preview

AMS 345/CSE 355 AMS 345/CSE 355 Computational GeometryComputational Geometry

Lecture 1: IntroductionLecture 1: Introduction

Joe Mitchell

Course InfoCourse Info Joe Mitchell (Math 1-109)Joe Mitchell (Math 1-109) jsbm@ams.sunysb.edu (2-8366) (2-8366) http://www.ams.sunysb.edu/~jsbm/courses/345/ams345.html

Texts:Texts:• Discrete and Computational Geometry by Devadoss and O’Rourke Discrete and Computational Geometry by Devadoss and O’Rourke • Computational Geometry in C, by Joe O’Rourke (2Computational Geometry in C, by Joe O’Rourke (2ndnd Edition) Edition)

Grades: Grades: 40% midterm+40% final+20% hw40% midterm+40% final+20% hwMidterm: in class, tentatively Oct 17Midterm: in class, tentatively Oct 17Final: 5:30-6:45pm, Mon, Dec 11Final: 5:30-6:45pm, Mon, Dec 11Second-chance (optional): 6:45-8:00pm, Dec 11Second-chance (optional): 6:45-8:00pm, Dec 11Optional second-chance midterm: Replaces midterm Optional second-chance midterm: Replaces midterm

score with score with 0.80.8xxhighhigh + 0.2 + 0.2xxlowlow

HomeworksHomeworks Approx 8 assignmentsApprox 8 assignments Tentatively due: 9/19, 9/26, 10/3, 10/10, 10/31, Tentatively due: 9/19, 9/26, 10/3, 10/10, 10/31,

11/7, 11/14, 11/2111/7, 11/14, 11/21 Submit HW on timeSubmit HW on time

• I drop the lowest hw score I drop the lowest hw score • Each student is allowed ONE slightly late HW, as long as Each student is allowed ONE slightly late HW, as long as

it is submitted before solutions posted (inform me by it is submitted before solutions posted (inform me by email)email)

HW will be called in, near the beginning of class; HW will be called in, near the beginning of class; you will pass it forward; do you will pass it forward; do notnot bring it to the front bring it to the front of the class (unless you arrive late and then bring of the class (unless you arrive late and then bring it at the it at the ENDEND of class, to minimize disruption) of class, to minimize disruption)

HW PolicyHW Policy

You may discuss problems with other students in You may discuss problems with other students in this class, but this class, but you must write up your hw you must write up your hw completely on your owncompletely on your own; if you do work with ; if you do work with other student(s), you must declare this on the other student(s), you must declare this on the cover of your own hw, giving names of your cover of your own hw, giving names of your collaborators. (Your writings must be collaborators. (Your writings must be independent: Do not look at another writeup, independent: Do not look at another writeup, either of classmate or of anything you find on either of classmate or of anything you find on internet when writing your own solution. To do internet when writing your own solution. To do otherwise is a case of Academic Dishonesty and otherwise is a case of Academic Dishonesty and is subject to University policy through CASAis subject to University policy through CASA

Teaching AssistantsTeaching Assistants

Phil Ammirato (philammiratoPhil Ammirato (philammirato@gmail.com))• Office hours (in Harriman 010):Office hours (in Harriman 010):

Tues, 4:00-5:00; Thurs, 10:00-11:00Tues, 4:00-5:00; Thurs, 10:00-11:00

Sixin Li (sixin210@hotmail.com)Sixin Li (sixin210@hotmail.com)• Office hours (in Harriman 010):Office hours (in Harriman 010):

Mon, 1:30-3:30Mon, 1:30-3:30

BackgroundBackground

Geometry: vectors, dot/cross productGeometry: vectors, dot/cross product

AMS301: Counting, graphs, recursionAMS301: Counting, graphs, recursion

• Permutations, combinationsPermutations, combinations• Planar graphs, DFS, EulerPlanar graphs, DFS, Euler• F(n) ≤ 2F(n/2) + Cn F(n) ≤ 2F(n/2) + Cn SolveSolve: F(n)=O(n log n): F(n)=O(n log n)

Algorithms: read/parse a C program, big-Oh Algorithms: read/parse a C program, big-Oh notationnotation

(O(n), O(n log n),(O(n), O(n log n), O(nO(n22), O(n log n))), O(n log n))

What is CG?What is CG?

The algorithmic and mathematical The algorithmic and mathematical study of efficient methods to solve study of efficient methods to solve geometric problemsgeometric problems

Example 1Example 1

Point-in-polygon test: Point-in-polygon test: Is point q Is point q inside simple polygon P?inside simple polygon P?

P n-gon

q

Naïve: O(n) per test

CG: O(log n)

Applet: O’Rourke

Example 2Example 2

Segment intersection: Given Segment intersection: Given nn line line segments in the plane, determine:segments in the plane, determine:• Does some pair intersect? (DETECT)Does some pair intersect? (DETECT)• Compute all points of intersection Compute all points of intersection

(REPORT)(REPORT)

Naïve: O(n2)

CG: O(n log n) detect, O(k+n log n) reportApplet:

Example 3Example 3

Post office problem: Voronoi diagramsPost office problem: Voronoi diagrams http://www.cs.cornell.edu/Info/People/chew/Delaunay.htmlhttp://www.cs.cornell.edu/Info/People/chew/Delaunay.html

Example 4Example 4

Triangulation of Triangulation of polygonspolygons

http://www.cosy.sbg.ac.at/~held/projects/triang/triang.html

Ear-Clipping TriangulationEar-Clipping Triangulation

Ear-clipping appletEar-clipping applet

Example 5Example 5

Sensor placement, “guarding”Sensor placement, “guarding”

The Problem

Determine a small set of guards to see all of a givenpolygon P

5 guards suffice to cover P(what about 4 guards? 3?)

Vertex Guarding a Simple PolygonVertex Guarding a Simple Polygon

Vertex guarding Vertex guarding appletapplet

11 yellow vertices11 blue vertices16 white vertices

Place guards at yellow (or blue) vertices: at most n/3 vertex guards(here, n=38)

Mobile Robotic GuardMobile Robotic Guard Visit all visibility polygonsVisit all visibility polygons

Watchman Route Problem

Subject to: stay inside polygonal domain P

Example 6Example 6

Shortest path for a Shortest path for a mobile robotmobile robot

Application: Weather AvoidanceApplication: Weather Avoidance

1818

1919

Basic Optimal PathsBasic Optimal Paths

Visibility Graph

BEST: Output-sensitive alg: O(|E|+n log n)

Local optimality: taut string

Naïve algorithm:

O(n3)Better algorithms:

O(n2 log n) sweep

O(n2 ) duality

Visibility GraphsVisibility Graphs

Shows also the topological sweep of an arrangement, animated.

2323

Shortest Path MapShortest Path Map

Decomposition of the free spaceDecomposition of the free space

Shortest Paths Shortest Paths

go throughgo through

same verticessame vertices

Construct in time: O(n log n); size O(n)

Convex Hull of PointsConvex Hull of Points

Graham scan appletGraham scan applet Jarvis march appletJarvis march applet

QuickCD: Collision DetectionQuickCD: Collision Detection

The 2-Box Cover ProblemThe 2-Box Cover Problem

•Find “smallest” (tightest fitting) pair of bounding boxes

•Motivation:Motivation: Best outer approximationBest outer approximation Bounding volume hierarchiesBounding volume hierarchies

Bounding Volume HierarchyBounding Volume Hierarchy

BV-tree: BV-tree: Level 0Level 0 k-dopsk-dops

BV-tree: Level 1BV-tree: Level 1

26-dops26-dops

14-dops14-dops6-dops6-dops

18-dops18-dops

BV-tree: Level 2BV-tree: Level 2

BV-tree: Level 5BV-tree: Level 5

BV-tree: Level 8BV-tree: Level 8

Large Convex Inner ApproxLarge Convex Inner Approx

““Grow” k-dops from selected seed Grow” k-dops from selected seed points: collision detection (QuickCD), points: collision detection (QuickCD), responseresponse

Weather Avoidance Algorithms for En Route Aircraft Weather Avoidance Algorithms for En Route Aircraft

3 Flows

Sector

Find maximum number of air lanes through the mincut

Routing MaxFlowRouting MaxFlow

Recommended