1 Schnyder’s Method. 2 Motivation Given a planar graph, we want to embed it in a grid We want the grid to be relatively small And we want an efficient.

Slides:



Advertisements
Similar presentations
Great Theoretical Ideas in Computer Science for Some.
Advertisements

Planar graphs Algorithms and Networks. Planar graphs2 Can be drawn on the plane without crossings Plane graph: planar graph, given together with an embedding.
Map-making as Graph Drawing Alan Saalfeld Mathematical Cartographer.
Divide and Conquer. Subject Series-Parallel Digraphs Planarity testing.
Planar Orientations Chapter 4 ( ) in the book Written By: Tomer Heber.
Introduction to Graphs
2/14/13CMPS 3120 Computational Geometry1 CMPS 3120: Computational Geometry Spring 2013 Planar Subdivisions and Point Location Carola Wenk Based on: Computational.
 Distance Problems: › Post Office Problem › Nearest Neighbors and Closest Pair › Largest Empty and Smallest Enclosing Circle  Sub graphs of Delaunay.
CompSci 102 Discrete Math for Computer Science April 19, 2012 Prof. Rodger Lecture adapted from Bruce Maggs/Lecture developed at Carnegie Mellon, primarily.
Krakow, Summer 2011 Schnyder’s Theorem and Relatives William T. Trotter
Applications of well seperated pairs Closest Pair K-Closest Pairs All-Nearest neighbor.
Convex Hulls in 3-space Jason C. Yang.
The number of edge-disjoint transitive triples in a tournament.
Great Theoretical Ideas in Computer Science.
Last time: terminology reminder w Simple graph Vertex = node Edge Degree Weight Neighbours Complete Dual Bipartite Planar Cycle Tree Path Circuit Components.
Convex Grid Drawings of 3-Connected Plane Graphs Erik van de Pol.
Rectangle Visibility Graphs: Characterization, Construction, Compaction Ileana Streinu (Smith) Sue Whitesides (McGill U.)
Computational Geometry Seminar Lecture 1
Definition Dual Graph G* of a Plane Graph:
Straight line drawings of planar graphs – part I Roeland Luitwieler.
Crossing Lemma - Part I1 Computational Geometry Seminar Lecture 7 The “Crossing Lemma” and applications Ori Orenbach.
Chapter 4: Straight Line Drawing Ronald Kieft. Contents Introduction Algorithm 1: Shift Method Algorithm 2: Realizer Method Other parts of chapter 4 Questions?
Coloring Algorithms and Networks. Coloring2 Graph coloring Vertex coloring: –Function f: V  C, such that for all {v,w}  E: f(v)  f(w) Chromatic number.
1 Separator Theorems for Planar Graphs Presented by Shira Zucker.
Graph Theory Ch.5. Coloring of Graphs 1 Chapter 5 Coloring of Graphs.
Constant Factor Approximation of Vertex Cuts in Planar Graphs Eyal Amir, Robert Krauthgamer, Satish Rao Presented by Elif Kolotoglu.
Curve Curve: The image of a continous map from [0,1] to R 2. Polygonal curve: A curve composed of finitely many line segments. Polygonal u,v-curve: A polygonal.
The Art Gallery Problem
Minimum Spanning Trees. Subgraph A graph G is a subgraph of graph H if –The vertices of G are a subset of the vertices of H, and –The edges of G are a.
Brute-Force Triangulation
Efficient Partition Trees Jiri Matousek Presented By Benny Schlesinger Omer Tavori 1.
Graph Theory Ch6 Planar Graphs. Basic Definitions  curve, polygon curve, drawing  crossing, planar, planar embedding, and plane graph  open set  region,
Graph Theory Chapter 6 Planar Graphs Ch. 6. Planar Graphs.
Flow and Upward Planarity
MST Many of the slides are from Prof. Plaisted’s resources at University of North Carolina at Chapel Hill.
UNC Chapel Hill Lin/Foskey/Manocha Minimum Spanning Trees Problem: Connect a set of nodes by a network of minimal total length Some applications: –Communication.
Planar Graphs and Partially Ordered Sets William T. Trotter Georgia Institute of Technology.
Straight line drawings of planar graphs – part II Roeland Luitwieler.
V Spanning Trees Spanning Trees v Minimum Spanning Trees Minimum Spanning Trees v Kruskal’s Algorithm v Example Example v Planar Graphs Planar Graphs v.
Lines in the plane, slopes, and Euler’s formula by Tal Harel
15-853Page :Algorithms in the Real World Planar Separators I & II – Definitions – Separators of Trees – Planar Separator Theorem.
Planar Graphs Graph Coloring
Agenda Review: –Planar Graphs Lecture Content:  Concepts of Trees  Spanning Trees  Binary Trees Exercise.
Partitioning the Labeled Spanning Trees of an Arbitrary Graph into Isomorphism Classes Austin Mohr.
1 / 41 Convex Hulls in 3-space Jason C. Yang. 2 / 41 Problem Statement Given P: set of n points in 3-space Return: –Convex hull of P: CH (P) –Smallest.
Graph Theory and Applications
Introduction to Graphs. This Lecture In this part we will study some basic graph theory. Graph is a useful concept to model many problems in computer.
Great Theoretical Ideas in Computer Science for Some.
1 Assignment #3 is posted: Due Thursday Nov. 15 at the beginning of class. Make sure you are also working on your projects. Come see me if you are unsure.
Algorithms for hard problems Parameterized complexity Bounded tree width approaches Juris Viksna, 2015.
Center for Graphics and Geometric Computing, Technion 1 Computational Geometry Chapter 9 Line Arrangements.
COMPSCI 102 Introduction to Discrete Mathematics.
Chapter 7 Planar Graphs 大葉大學 資訊工程系 黃鈴玲  7.2 Planar Embeddings  7.3 Euler’s Formula and Consequences  7.4 Characterization of Planar Graphs.
Polygon Triangulation
Theory of Computational Complexity Probability and Computing Chapter Hikaru Inada Iwama and Ito lab M1.
Algorithms and Networks
Great Theoretical Ideas In Computer Science
Outline 1 Properties of Planar Graphs 5/4/2018.
Computational Geometry
Great Theoretical Ideas in Computer Science
Planarity Testing.
The Art Gallery Problem
Discrete Mathematics for Computer Science
The Art Gallery Problem
Depth Estimation via Sampling
Introduction to Graph drawing
Gaph Theory Planar Graphs
Discrete Mathematics for Computer Science
Planarity.
Minimum Spanning Trees
Presentation transcript:

