Presentation is loading. Please wait.

Presentation is loading. Please wait.

Institute of Information Science Academia Sinica 1 1 Introduction to Geomtric Computing D. T. Lee Institute of Information Science Academia Sinica October.

Similar presentations


Presentation on theme: "Institute of Information Science Academia Sinica 1 1 Introduction to Geomtric Computing D. T. Lee Institute of Information Science Academia Sinica October."— Presentation transcript:

1 Institute of Information Science Academia Sinica 1 1 Introduction to Geomtric Computing D. T. Lee Institute of Information Science Academia Sinica October 14, 2002

2 2 2 What is Computer Science about? What is Computer Science about? n Not about programming n But about problem solving n Basic disciplinary areas include Software & Programming-related Hardware-related Computer systems Theory Mathematics of computer science Applications etc.

3 3 October 14, 2002 3 MinMax Problem 4 n Min&Max Problem Input: A set S of N numbers on the real line Output: The Minimum and Maximum of S Simple method: Finding the min. or max. of N numbers requires N-1 comparisons. Reduce Min&Max to 2 Min or Max problems! 2N-3 comparisons

4 4 October 14, 2002 4 min max Simple comparator MIN min MinMax Problem 3

5 5 October 14, 2002 5 MinMax Problem 2 n But finding both Maximun and Minimum can be done with  3N/2   2 comparisons

6 6 October 14, 2002 6 min max MIN min MAX max MinMax Problem 1

7 7 October 14, 2002 7 Sorting Problem n Sorting N numbers Simple method: find Min repeatedly (N-1) + (N-2) + … + 2 + 1 = (N-1)N/2 Selection method: Selection method: –Smallest can be found in (N-1) comparisonsSmallest can be found in (N-1) comparisons –2 nd smallest found in log 2 N additional comp.2 nd smallest found in log 2 N additional comp. –3 rd smallest found in log 2 N additional comp.3 rd smallest found in log 2 N additional comp. (N-1)+ (N-1)log 2 N

8 8 October 14, 2002 8 min 1st round3rd round2nd round Total number of matches for 8 competitors is 7 N/2 + N/4 + … + 4 + 2 + 1 = N-1 Total number of rounds is log 2 N Knockout Tournament

9 9 October 14, 2002 9 Geometric Computing Geometric Computing n Design and Analysis of Algorithms for geometric problems n Theory: Computational Complexities Time, Space, Degree Lower and Upper Bounds of Computation n Applications: VLSI CAD, Computer-Aided Geometric Design, Computer Graphics, Operations Research, Pattern Recognition, Robotics, Geographical Information Systems, Statistics, Cartography, Metrology, etc.

10 10 October 14, 2002 10 Theory of Computation n Models of Computation n Real arithmetic, RAM n Computation Tree Model - Unit Cost n Off-line, On-line, Real-time n Parallel Computation vs Serial Computation n Problem Complexity vs Algorithm Complexity n Decision vs Computation Problems Output Sensitive Algorithms

11 11 October 14, 2002 11 Checking if a Polygon is Convex 4 Checking if a Polygon is Convex 4 n A polygon P is represented by a sequence of points v 0, v 1, v 2, …, v n-1 where (v i, v i+1 ) is an edge, i=0,1,..,n-1, v n = v 0. n Theorem: A polygon P is convex if segments connecting any two points inside the polygon always lie inside P.

12 12 October 14, 2002 12 Problem: There are infinitely many possible Segments to check! Checking if a Polygon is Convex 3 Checking if a Polygon is Convex 3

13 13 October 14, 2002 13 Checking if a Polygon is Convex 2 n Theorem: A polygon is convex if every diagonal lies inside the polygon. It takes O(N 3 ) time to check O(N 2 ) diagonals against every edge of P. Very inefficient! n Theorem: A polygon is convex if every interior angle of each vertex is less than 180 o. Theorem: A polygon is convex if every interior angle of each vertex is less than 180 o. This result would imply an O(N) time algorithm!

14 14 October 14, 2002 14 Consider three vertices v i, v j, v k and determinant det(v i, v j, v k ) = x i y i 1 x j y j 1 x k y k 1 where (x i y i ) are the x- and y-coordinates of v i det(v i, v j, v k ) = 0 when v i, v j, v k are collinear det(v i, v j, v k ) < 0 when v i, v j, v k form a right turn det(v i, v j, v k ) > 0 when v i, v j, v k form a left turn vivi vjvj vkvk left turn Checking if a Polygon is Convex 1 vivi vjvj vkvk right turn vivi vjvj vkvk collinear

15 15 October 14, 2002 15 Checking if a Polygon is Simple Checking if a Polygon is Simple v1v1 v2v2 v3v3 v4v4 v0v0 v5v5 How do you check if the input polygon is simple??

