Chapter 4: Straight Line Drawing Ronald Kieft. Contents Introduction Algorithm 1: Shift Method Algorithm 2: Realizer Method Other parts of chapter 4 Questions?

Slides:



Advertisements
Similar presentations
Planar graphs Algorithms and Networks. Planar graphs2 Can be drawn on the plane without crossings Plane graph: planar graph, given together with an embedding.
Advertisements

Planar Graphs: Coloring and Drawing
Map-making as Graph Drawing Alan Saalfeld Mathematical Cartographer.
UNC Chapel Hill Lin/Foskey/Manocha Steps in DP: Step 1 Think what decision is the “last piece in the puzzle” –Where to place the outermost parentheses.
Orthogonal Drawing Kees Visser. Overview  Introduction  Orthogonal representation  Flow network  Bend optimal drawing.
CS 450: COMPUTER GRAPHICS FILLING POLYGONS SPRING 2015 DR. MICHAEL J. REALE.
Divide and Conquer. Subject Series-Parallel Digraphs Planarity testing.
Planar Orientations Chapter 4 ( ) in the book Written By: Tomer Heber.
Convex drawing chapter 5 Ingeborg Groeneweg. Summery What is convex drawing What is convex drawing Some definitions Some definitions Testing convexity.
Brute-Force Triangulation
Krakow, Summer 2011 Schnyder’s Theorem and Relatives William T. Trotter
By Groysman Maxim. Let S be a set of sites in the plane. Each point in the plane is influenced by each point of S. We would like to decompose the plane.
Applied Combinatorics, 4th Ed. Alan Tucker
Steps in DP: Step 1 Think what decision is the “last piece in the puzzle” –Where to place the outermost parentheses in a matrix chain multiplication (A.
3. Delaunay triangulation
Last time: terminology reminder w Simple graph Vertex = node Edge Degree Weight Neighbours Complete Dual Bipartite Planar Cycle Tree Path Circuit Components.
Graph Drawing Introduction 2005/2006. Graph Drawing: Introduction2 Contents Applications of graph drawing Planar graphs: some theory Different types of.
Convex Grid Drawings of 3-Connected Plane Graphs Erik van de Pol.
Applied Combinatorics, 4th Ed. Alan Tucker
Computational Geometry Seminar Lecture 1
Tucker, Applied Combinatorics, Section 1.4, prepared by Patti Bodkin
Graph Colouring Lecture 20: Nov 25.
Definition Dual Graph G* of a Plane Graph:
Theorem Every planar graph is 5-colorable.
Straight line drawings of planar graphs – part I Roeland Luitwieler.
Computing the Delaunay Triangulation By Nacha Chavez Math 870 Computational Geometry; Ch.9; de Berg, van Kreveld, Overmars, Schwarzkopf By Nacha Chavez.
1 Separator Theorems for Planar Graphs Presented by Shira Zucker.
Drawing of G. Planar Embedding of G Proposition Proof. 1. Consider a drawing of K 5 or K 3,3 in the plane. Let C be a spanning cycle. 2. If the.
Rectangular Drawing Imo Lieberwerth. Content Introduction Rectangular Drawing and Matching Thomassen’s Theorem Rectangular drawing algorithm Advanced.
Graph Theory Ch.5. Coloring of Graphs 1 Chapter 5 Coloring of Graphs.
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
Matthew Bowling Euler’s Theorem Mathfest Spring ‘15.
Graph Theory Chapter 6 Planar Graphs Ch. 6. Planar Graphs.
Subdivision of Edge In a graph G, subdivision of an edge uv is the operation of replacing uv with a path u,w,v through a new vertex w.
Flow and Upward Planarity
Crossing Minimisation (1) Ronald Kieft. Global contents Specific 2-layer Crossing Minimisation techniques After the break, by Johan Crossing Minimisation.
Planar Graphs: Euler's Formula and Coloring Graphs & Algorithms Lecture 7 TexPoint fonts used in EMF. Read the TexPoint manual before you delete this box.:
Planar Graphs and Partially Ordered Sets William T. Trotter Georgia Institute of Technology.
Straight line drawings of planar graphs – part II Roeland Luitwieler.
Lines in the plane, slopes, and Euler’s formula by Tal Harel
Graph Colouring L09: Oct 10. This Lecture Graph coloring is another important problem in graph theory. It also has many applications, including the famous.
Arrangements and Duality Sanjay Sthapit Comp290 10/6/98.
Planar Graphs Graph Coloring
Graph Colouring Lecture 20: Nov 25. This Lecture Graph coloring is another important problem in graph theory. It also has many applications, including.
UNC Chapel Hill M. C. Lin Delaunay Triangulations Reading: Chapter 9 of the Textbook Driving Applications –Height Interpolation –Constrained Triangulation.
Vertex orderings Vertex ordering.
February 17, 2005Lecture 6: Point Location Point Location (most slides by Sergi Elizalde and David Pritchard)
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.
Various Orders and Drawings of Plane Graphs Takao Nishizeki Tohoku University.
COMPSCI 102 Introduction to Discrete Mathematics.
Introduction Wireless Ad-Hoc Network  Set of transceivers communicating by radio.
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.
Algorithms and Networks
Outline 1 Properties of Planar Graphs 5/4/2018.
Applied Combinatorics, 4th Ed. Alan Tucker
Graph theory Definitions Trees, cycles, directed graphs.
Drawing a Planar Graph on a Grid
Chapter 5. Optimal Matchings
Tucker, Applied Combinatorics, Sec 2.4
The Art Gallery Problem
The Art Gallery Problem
Polygon Triangulation
Depth Estimation via Sampling
Introduction Wireless Ad-Hoc Network
Applied Combinatorics, 4th Ed. Alan Tucker
Vertex orderings.
Gaph Theory Planar Graphs
Planarity.
Presentation transcript:

Chapter 4: Straight Line Drawing Ronald Kieft

Contents Introduction Algorithm 1: Shift Method Algorithm 2: Realizer Method Other parts of chapter 4 Questions?

Introduction Straight Line Drawing deals with plane graphs Plane graph: can be drawn without edge crossings, given a fixed embedding However, the edges can be curved It was proved that every plane graph G has a straight line drawing Which can be found in polynomial time But the area of the drawing was not bounded Impractical

Introduction cont’d In 1990 two methods were found which did have a bound on the area Fraysseix: area is a grid of (2n - 4) x (n – 2) Scnhyder: area is a grid of (n – 2) x (n – 2) Both method have O(n) implementations Question: what is the minimum size of a grid required for a Straight Line Drawing? Probably ceil(2n / 3) x ceil(2n / 3) Has not yet been proven

Algorithm 1: Shift Method The method by Fraysseix is called the “Shift Method” Finds a Straight Line Drawing for every plane graph G with n ≥ 3 Area is bouned by a grid of size (2n – 4) x (n – 2) Shift Method can be divided into two steps: Step 1: Construct a Canonical Ordering Step 2: Insert vertices one by one, according to the Canonical Ordering (and make sure the graph stays a Straight Line Drawing)

Algorithm 1: Shift Method Step 1: Construct a Canonical Ordering What is a Canonical Ordering? Cycle: path through G which starts and ends at the same vertex Chord: an edge between two non-consecutive vertices on a Cycle Outer Cycle; C o (G): the boundary of the outer face π(v 1, v 2,…, v n ): ordering of all vertices of G G k : a subgraph of G formed by the first k vertices of ordering π

Algorithm 1: Shift Method Examples of all definitions:

Algorithm 1: Shift Method The ordering π is a Canonical Ordering if for every k, 3 ≤ k ≤ n: 1. G k is 2-connected and internally triangulated 2. (v 1, v 2 ) is an outer edge of G k 3. If k + 1 ≤ n, then vertex v k+1 is located in the outer face of G k and all neighbors of v k+1 in G k appear on C o (G)

Algorithm 1: Shift Method Example Canonical Ordering:

Algorithm 1: Shift Method Proof: every triangulated plane graph G has a Canonical Ordering Proof with induction on the number of vertices Two base cases: n = 3 and n = n Induction step: Start with n =n Then there exists a vertex w (w ≠ v 1, v 2 ) on the cycle C o (G k ) and w is not end of a chord on C o (G k ) Then G k-1 is G k without vertex w

Algorithm 1: Shift Method Conclusion: it is enough to show that there always is such a vertex w Take C o (G k ) = w 1, w 2,…, w t (with w 1 = v 1 and w t = v 2 ) Then two cases: C o (G k ) has no chords  any vertex of w 2, w 3,…, w t is such a vertex w C o (G k ) has one or more chords: Then C o (G k ) has a minimal chord (w p, w q ) such that the vertices w p+1, w p+2,…, w q-1 are not end of a chord Then any of the vertices w p+1, w p+2,…, w q-1 are such a vertex w

Algorithm 1: Shift Method Illustration of the proof:

Algorithm 1: Shift Method Step 2: Construct Straight Line Drawing using the Canonical Ordering L(v i ): set of vertices which need to be moved when vertex v i changes position μ(P 1, P 2 ): new gridpoint defined by a line +1 through P 1 and a line -1 through P 2 Manhattan distance between P 1 and P 2 should be even Example:

Algorithm 1: Shift Method G 3 is drawn in a standard way: Furthermore assume the following holds for G k-1 with k-1 ≥ 3: 1. P(v 1 ) = (0, 0) and P(v 2 ) = (2k – 6, 0) 2. The x-coordinates are increasing for the vertices on C o (G k ) 3. Each edge (w i, w i+1 ) on C o (G k ) is drawn by a straight line with slope +1 or -1

Algorithm 1: Shift Method Then vertex v k can be inserted into G k-1 as follows: Let w p, w p+1,…, w q be the neighbors of v k on C o (G k ) Vertex v k covers vertices w p+1, w p+2,…, w q-1 If vertex v k is inserted at μ(w p, w q ), then the edge (v k, w p ) might overlap with edge (w p, w p+1 ) Therefore all vertices w 1, w 2,…, w p are shifted to the left by one Same thing holds for the edge (v k, w q ) and therefore all vertices w q, w q+1,…, w t are shifted to the right by one After both shifts a correction is made to ensure that v 1 stays located at (0, 0) Because of the shifts, vertex v k can see all vertices w p, w p+1,…, w q Therefore all egdes starting at v k can be drawn as straight lines, without edges crossings

Algorithm 1: Shift Method

When all vertices are inserted, it holds that: P(v 1 ) = (0, 0) P(v 2 ) = (2n – 4, 0) P(v n ) = (n – 2, n – 2) Thus the final Straight Line Drawing has a grid of size (2n – 4) x (n – 2) The algorithm can be implemented in O(n) time

Algorithm 1: Shift Method Example Straight Line Drawing:

Algorithm 2: Realizer Method The method by Schnyder is called the “Realizer Method” Finds a Straight Line Drawing for every plane graph G Area is bounded by (n – 2) x (n – 2) The Realizer Method can be divided into four steps: Step 1: Proof a Barycentric Representation gives a Straight Line Drawing Step 2: Make a Schnyder Labeling of G Step 3: Make a Realizer for G Step 4: Proof that a Realizer can be seen as a Weak Barycentric Representation

Algorithm 2: Realizer Method Step 1: Barycentric Representation gives a Straight Line Drawing What is a Barycentric Representation? An injective function which assigns three values v 1, v 2 and v 3 to each vertex v, such that: v 1 + v 2 + v 3 = 1 For each edge (x, y) and each vertex z ≠ x, y there is some index k (with k = 1, 2 or 3) such that v k from x and y < v k from z

Algorithm 2: Realizer Method Proof: Barycentric Representation gives a Straight Line Drawing on the plane spanned by (1,0,0), (0,1,0) and (0,0,1) Follows from the definition that each vertex is mapped onto this plane What is left: prove that edges do not intersect

Algorithm 2: Realizer Method Proof: Two edges (x, y) and (u, v) do not intersect: From the definition of the barycentric representation: u i, v i < x i and u j, v j < y j x k, y k < u k and x l, y l < v l Solving these equations gives: i = j or k = l Assume i = j = 1 (since i, j, k, l = 1, 2, 3) Then u 1, v 1 < x 1 and u 1, v 1 < y 1 which says that the x- coordinate of both vertex u and v < the x-coordinate of both vertex x and y This implies that the edges (x, y) and (u, v) are separated by a line through (0,1,0)(0,0,1) This implies that the edges (x, y) and (u, v) do not intersect

Algorithm 2: Realizer Method Thus Barycentric Representation gives a Straight Line Drawing Grid size is (2n – 5) x (2n – 5) Using a Weak Barycentric Representation, the grid size can shrink to (n – 2) x (n - 2) A Weak Barycentric Representation is again an injective function assigning three values, such that: v 1 + v 2 + v 3 = 1 For each edge (x, y) and each vertex z ≠ x, y there is some index k (with k = 1, 2 or 3) such that (v k, v k+1 ) from x and y < lex (v k, v k+1 ) from z Where (a, b) < lex (c, d) is true if a < c or when a = c and b < d Proof: Weak Barycentric Representation gives a Straight Line Drawing Same idea as proof for normal Barycentric Representation

Algorithm 2: Realizer Method Step 2: Make a Schnyder Labeling What is a Schnyder Labeling? An assignment of a label 1, 2 or 3 to all angles of inner facial triangles, such that: Each inner facial triangle has an angle labeled 1, another one labeled 2 and another one labeled 3, in a counter-clockwise order The labels of the angles at each inner vertex of G form, in counter-clockwise order, a nonempty interval of 1’s, a nonempty interval of 2’s and a nonempty interval of 3’s

Algorithm 2: Realizer Method Proof: every triangulated plane graph G has a Schnyder Labeling N(x): the set of neighbors of x in G G/(x,y): the graph obtained by contracting edge (x,y) from G (that is, remove y from G and connect al neighbors from y to x) Contractible(x, y): whether or not edge (x, y) is contractible. An edge (x, y) is only contractible if N(x) and N(y) share two vertices Separating Triangle: a triangle in G which has both interior and exterior vertices An edge (x, y) is contractible if there is no separating triangle containing (x, y), otherwise the resulting graph will no longer be triangulated

Algorithm 2: Realizer Method Edge contraction examples:

Algorithm 2: Realizer Method To prove that every graph G has a Schnyder Labeling, first prove that G has a outer vertex a, which has a neighbor x, such that edge (a, x) is contractible Proof by induction on the number of vertices Base case: 4 vertices, K 4  inner vertex as x Induction Step: two cases: G has no separating triangles containing a  edge (a, x) is contractible for any neighbor x of a G has a separating triangle T containing a  by induction the subgraph inside T has a vertex x such that (a, x) is contractible

Algorithm 2: Realizer Method Proof: every graph G has a Schnyder Labeling: This is trivial for n = 3 For n ≥ 4, then there exists an inner vertex x adjacent to outer vertex a, such that edge (a, x) is contractible (previous proof) Contracting this edge gives a graph which has one node less and (by induction) has a Schnyder Labeling Take this Schnyder Labeling and perform a reverse edge contraction (that is, adding a vertex), then the Schnyder Labeling can extended to a Schnyder Labeling of graph G The order in which the vertices are added is given by the expansion sequence Canonical Ordering is an expansion sequence

Algorithm 2: Realizer Method The way in which the Schnyder Labeling is adjusted:

Algorithm 2: Realizer Method Orientation of an edge: Each edge has two distinct labels at one end and two identical labels at the other end Follows from the conditions of the Schnyder Labeling The side with the two identical labels is called the “label of the edge” The edge is oriented in the direction of the “label of the edge”

Algorithm 2: Realizer Method Proof: the angles at one outer vertex have all label 1, all label 2 for another and all label 3 for the last outer vertex G is triangulated  (n – 3) inner vertices and (3n – 9) inner edges Each inner vertex has three outgoing edges (condition 2 Schnyder Labeling) Together: 3(n – 3) outgoing edges for all inner vertices Thus: no outgoing edges leaves a outer vertex, so all edges incident on a outer vertex are incoming Thus: the angles at outer vertices all have the same label (definition of the orientation of an edge)

Algorithm 2: Realizer Method Step 3: Make a Realizer for G What is a Realizer? A Realizer of a triangulated graph G is a partition of the inner edges into three sets T 1, T 2 and T 3, such that for each inner vertex v: v has an outgoing edge in each of T 1, T 2 and T 3 The counter-clockwise order of the edges incident on v is: Leaving in T 1 Entering in T 3 Leaving in T 2 Entering in T 1 Leaving in T 3 Entering in T 2

Algorithm 2: Realizer Method Realizer definitions: Root r i : the outer vertex of T i P i (v): the path in T i from vertex v to the root r i of T i Since P i (v) and P j (v) for i ≠ j share only vertex v, the path P 1 (v), P 2 (v) and P 3 (v) divide the graph into three regions R 1 (v), R 2 (v) and R 3 (v) R i (v): the closed region opposite to root r i of T i

Algorithm 2: Realizer Method Proof: Realizer is a Weak Barycentric Representation P i (v): the number of vertices in path P i (v) R i (v): the number of vertices in region R i (v), which includes both roots and vertices on both paths n i (v): all vertices in region R i (v) which are not on the path P i-1 (v) Then n 1 (v) + n 2 (v) + n 3 (v) = n – 1, since vertex v is in all regions, but also on all path and is therefore never counted

Algorithm 2: Realizer Method Take function f, which for every vertex v gives: 1 / (n – 1) (n 1 (v), n 2 (v), n 3 (v)) Satisfies condition 1, since n 1 (v) + n 2 (v) + n 3 (v) = n – 1 Also satisfies condition 2 A lot of math and definitions This part of the proof is omitted Conclusion: Weak Barycentric Representation  Straight Line Drawing on a (n – 2) x (n – 2) grid Schnyder Labeling gives a Realizer Realizer is a Weak Barycentric Representation All together: Realizer Method gives a Straight Line Drawing on a (n – 2) x (n – 2) grid

Algorithm 2: Realizer Method Example Straight Line Drawing:

Other parts of chapter 4 Special types of graphs can be drawn on smaller grid (than those by the previous two methodes) 4-connected graph: grid of ((n / 2) – 1) x (n / 2) Algorithm of Miura Idea: Use a 4-Canonical Ordering to split the graph G into two pieces Draw both pieces inside a triangle Connect both triangles

Questions?