1 Schnyder’s Method

2 Motivation Given a planar graph, we want to embed it in a grid We want the grid to be relatively small And we want an efficient (linear) algorithm to do it  The algorithm we’ve seen last week runs in O(nlogn) time

3 Triangular Graph As we’ve seen before, any planar graph can be extended to a triangulation  Note the number of internal triangles in such a graph is 2|V| - 5 (by Euler’s formula) If we find a method to embed a triangulation in a grid, we can use it to embed any planar graph with only linear overhead

4 Barycentric Coordinates Imagine weights w 1, w 2, w 3 are placed at the vertices of a triangle  w 1 +w 2 +w 3 = 1 Then (w 1,w 2,w 3 ) are the coordinates of the center of mass

5 Barycentric Representation Assignment of barycentric coordinates (v 1,v 2,v 3 ) to a node v of a graph, such that  (v 1,v 2,v 3 ) = (u 1,u 2,u 3 )  v = u  v 1 +v 2 +v 3 = 1  For any (u,v)  E, and for any w  V, there is some i so that w i > u i and w i > v i

6 Straight-line Drawing A barycentric representation of a graph gives rise to a straight-line drawing (“Cheating”: sum of coordinates is 7, not 1)

7 Crossing-Free Drawing The drawing imposed by the barycentric representation is crossing free Given two edges (u,v) and (x,y), we know that there exist indices so that:  x i > u i, v i  y j > u j, v j  u h > x h, y h  v k > x k, y k

8 Crossing-Free Drawing Four indices, three co-ordinates  By the pigeonhole principle, some two indices are equal Assume without loss of generality i = j Then  x i > u i, v i  y i > u i, v i No two points on (x,y) and (u,v) share the same i coordinate  So (x,y) and (u,v) are separated by a line

9 Crossing-Free Drawing (0,0,7) (2,1,4) (4,2,1) (1,4,2) (0,0,7) (1,4,2) (2,1,4) (4,2,1)

10 Planar coordinates lemma We can choose any three non-colinear points a, b, c on the plane and define new coordinates based on the barycentric representation:  f(v 1,v 2,v 3 ) = av 1 +bv 2 +cv 3 The previous proof still holds so the drawing is crossing-free

11 Normal labeling of angles A labeling of the angles of a triangulation is called normal if  The angles of each triangle are labeled 1, 2, 3 in counterclockwise order  At each interior vertex: All three labels appear In counterclockwise order:  An interval of 1’s  An interval of 2’s  An interval of 3’s

12 Labeling in a Barycentric Representation Given a triangulation G with a barycentric representation For any internal triangle’s angle  uvw, there is an index i so that v i > u i, w i We’ll give that angle the label i

13 Labeling in a Barycentric Representation (0,0,7) (2,1,4) (4,2,1) (1,4,2)

