Straight line drawings of planar graphs – part I Roeland Luitwieler.

Slides:



Advertisements
Similar presentations
Planar Graphs: Coloring and Drawing
Advertisements

Covers, Dominations, Independent Sets and Matchings AmirHossein Bayegan Amirkabir University of Technology.
Orthogonal Drawing Kees Visser. Overview  Introduction  Orthogonal representation  Flow network  Bend optimal drawing.
Divide and Conquer. Subject Series-Parallel Digraphs Planarity testing.
Planar Orientations Chapter 4 ( ) in the book Written By: Tomer Heber.
2/14/13CMPS 3120 Computational Geometry1 CMPS 3120: Computational Geometry Spring 2013 Planar Subdivisions and Point Location Carola Wenk Based on: Computational.
Krakow, Summer 2011 Schnyder’s Theorem and Relatives William T. Trotter
Tirgul 8 Graph algorithms: Strongly connected components.
1 Constructing Convex 3-Polytopes From Two Triangulations of a Polygon Benjamin Marlin Dept. of Mathematics & Statistics McGill University Godfried Toussaint.
Last time: terminology reminder w Simple graph Vertex = node Edge Degree Weight Neighbours Complete Dual Bipartite Planar Cycle Tree Path Circuit Components.
Data Structures, Spring 2004 © L. Joskowicz 1 Data Structures – LECTURE 14 Strongly connected components Definition and motivation Algorithm Chapter 22.5.
Rectangular Drawing (continue) Harald Scheper. Overview algorithm (directions) algorithm in linear time outline of algorithm (placement) Rect. Drawings.
Debajyoti Mondal, Rahnuma Islam Nishat, Md. Saidur Rahman and Md. Jawaherul Alam Graph Drawing and Information Visualization Laboratory Department of Computer.
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.
Jim Anderson Comp 122, Fall 2003 Single-source SPs - 1 Chapter 24: Single-Source Shortest Paths Given: A single source vertex in a weighted, directed graph.
What is the next line of the proof? a). Let G be a graph with k vertices. b). Assume the theorem holds for all graphs with k+1 vertices. c). Let G be a.
Computational Geometry Seminar Lecture 4 More on straight-line embeddings Gennadiy Korol.
Computational Geometry Seminar Lecture 1
Is the following graph Hamiltonian- connected from vertex v? a). Yes b). No c). I have absolutely no idea v.
Chapter 4: Straight Line Drawing Ronald Kieft. Contents Introduction Algorithm 1: Shift Method Algorithm 2: Realizer Method Other parts of chapter 4 Questions?
1 Separator Theorems for Planar Graphs Presented by Shira Zucker.
Data Structures, Spring 2006 © L. Joskowicz 1 Data Structures – LECTURE 14 Strongly connected components Definition and motivation Algorithm Chapter 22.5.
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.
What is the next line of the proof? a). Assume the theorem holds for all graphs with k edges. b). Let G be a graph with k edges. c). Assume the theorem.
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.
Graph Theory Chapter 6 Planar Graphs Ch. 6. Planar Graphs.
Convex Grid Drawings of Plane Graphs
Jim Anderson Comp 122, Fall 2003 Single-source SPs - 1 Chapter 24: Single-Source Shortest Paths Given: A single source vertex in a weighted, directed graph.
Flow and Upward Planarity
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.:
Straight line drawings of planar graphs – part II Roeland Luitwieler.
1 Orthogonal Drawing (continued)  Sections 8.3 – 8.5 from the book  Bert Spaan.
Canonical Decomposition, Realizer, Schnyder Labeling and Orderly Spanning Trees of Plane Graphs Kazuyuki Miura, Machiko Azuma and Takao Nishizeki title.
Introduction to Planarity Test W. L. Hsu. Plane Graph A plane graph is a graph drawn in the plane in such a way that no two edges intersect A plane graph.
Chapter 24: Single-Source Shortest Paths Given: A single source vertex in a weighted, directed graph. Want to compute a shortest path for each possible.
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
Lecture 11 Algorithm Analysis Arne Kutzner Hanyang University / Seoul Korea.
Introduction to Planarity Test W. L. Hsu. 2/21 Plane Graph A plane graph is a graph drawn in the plane in such a way that no two edges intersect –Except.
A Unified View of Graph Searching
Unit – V Graph theory. Representation of Graphs Graph G (V, E,  ) V Set of vertices ESet of edges  Function that assigns vertices {v, w} to each edge.
Vertex orderings Vertex ordering.
Algorithms for hard problems Parameterized complexity Bounded tree width approaches Juris Viksna, 2015.
Various Orders and Drawings of Plane Graphs Takao Nishizeki Tohoku University.
9/8/10CS 6463: AT Computational Geometry1 CS 6463: AT Computational Geometry Fall 2010 Triangulations and Guarding Art Galleries Carola Wenk.
N u 1 u 2 u Canonical Decomposition. V 8 V 7 V 6 V 5 V 4 V 3 V 2 V 1 n u 1 u 2 u.
CCCG 2014 August 11, 2014 Department of Computer Science University of Manitoba Stephane Durocher Debajyoti Mondal.
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.
CSC317 1 At the same time: Breadth-first search tree: If node v is discovered after u then edge uv is added to the tree. We say that u is a predecessor.
Algorithms and Networks
Great Theoretical Ideas In Computer Science
Outline 1 Properties of Planar Graphs 5/4/2018.
Graph Drawing.
Main algorithm with recursion: We’ll have a function DFS that initializes, and then calls DFS-Visit, which is a recursive function and does the depth first.
Drawing Plane Triangulations with Few Segments
Geometric Graphs and Quasi-Planar Graphs
Drawing a Planar Graph on a Grid
The Art Gallery Problem
A Unified View of Graph Searching
The Art Gallery Problem
Victoria city and Sendai city
Vertex orderings.
Introduction to Graph drawing
Gaph Theory Planar Graphs
GRAPH THEORY Properties of Planar Graphs Ch9-1.
Give the parent, queue, BFI (breadth first index), and level arrays when BFS is applied to this graph starting at vertex 0. Process the neighbours of each.
Planarity.
GRAPH THEORY Properties of Planar Graphs Ch9-1.
Presentation transcript:

Straight line drawings of planar graphs – part I Roeland Luitwieler

Outline Introduction The shift method –The canonical ordering –The shift algorithm Next time: the realizer method

Introduction This presentation is about: –Straight line grid drawings of planar graphs –Minimized area De Fraysseix, Pach & Pollack, 1988: –The shift method: 2n–4 x n–2 grid Schnyder, 1990: –The realizer method: n–2 x n–2 grid Both are quite different, but can be implemented as linear time algorithms

Introduction Assumptions (can be taken care of in linear time) –n ≥ 3 (trivial otherwise) –Graph is maximal planar (=triangulated) –Graph has a topological embedding Terminology –Given an ordering on the vertices of graph G: G k is the induced subgraph of vertices v 1, …, v k –C o (G) is the outer cycle of a 2-connected graph G –Given a cycle C with u and v on it, but (u,v) not on it: The edge (u,v) is a chord of C

The canonical ordering An ordering of vertices v 1, …, v n is canonical if for each index k, 3 ≤ k ≤ n: 1. G k is 2-connected and internally triangulated 2. (v 1, v 2 ) is on C o (G k ) 3. If k+1≤n, v k+1 is in the exterior face of G k and its neighbours in G k appear on C o (G k ) consecutively

The canonical ordering Lemma: every triangulated plane graph has a canonical ordering Trivial for n=3, so assume n≥4 Proof by reverse induction –Base case (k=n): conditions hold since G n = G C o (G n ) consists of v 1, v 2 and v n –We now assume that v n, v n-1,..., v k+1 for k+1≥4 have been appropriately chosen and that the conditions hold for k –To prove: the conditions hold for k–1