16 16 October 14, 2002 16 Art Gallery Problem n Consider an art gallery room whose floor plan is modeled by a simple polygon with N sides. n How many stationary guards are needed to guard the room? n Assumption: Each guard is considered to have 360 o unlimited visibility. n Two points p and q are said to be visible to each other, if the line segment (p,q) does not intersect any edge of the polygon.

17 17 October 14, 2002 17 Art Gallery Problem p and q are visible q r r and q are not visible p q

18 18 October 14, 2002 18 Art Gallery Problem Visibility polygon of q & r q r

19 19 October 14, 2002 19 Art Gallery Theorem n Theorem: Given a simple polygon with N sides, stationary guards are sufficient, and sometimes necessary to cover the entire polygon.  N/3  Theorem: Given a simple polygon with N sides, the problem of finding a minimum number of stationary guards to cover the entire polygon is intractable.

20 20 October 14, 2002 20 Lower Bound of Art Gallery Problem Lower Bound of Art Gallery Problem A comb with 8 prongs (N=24) requires  N/3  = 8 guards

21 21 October 14, 2002 21 Upper Bound of Art Gallery Problem Upper Bound of Art Gallery Problem Triangulation of a Simple Polygon

22 22 October 14, 2002 22 Coloring of a Graph n Coloring of a graph: an assignment of colors to nodes of the graph such that no two adjacent nodes are assigned the same color. n Chromatic number: The minimum number of colors required to color a graph. n Theorem: Every triangulation of a simple polygon is 3-colorable.

23 23 October 14, 2002 23 N = 14 Art Gallery Problem: Example Art Gallery Problem: Example Triangulation Select red color to place guards 3   N/3  = 4

24 24 October 14, 2002 24 Art Gallery Theorem Theorem: In a 3-coloring of a triangulation of a simple polygon with N vertices, there exists a color that is used no more than  N/3  times. n Proof: Pigeon-hole principle If n pigeons are placed into k pigeon-holes, at least one of the holes must have no more than n/k pigeons. Since N is an integer, there exists at least one color that is used in no more than  N/3  times.

25 25 October 14, 2002 25 Variations of Art Gallery Problem Variations of Art Gallery Problem n Shapes of Art Gallery: Rectilinear polygon Polygon with holes n Capabilities of Guard Mobile guards moving along a track Guards with limited visibility (angle and distance)Guards with limited visibility (angle and distance)

26 26 October 14, 2002 26 Rectilinear Polygon

27 27 October 14, 2002 27 Polygons with Holes

28 28 October 14, 2002 28 Guard Capabilities Mobile Guard Limited visibility Mobile guard with limited visibility

29 29 October 14, 2002 29 Map Coloring 2 n Given a planar graph (planar map), find a coloring of the regions so that no two adjacent regions are assigned the same color. Given a planar graph (planar map), find a coloring of the regions so that no two adjacent regions are assigned the same color. n How many colors are sufficient? 4-color theorem! n Find an algorithm that colors the map.

30 30 October 14, 2002 30 Map Coloring 1

31 31 October 14, 2002 31 Proximity nCnClosest Pair Problem: Consider N points in the plane, find the pair of points whose Euclidean distance is the smallest. Brute force: Enumerate all N 2 pairwise distances and find the minimum. Can one do better?

32 32 October 14, 2002 32 Closet Pair on the Real Line n Consider N numbers x 0, x 1, x 2, …, x n-1 on the real line, find the two numbers x i and x j such that | x i – x j | is the smallest. n Lemma: The two numbers x i and x j such that | x i – x j | is the smallest must be adjacent to each other, when these numbers are sorted. x i+1 xixi Closest pair

33 33 October 14, 2002 33 Closest Pair in the Plane 22 11  =  2

34 34 October 14, 2002 34 Voronoi Diagram Delaunay Triangulation Closest pair must be Voronoi neighbors Circumcircle of a triangle

35 35 October 14, 2002 35 Closest Pair Problem n Theorem: Given N points in k- dimensional space, the closest pair of points can be determined in O(N log N) time, which is asymptotically optimal.

36 36 October 14, 2002 36 Geometric Optimization n Shortest Path Problem Given a polygonal domain (obstacles), and two points s and t, find a shortest path between s and t avoiding these obstacles. n Homotopic Routing Given a layout and the homotopy of k 2- terminal nets, find a detailed routing of minimum wire length.

37 37 October 14, 2002 37 Homotopic Routing n Input: A sketch S=(F, M, W), a planar drawing of a physical layout of modules M in the grid and a finite set W of nets connecting point features F, each represented by a vertex-disjoint simple path. n Output: A detailed routing on the grid without overlapping of these nets of minimum total length among those that are homotopic to the given sketch. n Net p is homotopic to net q, if they have the same terminals, and one can be transformed continuously into the other without crossing features.

38 38 October 14, 2002 38

39 39 October 14, 2002 39

40 40 October 14, 2002 40

41 41 October 14, 2002 41 After Compaction

