I NTRODUCTION TO G RAPH DRAWING Fall 2010 Battista, G. D., Eades, P., Tamassia, R., and Tollis, I. G. 1998 Graph Drawing: Algorithms for the Visualization.

Slides:



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

Two Segments Intersect?
Graphs - II Algorithms G. Miller V. Adamchik CS Spring 2014 Carnegie Mellon University.
Trees Chapter 11.
WSPD Applications.
22nd International Symposium on Graph Drawing
Orthogonal Drawing Kees Visser. Overview  Introduction  Orthogonal representation  Flow network  Bend optimal drawing.
8.3 Representing Relations Connection Matrices Let R be a relation from A = {a 1, a 2,..., a m } to B = {b 1, b 2,..., b n }. Definition: A n m  n connection.
Divide and Conquer. Subject Series-Parallel Digraphs Planarity testing.
Planar Orientations Chapter 4 ( ) in the book Written By: Tomer Heber.
Depth-First Search1 Part-H2 Depth-First Search DB A C E.
2/14/13CMPS 3120 Computational Geometry1 CMPS 3120: Computational Geometry Spring 2013 Planar Subdivisions and Point Location Carola Wenk Based on: Computational.
Divide and Conquer: Rooted Trees. 2 Introduction Rooted trees: acyclic graphs (no cycles) all edges directed away from root. downward planar drawing (child.
One of the most important problems is Computational Geometry is to find an efficient way to decide, given a subdivision of E n and a point P, in which.
UNC Chapel Hill M. C. Lin Polygon Triangulation Chapter 3 of the Textbook Driving Applications –Guarding an Art Gallery –3D Morphing.
Seminar Graph Drawing H : Introduction to Graph Drawing Jesper Nederlof Roeland Luitwieler.
1 Monotone Drawings of Graphs Thanks to Peter Eades Patrizio Angelini, Enrico Colasante, Giuseppe Di Battista, Fabrizio Frati,
Advanced Topics in Algorithms and Data Structures 1 Rooting a tree For doing any tree computation, we need to know the parent p ( v ) for each node v.
Rectangle Visibility Graphs: Characterization, Construction, Compaction Ileana Streinu (Smith) Sue Whitesides (McGill U.)
Lists A list is a finite, ordered sequence of data items. Two Implementations –Arrays –Linked Lists.
CSE 6405 Graph Drawing Text Books T. Nishizeki and M. S. Rahman, Planar Graph Drawing, World Scientific, Singapore, G. Di Battista,
Straight line drawings of planar graphs – part I Roeland Luitwieler.
Chapter 4: Straight Line Drawing Ronald Kieft. Contents Introduction Algorithm 1: Shift Method Algorithm 2: Realizer Method Other parts of chapter 4 Questions?
Lecture 6: Point Location Computational Geometry Prof. Dr. Th. Ottmann 1 Point Location 1.Trapezoidal decomposition. 2.A search structure. 3.Randomized,
3/3/ Alperovich Alexander. Motivation  Find a maximal flow over a directed graph  Source and sink vertices are given 3/3/
Assignment 4. (Due on Dec 2. 2:30 p.m.) This time, Prof. Yao and I can explain the questions, but we will NOT tell you how to solve the problems. Question.
Important Problem Types and Fundamental Data Structures
Discrete Mathematics Lecture 9 Alexander Bukharovich New York University.
KNURE, Software department, Ph , N.V. Bilous Faculty of computer sciences Software department, KNURE The trees.
Graph Algorithms Using Depth First Search Prepared by John Reif, Ph.D. Distinguished Professor of Computer Science Duke University Analysis of Algorithms.
Advanced Data Structures and Algorithms COSC-600 Lecture presentation-6.
The complexity of the matching-cut problem Maurizio Patrignani & Maurizio Pizzonia Third University of Rome.
I NTRODUCTION TO G RAPH DRAWING Fall 2010 Battista, G. D., Eades, P., Tamassia, R., and Tollis, I. G Graph Drawing: Algorithms for the Visualization.
Flow and Upward Planarity
Orthogonal Drawings of Series-Parallel Graphs Joint work with Xiao Zhou by Tohoku University Takao Nishizeki.
I NTRODUCTION TO G RAPH DRAWING Fall 2010 Battista, G. D., Eades, P., Tamassia, R., and Tollis, I. G Graph Drawing: Algorithms for the Visualization.
Advanced Seminar on Graph Drawing – Planar Orientations Olga Maksin Victor Makarenkov Department of Computer Science. Ben-Gurion University of the Negev.
Week 11 - Wednesday.  What did we talk about last time?  Graphs  Euler paths and tours.
Binary Trees. Binary Tree Finite (possibly empty) collection of elements A nonempty binary tree has a root element The remaining elements (if any) are.
Center for Graphics and Geometric Computing, Technion 1 Computational Geometry Chapter 8 Arrangements and Duality.
 Rooted tree and binary tree  Theorem 5.19: A full binary tree with t leaves contains i=t-1 internal vertices.
5.5.2 M inimum spanning trees  Definition 24: A minimum spanning tree in a connected weighted graph is a spanning tree that has the smallest possible.
5.5.3 Rooted tree and binary tree  Definition 25: A directed graph is a directed tree if the graph is a tree in the underlying undirected graph.  Definition.
Center for Graphics and Geometric Computing, Technion 1 Computational Geometry Chapter 8 Arrangements and Duality.
Discrete Structures Trees (Ch. 11)
5.5.2 M inimum spanning trees  Definition 24: A minimum spanning tree in a connected weighted graph is a spanning tree that has the smallest possible.
Trees : Part 1 Section 4.1 (1) Theory and Terminology (2) Preorder, Postorder and Levelorder Traversals.
Triangles 1st year P26 Chapter 4.
Relation. Combining Relations Because relations from A to B are subsets of A x B, two relations from A to B can be combined in any way two sets can be.
Computing Branchwidth via Efficient Triangulations and Blocks Authors: F.V. Fomin, F. Mazoit, I. Todinca Presented by: Elif Kolotoglu, ISE, Texas A&M University.
Spatial Indexing Techniques Introduction to Spatial Computing CSE 5ISC Some slides adapted from Spatial Databases: A Tour by Shashi Shekhar Prentice Hall.
1 EE5900 Advanced Embedded System For Smart Infrastructure Static Scheduling.
S&H Planarity Test Based on PC-Trees Wen-Lian Hsu.
Algorithms for hard problems Parameterized complexity Bounded tree width approaches Juris Viksna, 2015.
5.6 Prefix codes and optimal tree Definition 31: Codes with this property which the bit string for a letter never occurs as the first part of the bit string.
Polygon Triangulation
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.
Discrete Structures Li Tak Sing( 李德成 ) Lectures
Algorithms for Finding Distance-Edge-Colorings of Graphs
Mean Shift Segmentation
Advanced Algorithms Analysis and Design
Graph Algorithms Using Depth First Search
5-Minute Review How does the Inorder tree layout algorithm work? Which tree drawing requirements does it (not) fulfill? What is its main drawback? How.
Planarity Testing.
Md. Abul Kashem, Chowdhury Sharif Hasan, and Anupam Bhattacharjee
SPQR Tree.
Computational Geometry
Introduction to Graph drawing
Important Problem Types and Fundamental Data Structures
Presentation transcript:

I NTRODUCTION TO G RAPH DRAWING Fall 2010 Battista, G. D., Eades, P., Tamassia, R., and Tollis, I. G Graph Drawing: Algorithms for the Visualization of Graphs. 1st. Prentice Hall PTR.

D IVIDE AND C ONQUER S ERIES -P ARALLEL D IGRAPHS Scheduling Electrical networks Data flow analysis Database logic algorithm

S ERIES -P ARALLEL D IGRAPHS Directed graph with a source and sink nodes or poles. source sink

T HE RECURSIVE DEFINITION OF S - P DIGRAPH An edge joining two vertices is a s-p digraph. (a) Let G’ and G” be two s-p digraphs these two compositions of them also are s-p digraphs: The series composition of G’ and G” is the digraph obtained identifying the sink of G’ with the source of G”. (b) The parallel composition of G’ and G” is the digraph obtained by identifying the source of G’ with the source of G” and the sink of G’ with the sink of G”. (c)

S ERIES COMPOSITION OF DIGRAPHS Identifying the sink of one and the source of the other as one vertex source sink

P ARALLEL COMPOSITION OF DIGRAPHS Identifying as one vertex both their sources Identifying as one vertex both their sinks source sink source sink

D ECOMPOSITION TREES A series-parallel digraphs is associated with a binary tree named decomposition tree or parse tree There are three different kinds of nodes in this tree: S-nodes, P-nodes and Q-nodes.

T HE RECURSIVE DEFINITION OF D ECOMPOSITION TREES G is a single edge so T is a single Q-node Q

D ECOMPOSITION TREES If G is a parallel composition of s-p digraphs: G 1 and G 2, and T 1 and T 2 are their decomposition trees respectively, then T the decomposition tree of G has a root which is a P-node and two subtrees T 1 and T 2 P T1T1 T2T2

D ECOMPOSITION TREES If G is a series composition of s-p digraph:G 1 and G 2, the sink of G 1 is identified with the source of G 2.And T 1 and T 2 are their decomposition trees respectively, then T the decomposition tree of G has a root which is a S-node and two subtrees T 1 and T 2 S T1T1 T2T2

D ECOMPOSITION TREES The leaves of T are Q-nodes The internal nodes are either S-nodes or P-nodes. If a node has the same type as its parent it will be the right child T is unique for G If G has n nodes then T has O( n ) leaves and O( n ) nodes. (graph G is simple) T can be created in O( n ) time so will be assumed to be part of the input

P T1 T2 S P T1 S Q Q Q P S Q T2

P P S SQ QQ S SQ QQ S S Q P SQ QQ S SP QQ SQ QQ The leaves of T are Q- nodes The internal nodes are either S-nodes or P-nodes. If a node has the same type as its parent it will be the right child T is unique for G

C OMPONENTS Let C be a maximal path of same node type on T Let u 1 … u k children of C not on C Component is the part of G associated with a subsequence u i … u j where 1 ≤ i ≤ j ≤ k Component is closed when C is of S-nodes Otherwise it is open

C LOSED COMPONENT P P S SQ QQ S SQ QQ S S Q P SQ QQ S SP QQ SQ QQ

E. Di Giacomo, Drawing series-parallel graphs on restricted integer 3D grids, in Proc. 11th International Symp. on Graph Drawing (GD ’03), vol of Lecture Notes in Comput. Sci., Springer, 2004, pp. 238–246.

O PEN COMPONENT

N OT A CLOSED COMPONENT

L OOKING FOR A DRAWING FOR S - P DIGRAPH It has been proved that : there exist embedded s- p digraphs that any of their upward straight-line drawing that preserves embedding, requires exponential area. [ P.Bertolizza, R.F. Cohen, G.Di Battista, R. Tamassia and I.G. Tollis: “ How to Draw a Series-Parallel Digraph ”, Internat J.Comput. Geom. Appl., 4, , ] [ A. Garg and R. Tamassia,:” Efficient Computation of Planar Straight-Line Upward Drawing ”, In GD 93, (Proc. ALCOM Workshop on Graph Drawing.) ] To have a drawing with polynomial area it is necessary to change the given embedding.

R IGHT - PUSHED EMBEDDING The edge ( u,v ) in G is transitive if there is another path from u to v other than ( u,v ). Drawing transitive edge ( u, v ) on the right of all components with u and v poles

Δ-SP-D RAW Drawing inside a bounding triangle Δ(Γ) which is isosceles and right-angled. Series composition: one above the other Parallel – one to the right of the other base top side bottom side G1 G2 G1 G2

Δ-SP-D RAW – BASE If G is a single edge Draw it as a vertical edge Bounding triangle Δ(Γ) G t s

Δ-SP-D RAW – SERIES If G is a series composition of G1 and G2 Recursively draw Γ1 and Γ2 Translate Γ2 so G2’s sink is on G1’s source Extend bounding triangle Δ(Γ) accordingly G1 G2

P RESCRIBED - REGION (v, t) and (s, u) are rightmost edges on G1 λv and λu are rays parallel to G1’s bounding triangle G2 will be translated to anywhere on the right of λ v, λ u and k. G1 G2 v u k t s λvλv λuλu

If G is a parallel composition of G1 and G2 Recursively draw Γ1 and Γ2 Translate Γ2 to the “prescribed-region” of G2 (right of the dashes) Extend bounding triangle Δ(Γ) accordingly Move sources and sinks to upper and lower corners of Δ(Γ) Δ-SP-D RAW – PARALLEL G1 G2

t s P S S QQ SQ QQ s’ t’ 3 s” t” 1 2

M OVING SOURCE AND SINK s’ t’ 3 s” t” 1 2 t s 1 2 3

I NVARIANTS The drawing is contained inside the right angled triangle. The source and sink are placed at the bottom and top corner of Δ(Γ) respectively. For any vertex u adjacent to the source s of G, the wedge formed at u by rays with slopes -/2 and -/4 does not contain any vertex of G except s. For any vertex v adjacent to the sink t of G, the wedge formed at v by rays with slopes /2 and /4 does not contain any vertex of G except t. t s u

L EMMA 3.3 Let u and v be neighbors of the source so ( s, u ) is left of ( s, v ) Let λ u and λ v be rays of slope - /4 from u and v If invariant 3 holds then λ u is below λ v s uv λuλu λvλv

L EMMA 3.3 – OUTCOME If G2 is placed to the right of G1 and above λu where (s, u) is the rightmost edge of s on G1 Then no vertex of G2 is in the wedge limited by the –/4 ray from the neighbors of s Hence if invariant 3 is held on G1 and G2 it is also held on G Symmetrically invariant 4 can be proved s u

T HEREFORE Proving Invariants 3 and 4 guarantee that s and t can be moved as described in the algorithm without creating crossings. Invariant 2 states that left corner of Δ(Γ) is always empty, so G2’s left corner can be on the base of G1.

A REA OF THE TRIANGLE So the base of resulting triangle is equals the sum of bases of both triangles. For a graph with n vertices the length of the base is 2n. So the area needed is O(n 2 )

C ALCULATING DISTANCES We’ll describe Γ by: b = length of the base b’ = vertical distance to λu b” = vertical distance to λv v u κ t s λvλv λuλu b’ b’’ b

P ARALLEL DISTANCES To describe parallel combinations we’ll use: Δx = horizontal distance from Δ(Γ1) to Δ(Γ2) Δy = vertical distance from bottom ray of Δ(Γ1) to left corner of Δ(Γ2) Δx Δy

Δ-SP- LABEL input : decomposition tree T of G output : labeling b, b’, b’’ for each subtree of T if root = Q-node then b(T) = b’(T) = b’’(T) = 2 else Δ-SP-label of T1 and T2 (the subtrees) if root = S-node then b(T) = b(T1) + b(T2) b’(T) = b(T1) b’’(T) = b(T2) else root = P-node then b(T) = b(T1) + b(T2)+2Δx if T2 is Q-node (transitive edge) then b’(T) = b’’(T) = b(T) else b’’(T) = b(T1) + 2Δx – Δy + b’’(T2) b’(T) = b’(T2) + Δy

Δ-SP- LABEL Δx can be 0 Δy can be b’(T1) The area needed is O(n 2 ) The algorithm runs in O(n) and needs O(n) space end of Series-Parallel Digraphs