AMS 345/CSE 355 Computational Geometry Lecture 1: Introduction Joe Mitchell
Course Info Joe Mitchell (Math 1-109) Joe Mitchell (Math 1-109) (2-8366) Texts: Texts: Discrete and Computational Geometry by Devadoss and O’RourkeDiscrete and Computational Geometry by Devadoss and O’Rourke Computational Geometry in C, by Joe O’Rourke (2 nd Edition)Computational Geometry in C, by Joe O’Rourke (2 nd Edition) Grades: 40% midterm+40% final+20% hw Grades: 40% midterm+40% final+20% hw Midterm: in class, tentatively Oct 17 Final: 5:30-6:45pm, Mon, Dec 11 Second-chance (optional): 6:45-8:00pm, Dec 11 Optional second-chance midterm: Replaces midterm score with 0.8x high + 0.2x low
Homeworks Approx 8 assignments Approx 8 assignments Tentatively due: 9/19, 9/26, 10/3, 10/10, 10/31, 11/7, 11/14, 11/21 Tentatively due: 9/19, 9/26, 10/3, 10/10, 10/31, 11/7, 11/14, 11/21 Submit HW on time Submit HW on time I drop the lowest hw scoreI drop the lowest hw score Each student is allowed ONE slightly late HW, as long as it is submitted before solutions posted (inform me by )Each student is allowed ONE slightly late HW, as long as it is submitted before solutions posted (inform me by ) HW will be called in, near the beginning of class; you will pass it forward; do not bring it to the front of the class (unless you arrive late and then bring it at the END of class, to minimize disruption) HW will be called in, near the beginning of class; you will pass it forward; do not bring it to the front of the class (unless you arrive late and then bring it at the END of class, to minimize disruption)
HW Policy You may discuss problems with other students in this class, but you must write up your hw completely on your own; if you do work with other student(s), you must declare this on the cover of your own hw, giving names of your collaborators. (Your writings must be independent: Do not look at another writeup, either of classmate or of anything you find on internet when writing your own solution. To do otherwise is a case of Academic Dishonesty and is subject to University policy through CASA You may discuss problems with other students in this class, but you must write up your hw completely on your own; if you do work with other student(s), you must declare this on the cover of your own hw, giving names of your collaborators. (Your writings must be independent: Do not look at another writeup, either of classmate or of anything you find on internet when writing your own solution. To do otherwise is a case of Academic Dishonesty and is subject to University policy through CASA
Teaching Assistants Phil Ammirato Phil Ammirato Office hours (in Harriman 010):Office hours (in Harriman 010): Tues, 4:00-5:00; Thurs, 10:00-11:00 Sixin Li Sixin Li Office hours (in Harriman 010):Office hours (in Harriman 010): Mon, 1:30-3:30
Background Geometry: vectors, dot/cross product Geometry: vectors, dot/cross product AMS301: Counting, graphs, recursion AMS301: Counting, graphs, recursion Permutations, combinationsPermutations, combinations Planar graphs, DFS, EulerPlanar graphs, DFS, Euler F(n) ≤ 2F(n/2) + Cn Solve: F(n)=O(n log n)F(n) ≤ 2F(n/2) + Cn Solve: F(n)=O(n log n) Algorithms: read/parse a C program, big- Oh notation Algorithms: read/parse a C program, big- Oh notation (O(n), O(n log n), O(n 2 ), O(n log n)) (O(n), O(n log n), O(n 2 ), O(n log n))
What is CG? The algorithmic and mathematical study of efficient methods to solve geometric problems The algorithmic and mathematical study of efficient methods to solve geometric problems
Example 1 Point-in-polygon test: Is point q inside simple polygon P? Point-in-polygon test: Is point q inside simple polygon P? P n-gon q Naïve: O(n) per test CG: O(log n) Applet: O’Rourke
Example 2 Segment intersection: Given n line segments in the plane, determine: Segment intersection: Given n line segments in the plane, determine: Does some pair intersect? (DETECT)Does some pair intersect? (DETECT) Compute all points of intersection (REPORT)Compute all points of intersection (REPORT) Naïve: O(n 2 ) CG: O(n log n) detect, O(k+n log n) report Applet:
Example 3 Post office problem: Voronoi diagrams Post office problem: Voronoi diagrams
Example 4 Triangulation of polygons Triangulation of polygons
Ear-Clipping Triangulation Ear-clipping applet Ear-clipping applet
Example 5 Sensor placement, “guarding” Sensor placement, “guarding”
The Problem Determine a small set of guards to see all of a given polygon P 5 guards suffice to cover P (what about 4 guards? 3?)
Vertex Guarding a Simple Polygon Vertex guarding applet Vertex guarding applet Vertex guarding applet Vertex guarding applet 11 yellow vertices 11 blue vertices 16 white vertices Place guards at yellow (or blue) vertices: at most n/3 vertex guards (here, n=38)
Mobile Robotic Guard Visit all visibility polygons Visit all visibility polygons Watchman Route Problem Subject to: stay inside polygonal domain P
Example 6 Shortest path for a mobile robot Shortest path for a mobile robot
Application: Weather Avoidance 18
19 Basic Optimal Paths Visibility Graph BEST: Output-sensitive alg: O(|E|+n log n) Local optimality: taut string Naïve algorithm: O(n 3 ) Better algorithms: O(n 2 log n) sweep O(n 2 ) duality
Visibility Graphs Shows also the topological sweep of an arrangement, animated.
Example: Shortest Path in Simple Polygon Triangulate P Triangulate P Determine the “sleeve” defined by the triangles in a path in the dual tree, from start to goal Determine the “sleeve” defined by the triangles in a path in the dual tree, from start to goal
Other Applets Rectilinear watchman, online appletapplet STIP online applet : search for a target in polygonapplet
23 Shortest Path Map Decomposition of the free space Shortest Paths go through same vertices same vertices Construct in time: O(n log n); size O(n)
Convex Hull of Points Graham scan applet Graham scan applet Graham scan applet Graham scan applet Jarvis march applet Jarvis march applet Jarvis march applet Jarvis march applet
QuickCD: Collision Detection
The 2-Box Cover Problem Find “smallest” (tightest fitting) pair of bounding boxes Motivation:Motivation: Best outer approximation Best outer approximation Bounding volume hierarchies Bounding volume hierarchies
Bounding Volume Hierarchy BV-tree: Level 0 k-dops
BV-tree: Level 1 26-dops 14-dops 6-dops 18-dops
BV-tree: Level 2
BV-tree: Level 5
BV-tree: Level 8
Large Convex Inner Approx “Grow” k-dops from selected seed points: collision detection (QuickCD), response “Grow” k-dops from selected seed points: collision detection (QuickCD), response
Weather Avoidance Algorithms for En Route Aircraft 3 Flows Sector
Find maximum number of air lanes through the mincut Routing MaxFlow