14 Labeling in a Barycentric Representation This labeling is normal The other direction is also true:  Any normal labeling of angles can be constructed from some barycentric representation  So, if we have a normal labeling for a triangulation, there exists a straight-line drawing of it This statement will not be proven explicitly, but it will follow from the correctness of Schnyder’s method

15 Edge labeling We can turn any normal angle labeling into a labeling of edges Any internal edge (u,v) lies on two triangles: uvw and uvz

16 Edge labeling At either u or v, the two angles have distinct labels The other vertex must have the same label for both angles

17 Edge labeling Look at the angle labeling at each vertex Label and direct the edge using the vertex with the two identical labels

18 Edge labeling - partition Treat the graph created by the previous procedure as three directed graphs  T 1 : The set of all directed edges with the label 1  T 2 : The set of all directed edges with the label 2  T 3 : The set of all directed edges with the label 3

19 Edge labeling - partition

20 Edge labeling - partition T 1

21 Edge labeling - partition T 2

22 Edge labeling - partition T 3

23 Normal Partition (Realizer) A partition (T 1, T 2, T 3 ) of a triangular graph G is called normal if for any interior vertex v:  In each T i, the outdegree of v  G is exactly 1  The counterclockwise order of the edges at v is: Outgoing in T 1 Incoming in T 3 Outgoing in T 2 Incoming in T 1 Outgoing in T 2 Incoming in T 3

24 Normal Partition The edge partition defined previously is normal We know the labeling of angles is normal

25 Normal Partition Series of angle labels are in counterclockwise order Transitions between series become outgoing edges, in the correct order

26 Normal Partition Edges between angles in the same series become incoming edges Again, the order is determined by the normality of the angle partition

27 Normal Partition The directed graph we got indeed satisfies the conditions of a normal partition

28 Edge Contraction Let (x,y) be an edge in G The contracted graph G’ = G\(x,y) is  V(G’) = V(G)\{y}  E(G’) is constructed by removing all edges (v,y) and adding (v,x) instead x y

29 Contractible Edge An edge (x,y) is contractible, if x and y have exactly two common neighbors If G is a triangulation and (x,y) is contractible in G, then G\(x,y) is a triangulation x y

30 Contractible Edges Lemma Let G be a triangular graph with n > 3 vertices, and w an external vertex Then there exists a contractible edge (w,z) where z is an internal vertex of G Proof by induction  Using “separating triangles”

31 Normal labeling of angles Any triangular graph G has a normal labeling of its angles, where each exterior vertex has the same label on its angles Proof by induction on the number of vertices  Base case (n = 3) is trivial 3 1 2

32 Normal labeling of angles Suppose we can construct a normal labeling of angles for a triangular graph with n vertices Given a triangular graph with n+1 vertices, we can find (by lemma) a contractible edge (x,y) where x is an exterior vertex  If we contract we’ll get a triangular graph with n vertices  That graph will have a normal labeling

33 Normal labeling of angles Let’s assume the angles of the external labels are labeled with 1 Extend the labeling in the following way:  Label all the new angles of the external labels with 1  Label the new angles touching the two neighbor vertices with the same label the old angles touching them had  The rest of the labels are uniquely determined by the conditions of normality

34 Normal labeling of angles We get a normal labeling of a graph with n+1 vertices  The external vertex’ angles are still labeled with a single label x y n1n1 n2n2

35 Edge partition We can also look at the edge partitions induced by this construction x y n1n1 n2n2

36 Recap We’ve shown any triangular graph G has a normal labeling of its angles From which we know we can obtain a normal labeling of edges From which we get T 1, T 2, T 3

37 Recap What remains to be shown is:  The T i ’s can be used to generate a barycentric representation We already know a barycentric representation automatically gives us a compact straight-line drawing  The whole process has linear time complexity

38 T i are trees Each T i is a directed tree  A spanning tree of the interior vertices of G Each tree is directed towards a different exterior vertex The exterior vertex is called the root of that tree Proof by induction

39 T i are trees Base case: n = 4 Each T i is a single edge  A “spanning tree” on one vertex

40 T i are trees A graph with n+1 vertices can be built from a graph with n vertices using the previous construction That construction preserves each T i as a spanning tree x y n1n1 n2n2

41 More trees Define T i -1 as the graph obtained from T i by reversing all edges T 1  T 2 -1  T 3 -1 has no directed cycles  Proof similar to the previous one

42 i-Path from v The i-Path from v, P i (v), is the path from v to the root of T i  Because they are directed spanning trees, that path always exists  Because T i  T j -1  T k -1 has no directed cycles, for any r, s, P r (v) and P s (v) do not cross If they did at some vertex u ≠ v, there’d be a directed cycle between those two vertices on T r  T s -1