The canonical ordering –If we can find a vertex (= v k ) on C o (G k ) which is not an end of a chord, the conditions hold Follows from G k–1 = G k – v k –Such a vertex always exists, because a chord always skips at least one vertex on the cycle

The canonical ordering A canonical ordering of a triangulated plane graph can be found in linear time –Use labels for vertices Label -1 means not yet visited Label 0 means visited once Label i means visited more than once and there are i intervals of visited neighbours in the circular order around the vertex –Algorithm: Let v 1 and v 2 be two consecutive vertices on C o (G) in counter clockwise order Label all other vertices -1 Process v 1 Process v 2 for k = 3 to n do – Chose a vertex v with label 1 – v k = v – Process v k

The canonical ordering –(Sub-algorithm) Process v: For all neighbours w of v not yet processed do –If label -1 then label(w) = 0 –If label 0 then (w has one processed neighbour u) »If w next to u in circular order of neighbours of v then label(w) = 1 »Otherwise label(w) = 2 –Otherwise (label i) »If vertices next to w in circular order of neighbours of v both have been processed then label(w) = i–1 »If neither has been processed yet then label(w) = i+1 –Correctness All processed vertices form G k and the chosen vertex is v k+1 –Verify the conditions hold now Successful termination guaranteed by previous proof

The shift algorithm General idea: –Insert vertices in canonical order in drawing –Invariants when inserting v k : 1.x(v 1 ) = 0, y(v 1 ) = 0, x(v 2 ) = 2k–6, y(v 2 ) = 0 2.x(w 1 ) < … < x(w t ) where C o (G k–1 ) = w 1, …, w t with w 1 = v 1, w t = v 2 3.Each edge on C o (G k–1 ) except (v 1, v 2 ) is drawn by a straight line having slope +1 or –1

The shift algorithm General idea: –Some vertices need to be shifted when inserting v k

The shift algorithm To obtain a linear time algorithm, x-offsets are used in stead of x-coordinates We use a binary tree to represent shift dependencies –Each node shifts whenever its parent shifts –Store x-offset and y-coordinate in each node Using the tree, the x-offsets can be accumulated in linear time

The shift algorithm Compute x-offsets and y-coordinates: –Compute values and create the tree for G 3 –For k = 4 to n do Let w 1, …, w t = C o (G k–1 ) with w 1 = v 1, w t = v 2 Let w p, w p+1, …, w q be the neighbours of v k on C o (G k–1 ) Increase Δx(w p+1 ) and Δx(w q ) by one Compute Δx(v k ) and y(v k ) Update the tree accordingly

The shift algorithm Updating the tree

The shift algorithm Computing Δx(v k ) and y(v k ) –Δx(w p, w q ) = Δx(w p+1 ) Δx(w q ) –Δx(v k ) = ½ {Δx(w p, w q ) + y(w q ) – y(w p )} –y(v k ) = ½ {Δx(w p, w q ) + y(w q ) + y(w p )} –Other necessary updates: Δx(w q ) = Δx(w p, w q ) – Δx(v k ) If p+1 <> q then Δx(w p+1 ) = Δx(w p+1 ) – Δx(v k )

Conclusions The shift method uses –The canonical ordering –A 2n–4 x n–2 grid, obviously –Linear time Next time: the realizer method Questions?

References H. de Fraysseix, J. Pach and R. Pollack, How to draw a planar graph on a grid, Combinatorica 10 (1), 1990, pp. 41–51. D. Harel and M. Sardas, An Algorithm for Straight-Line Drawing of Planar Graphs, Algorithmica 20, 1998, pp. 119–135. T. Nishizeki and Md. S. Rahman, Planar Graph Drawing, World Scientific, Singapore, 2004, pp. 45–88. W. Schnyder, Embedding planar graphs on the grid, in: Proceedings of the First ACM-SIAM Symposium on Discrete Algorithms, 1990, pp. 138–148.