42 42 October 14, 2002 42 Topological Via Minimization 4 n Given a set of n 2-terminal nets in a two-layer bounded routing region, find a layer assignment of wire segments so as to minimize the number of vias used. layer1 layer2 via

43 43 October 14, 2002 43 Layer 1 Layer 2 Via Layer 1 Layer 2 Via # of Vias = 4 # of Vias = 1 Topological Via Minimization 3

44 44 October 14, 2002 44 Layer 1 Layer 2 Via # of Vias : 1 Topological Via Minimization 2

45 45 October 14, 2002 45 Topological Via Minimization 1 n Lemma: There exists an optimal solution to the two-layer bounded region TVM problem such that each net uses at most one via. Lemma: There exists an optimal solution to the two-layer bounded region TVM problem such that each net uses at most one via.

46 46 October 14, 2002 46 n Definition: A set of chords is said to be 2-independent if it can be partitioned into two subsets of independent chords Circle Graph 2

47 47 October 14, 2002 47 n Theorem: Given n chords in a circle and an integer k, the problem of deciding if there exists a 2-independent set of chords of size k or more (2-independent set in circle graphs) is NP-complete. n Proof (Sketch): The 2-independent set problem is in NP. Planar 3SAT is polynomially reducible to the 2-independent set problem. Circle Graph 1

48 48 October 14, 2002 48 n Permutation graphs: Given n chords in a two-sided channel in which each chord connects one point in each side, find a 2-independent set of chords of maximum cardinality. 2-Independent Set Problem n Circle graphs: Given n chords in a circle, find a 2- independent set of chords of maximum cardinality. NP-hard O(n log n) time

49 49 October 14, 2002 49 Permutation Graph

50 50 October 14, 2002 50 Geometric Optimization n Minimum Covering Given a set of N points, find the smallest disk covering the entire set.Given a set of N points, find the smallest disk covering the entire set. Smallest enclosing circle, rectangle, square, annulus, parallel strip, etc.Smallest enclosing circle, rectangle, square, annulus, parallel strip, etc. P-center problem minimum covering with fixed-size disk, square,etc.minimum covering with fixed-size disk, square,etc. weighted version

51 51 October 14, 2002 51 Minimum Covering 3 n 1-center problem (smallest circle)

52 52 October 14, 2002 52 Minimum Covering 2 n 1-center problem (smallest rectangle)

53 53 October 14, 2002 53 Minimum Covering 1 n p-center problem (fixed-size disk covering)

54 54 October 14, 2002 54 Matching 2 n Pattern matching: Given a target pattern P, and A test pattern Q, find if Q is a sub-pattern in P. P Q

55 55 October 14, 2002 55 Matching 1 Matching 1 P Q

56 56 October 14, 2002 56 Inexact Matching P Q

57 57 October 14, 2002 57 Bipartite Matching n Bi-chromatic matching: Given two sets, P and Q of points, find a one-to-one mapping such that the sum of distances of matched pairs of points is minimized.

58 58 October 14, 2002 58 Searching n Searching Problems: Given a set S of objects (points, line segments, etc.), determine if there exists any object with certain properties. Given a set S of objects, report objects that satisfy certain properties. With preprocessing allowed, how fast can we find objects in S satisfying certain properties? What if S is subject to updates? Memory requirement, query time, update time

59 59 October 14, 2002 59 Searching and Retrieval Searching and Retrieval n Exact Match (membership problem) Given a set S of objects p i (x 1, x 2,,…, x n ), is (q 1, q 2,,…, q n ) in S? n Range Search Given a set S of objects p i (x 1, x 2,,…, x n ), find those whose x k lies within a range interval [q k1, q k2 ] for each k=1,2,..,n. In 2D, the problem is solvable in O(log 2 N + K) optimal time; In higher dimensions, it is solvable in O((log 2 N) d-1 + K) time, where K is the output size.

60 60 October 14, 2002 60 Example of Range Search salary Date of birth 19,500,00019,559,999 3,000 4,000 G. Ometer born: Aug 19, 1954 Salary: 3500 19,500,000 19,559,999 3,000 4,000 2 4

61 61 October 14, 2002 61 Conclusion n Computer Science is a discipline addressing areas ranging from theory to applications. n Mathematics is a fundamental to theoretical computer science. n Geometric computing is a very rich area with many applications n Cryptography (one-way function, security) n Number theory, combinatorics n Packing Problem, Trapezoid Problem, etc.

62 62 October 14, 2002 62 Trapezoid Construction Problem c a b d e f Given d, b, e, f construct a trapezoid as shown Given a,c, e, f construct a trapezoid as shown: Solved.

63 63 October 14, 2002 63 The End Thank you for your attention!


Download ppt "Institute of Information Science Academia Sinica 1 1 Introduction to Geomtric Computing D. T. Lee Institute of Information Science Academia Sinica October."

Similar presentations


Ads by Google