43 i-Path from v P 3 (v) P 2 (v) P 1 (v)

44 Regions With respect to each vertex v  Given the three paths P i (v) we can define three regions R i (v)  R 1 (v) is a triangulation bounded by P 2 (v) P 3 (v) The edge between the roots of T 2 and T 3

45 Regions P 3 (v) P 2 (v) P 1 (v) R 1 (v)R 2 (v) R 3 (v)

46 Region Inclusion Given interior vertices u, v so that u  R i (v)  R i (u)  R i (v) Follows from the order of edges around each vertex  Note this inclusion is proper P 3 (v) P 2 (v) P 1 (v) R 3 (v) v u R 3 (u) P 2 (u) P 1 (u)

47 Triangle Counting For any interior vertex v, define v i as the number of elementary triangles in R i (v) So for each interior vertex we have a triplet of coordinates (v 1,v 2,v 3 )  The total number of interior triangles is 2n-5  So v 1 +v 2 +v 3 = 2n-5 Extend this to exterior nodes  The root of the tree T i will have v i = 2n-5, v j = v k = 0

48 Triangle Counting v 1 = 4 v 2 = 1 v 3 = 2 Coordinate triplet: (1,4,2) v

49 Constructing a barycentric representation Define v i = v i / 2n-5 The set of triplets (v 1, v 2, v 3 ) is a barycentric representation of the graph! v 1 +v 2 +v 3 = (v 1 +v 2 +v 3 ) / (2n-5) = 1 The other condition also holds:  Take (x,y)  E, z  V  If z is the root of T i, z i = 2n-5 > x i,y i  Otherwise, for some i, (x,y)  R i (z) R i (x), R i (y)  R i (z) And by definition, x i,y i < z i

50 Grid embedding Let us choose three points on the plane:  a = (2n-5, 0)  b = (0, 2n-5)  c = (0,0) We know that if {(v 1,v 2,v 3 )|v  V } is a barycentric representation of G, we’ll get a straight-line drawing by assigning vertices the coordinates av 1 + bv 2 + cv 3 = ((2n-5)v 1, (2n-5)v 2 ) = (v 1,v 2 ) v 1,v 2 are integers between 0 and 2n-5, so this is a drawing on a 2n-5 x 2n-5 grid

51 Grid embedding

52 Vertex counting Instead of counting the number rectangles in each region, we can count vertices  v i is r i (v) : the number of vertices in the region R i (v) except those on the i-Path P i-1 (v) That way, we can get an embedding on a smaller grid: n-1 x n-1 Unfortunately, the coordinates we get are not barycentric  But they are “weak barycentric”

53 Weak Barycentric Representation Assignment of coordinates (v 1,v 2,v 3 ) to a node v of a graph, such that  (v 1,v 2,v 3 ) = (u 1,u 2,u 3 )  v = u  v 1 +v 2 +v 3 = 1  For any (u,v)  E, and for any w  V, there is some i so that (w i,w i+1 ) > lex (u i, u i+1 ), (v i, v i+1 ) Same proof as before to show this induces a straight-line drawing

54 Vertex Counting R 1 (v) = 5, P 3 (v) = 2, r 1 (v) = 3 R 2 (v) = 3, P 1 (v) = 2, r 2 (v) = 1 R 3 (v) = 4, P 2 (v) = 3, r 3 (v) = 1 Coordinate triplet: (3,1,1) v

55 Algorithm complexity To construct the embedding we need to  Extend the graph to a triangulation A linear algorithm exists  Find the three T i trees The construction shown earlier is linear in the number of edges We know |E| < 3n – 6, so it’s linear in the number of vertices  Count the number of vertices in each region The naïve method is O(n 2 ) A linear algorithm can be shown

56 Vertex Counting So how do we count vertices in linear time? We defined v i =|R i (v)| - |P i-1 (v)| We can define t i (v) as the number of nodes in the subtree of T i (v) rooted in v  t i (v) = 1 for roots for T i-1 and T i+1

57 Vertex Counting t 1 (v) = 2 t 2 (v) = 1 t 3 (v) = 1 v

58 Vertex Counting If u is in R i (v), then the i-Path P i (u) intersects either P i-1 (v) or P i+1 (v) So there is some x on P i-1 (v)  P i+1 (v) so that u is in the subtree of T i rooted in x P 3 (v) P 2 (v) P 1 (v) R 3 (v) v u P 3 (u) x

59 Vertex Counting So if we sum up the subtrees for P i-1 (v)  P i+1 (v) we’ll get : This sum can be computed for all vertices in the graph in a constant number of passes on the trees T i