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

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

Embed Size (px)

Citation preview

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

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

Lecture 1: IntroductionLecture 1: Introduction

Joe Mitchell

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

Course InfoCourse Info Joe Mitchell (Math 1-109)Joe Mitchell (Math 1-109) [email protected] (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

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

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)

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

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

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

Teaching AssistantsTeaching Assistants

Phil Ammirato (philammiratoPhil Ammirato ([email protected]))• 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 ([email protected])Sixin Li ([email protected])• Office hours (in Harriman 010):Office hours (in Harriman 010):

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

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

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))

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

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

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

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

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

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:

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

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

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

Example 4Example 4

Triangulation of Triangulation of polygonspolygons

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

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

Ear-Clipping TriangulationEar-Clipping Triangulation

Ear-clipping appletEar-clipping applet

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

Example 5Example 5

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

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

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?)

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

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)

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

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

Watchman Route Problem

Subject to: stay inside polygonal domain P

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

Example 6Example 6

Shortest path for a Shortest path for a mobile robotmobile robot

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

Application: Weather AvoidanceApplication: Weather Avoidance

1818

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

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

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

Visibility GraphsVisibility Graphs

Shows also the topological sweep of an arrangement, animated.

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

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)

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

Convex Hull of PointsConvex Hull of Points

Graham scan appletGraham scan applet Jarvis march appletJarvis march applet

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

QuickCD: Collision DetectionQuickCD: Collision Detection

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

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

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

Bounding Volume HierarchyBounding Volume Hierarchy

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

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

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

26-dops26-dops

14-dops14-dops6-dops6-dops

18-dops18-dops

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

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

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

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

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

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

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

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

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

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

3 Flows

Sector

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

Find maximum number of air lanes through the mincut

Routing MaxFlowRouting MaxFlow