Introduction to Graph drawing

Slides:



Advertisements
Similar presentations
Great Theoretical Ideas in Computer Science
Advertisements

Great Theoretical Ideas in Computer Science for Some.
Cpt S 223 – Advanced Data Structures Graph Algorithms: Introduction
Orthogonal Drawing Kees Visser. Overview  Introduction  Orthogonal representation  Flow network  Bend optimal drawing.
Walks, Paths and Circuits Walks, Paths and Circuits Sanjay Jain, Lecturer, School of Computing.
Divide and Conquer. Subject Series-Parallel Digraphs Planarity testing.
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.
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.
Applications of Euler’s Formula for Graphs Hannah Stevens.
Lecture 16: DFS, DAG, and Strongly Connected Components Shang-Hua Teng.
More Graphs COL 106 Slides from Naveen. Some Terminology for Graph Search A vertex is white if it is undiscovered A vertex is gray if it has been discovered.
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.
Parallel Scheduling of Complex DAGs under Uncertainty Grzegorz Malewicz.
GOLOMB RULERS AND GRACEFUL GRAPHS
Great Theoretical Ideas in Computer Science.
Graph Drawing Introduction 2005/2006. Graph Drawing: Introduction2 Contents Applications of graph drawing Planar graphs: some theory Different types of.
Rectangle Visibility Graphs: Characterization, Construction, Compaction Ileana Streinu (Smith) Sue Whitesides (McGill U.)
Computational Geometry Seminar Lecture 1
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,
מבנה המחשב – מבוא למחשבים ספרתיים Foundations of Combinational Circuits תרגול מספר 3.
COMP4048 Planar and Orthogonal Graph Drawing Algorithms Richard Webber National ICT Australia.
Brute-Force Triangulation
Graph Theory Chapter 6 Planar Graphs Ch. 6. Planar Graphs.
1 Graphs Algorithms Sections 9.1, 9.2, and Graphs v1v1 v2v2 v5v5 v7v7 v8v8 v3v3 v6v6 v4v4 A graph G = (V, E) –V: set of vertices (nodes) –E: set.
Chapter 9 – Graphs A graph G=(V,E) – vertices and edges
UNC Chapel Hill M. C. Lin Point Location Reading: Chapter 6 of the Textbook Driving Applications –Knowing Where You Are in GIS Related Applications –Triangulation.
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.:
Advanced Seminar on Graph Drawing – Planar Orientations Olga Maksin Victor Makarenkov Department of Computer Science. Ben-Gurion University of the Negev.
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.
Lecture 11 Algorithm Analysis Arne Kutzner Hanyang University / Seoul Korea.
Arrangements and Duality Sanjay Sthapit Comp290 10/6/98.
Planar Graphs Graph Coloring
Agenda Review: –Planar Graphs Lecture Content:  Concepts of Trees  Spanning Trees  Binary Trees Exercise.
CSCI 115 Chapter 8 Topics in Graph Theory. CSCI 115 §8.1 Graphs.
Introduction to Graph Theory By: Arun Kumar (Asst. Professor) (Asst. Professor)
Great Theoretical Ideas in Computer Science for Some.
1 Schematization of Networks Rida Sadek. 2 This talk discusses: An algorithm that is studied in the following papers:  S. Cabello, M. de Berg, and M.
COMPSCI 102 Introduction to Discrete Mathematics.
Indian Institute of Technology Kharagpur PALLAB DASGUPTA Graph Theory: Planarity Pallab Dasgupta, Professor, Dept. of Computer Sc. and Engineering, IIT.
Graphs and Shortest Paths Using ADTs and generic programming.
The Jordan Arc theorem. A Lemma: For a connected, finite union of open discs, no two of which are mutually tangent, the outer boundary (which separates.
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.
Data Structures and Algorithm Analysis Lecture 5
3. Polygon Triangulation
Algorithms and Networks
Computational Geometry
Graphs: Definitions and Basic Properties
Great Theoretical Ideas In Computer Science
Richard Anderson Lecture 26 NP-Completeness
Graph theory Definitions Trees, cycles, directed graphs.
Geometric Graphs and Quasi-Planar Graphs
Great Theoretical Ideas in Computer Science
Planarity Testing.
Discrete Mathematics for Computer Science
Lecture 10 Algorithm Analysis
The Art Gallery Problem
Polygon Triangulation
Depth Estimation via Sampling
Instructor: Shengyu Zhang
I. The Problem of Molding
Computational Geometry
Planarity.
Discrete Mathematics for Computer Science
Agenda Review Lecture Content: Shortest Path Algorithm
Minimum Spanning Trees
Presentation transcript:

Introduction to Graph drawing Fall 2010 Battista, G. D., Eades, P., Tamassia, R., and Tollis, I. G. 1998 Graph Drawing: Algorithms for the Visualization of Graphs. 1st. Prentice Hall PTR.

Tessellation And Visibility Representation of Graphs

Tile A tile is a rectangle with sides parallel to the coordinate axes. A tile can be unbounded or can degenerate to a segment or a point. Two tiles are horizontally (vertically) adjacent if they share a portion of a vertical (horizontal) side. Tiles: Vertically adjacent:

Tessellation Representation Let G be a planar st-graph. A tessellation representation Θ for G maps each object o of G into a tile Θ(o) such that: The interiors of tiles Θ(o1) and Θ(o2) are disjoint whenever o1 != o2. The union of all tiles Θ(o), is a rectangle. Tiles Θ(o1) and Θ(o2) are horizontally adjacent if and only if o1 = left(o2) or o1 = right(o2) or o2 = left(o1) or o2 = right(o1). Tiles Θ(o1) and Θ(o2) are vertically adjacent if and only if o1 = orig(o2) or o1 = dest(o2) or o2 = orig(o1) or o2 = dest(o1).

Tessellation Representation Algorithm Tessellation: Input: a planer st-graph. Output: a tessellation representation Θ for G such that each vertex and face is a segment. Construct planar st-graph G* Compute a topological numbering Y of G Compute a topological numbering X of G* For each object , let the coordinates of tile Θ(o) be: xL(o)=X(left(o)); xR(o)=X(right(o)); yB(o)=X(orig(o)); yT(o)=X(dest(o));

Planar Graph A planar graph is a graph which can be embedded in the plane, i.e., it can be drawn on the plane in such a way that its edges intersect only at their endpoints. Faces

ST-Graph An acyclic digraph with a single source s and a single sink t is called an st-graph. Sink “t” has no outgoing edges! t s Source “s” has no incoming edges!

Planar ST-Graph A planar st-graph is an st-graph that is planar and embedded with vertices s and t on the boundary of the external face. t s

Planar ST-Graph Let G be a planer st-graph and F be its set of faces. We conventionally assume that F contains two representatives for the external face: The “left external face” s* The “right external face” t* t* s*

Planar ST-Graph For each edge e = (u,v), we define orig(e) = u and dest(e) = v. We define left(e) (resp. right(e)) to be the face to the left (resp. right) of e. dest(e) = v v orig(e) = u f1 left(e) = f1 e u left(e) = f2 f2

Planar ST-Graph Properties Lemma 1: Each face f of G consists of two directed paths with common origin called orig(f), and common destination called dest(f). Proof: Let f be a face of G for which the lemma is not true. t dest(f) There must be a path from vertex u to the “sink” t Since the graph is planar there must be a node where the passes intersect w u orig(f) s

Planar ST-Graph Properties Lemma 2: The incoming edges for each vertex of G appear consecutively around v, and so do the outgoing edges. Proof: The lemma holds trivially for the vertices s and t. Let v be any other vertex, and suppose for a contradiction, that there are edges (v,w0), (w1,v), (v,w2), (w3,v). t Because every vertex in a st-graph has a simple path from “s” to “t” we add the following paths… Because the graph is planar we add the vertex “x” to the graph. We now have a cycle! w0 w1 v x w2 w3 s

Planar ST-Graph Properties Since the incoming (outgoing) edges of each vertex of G appear consecutively we define the face separating the incoming edges from the outgoing edges in clockwise order, left(v), and the other separating face is called right(v). left(v) right(v)

Planar ST-Graph G* We define a digraph G* associated with planar st- graph G, as follows: The vertex set of G* is the set F of faces (recall that F has two representatives, s* and t*, of the external face). For every edge e != (s,t) of G, G* has an e* = (f,g) where f = left(e) and g = right(e). right(e) e left(e) Notice that G* is a planar st-graph as well

An element of is called an object of planar st- graph G. For vertex v, we define orig(v) = dest(v) = v. For a face f, we define left(f) = right(f) = f. * Reminder we have already defined previously: left(v), right(v), left(e), right(e), orig(e), dest(e), orig(f) and dest(f).

Lemma For any two objects o1 and o2 of a planar st-graph G, exactly one of the following holds: G has a directed path from dest(o1) to orig(o2). G has a directed path from dest(o2) to orig(o1). G* has a directed path from right(o1) to left(o2). G* has a directed path from right(o2) to left(o2).

Tessellation Representation Algorithm Tessellation: Input: a planer st-graph. Output: a tessellation representation Θ for G such that each vertex and face is a segment. Construct planar st-graph G* Compute a topological numbering Y of G Compute a topological numbering X of G* For each object , let the coordinates of tile Θ(o) be: xL(o)=X(left(o)); xR(o)=X(right(o)); yB(o)=X(orig(o)); yT(o)=X(dest(o));

Numbering of Digraphs A topological numbering of G is an assignment of numbers to the vertices of G, such that, for every edge (u,v) of G, the number assigned to v is greater then the one assigned to u. 5 2 3 4 2 1

Numbering of Digraphs A topological sorting is a topological numbering of G, such that every vertex is assigned a distinct integer between 1 and n. A topological sorting is unique if G has a directed path that visits every vertex. 6 5 3 4 2 1

Numbering of Digraphs The following statements are equivalent: G is acyclic. G admits a topological numbering. G admits a topological sorting. In other words a topological numbering (sorting) can be done only on an acyclic graph.

Tessellation Representation Algorithm Tessellation: Input: a planer st-graph. Output: a tessellation representation Θ for G such that each vertex and face is a segment. Construct planar st-graph G* Compute a topological numbering Y of G Compute a topological numbering X of G* For each object , let the coordinates of tile Θ(o) be: xL(o)=X(left(o)); xR(o)=X(right(o)); yB(o)=X(orig(o)); yT(o)=X(dest(o)); 4 3 1 4 3 3 2 4 X(left(e)) = 0 X(right(e)) = 1 Y(orig(e)) = 0 Y(dest(e)) = 2 2 2 2 1 1 3 e 1 1 1 2 3 4

Tessellation Representation Algorithm Tessellation: Input: a planer st-graph. Output: a tessellation representation Θ for G such that each vertex and face is a segment. Construct planar st-graph G* Compute a topological numbering Y of G Compute a topological numbering X of G* For each object , let the coordinates of tile Θ(o) be: xL(o)=X(left(o)); xR(o)=X(right(o)); yB(o)=X(orig(o)); yT(o)=X(dest(o)); 4 e 3 e 1 4 3 3 2 4 X(left(e)) = 0 X(right(e)) = 1 Y(orig(e)) = 2 Y(dest(e)) = 4 X(left(e)) = 3 X(right(e)) = 4 Y(orig(e)) = 2 Y(dest(e)) = 4 2 2 2 1 1 3 1 1 1 2 3 4

Tessellation Representation Algorithm Tessellation: Input: a planer st-graph. Output: a tessellation representation Θ for G such that each vertex and face is a segment. Construct planar st-graph G* Compute a topological numbering Y of G Compute a topological numbering X of G* For each object , let the coordinates of tile Θ(o) be: xL(o)=X(left(o)); xR(o)=X(right(o)); yB(o)=X(orig(o)); yT(o)=X(dest(o)); 4 3 1 4 3 3 2 4 2 2 2 1 1 3 1 1 1 2 3 4

Modification to support user defined constraints on the size of the edge tiles: Algorithm Tessellation: Input: a planer st-graph. Output: a tessellation representation Θ for G such that each vertex and face is a segment. Construct planar st-graph G* Compute a topological numbering Y of G Compute a topological numbering X of G* For each object , let the coordinates of tile Θ(o) be: xL(o)=X(left(o)); xR(o)=X(right(o)); yB(o)=X(orig(o)); yT(o)=X(dest(o)); Algorithm Tessellation: Input: a planer st-graph. Output: a tessellation representation Θ for G such that each vertex and face is a segment. Construct planar st-graph G* Assign weight h(e) to each edge e of G and compute an optimal weighted topological numbering Y of G Assign weight w(e) to each edge e* of G* and compute an optimal weighted topological numbering X of G* For each object , let the coordinates of tile Θ(o) be: xL(o)=X(left(o)); xR(o)=X(right(o)); yB(o)=X(orig(o)); yT(o)=X(dest(o));

A weighted topological numbering is a topological numbering of G, such that for every edge e=(u,v) of G the number assigned to v is greater than or equal to the number assigned to u plus the weight of (u,v). number(v) ≥ number(u)+weight(u,v)

Tessellation Representation The correctness of the algorithm is based on Lemma 3: Let there be tile t1 and tile t2, from Lemma 3 t1 is either: above t2, below t2, left of t2 or right of t2. And only one of this directions is true. Since each line of the algorithm is O(n), the total runtime of the algorithm is O(n). The size of the Tessellation Representation can be modified by modifying the topological numbering (e.g. increasing the numbering to be 0..2..4 instead of 0..1..2 will make a Tessellation Representation twice bigger). For any two objects o1 and o2 of a planar st-graph G, exactly one of the following holds: G has a directed path from dest(o1) to orig(o2). G has a directed path from dest(o2) to orig(o1). G* has a directed path from right(o1) to left(o2). G* has a directed path from right(o2) to left(o2).

Visibility Representation Let G be a planar st-graph. A visibility representation Γ of G draws each vertex v as a horizontal segment, called vertex segment Γ(v), and each edge (u,v) as vertical segment, called edge segment Γ(u,v) such that: The vertex segments do not overlap. The edge segments do not overlap. Edge-segment Γ(u,v) has its bottom end point on Γ(u), its top end-point on Γ(v), and does not intersect any other vertex segment.

Visibility Representation Algorithm Visibility Input: a planer st-graph G with n vertices. Output: visibility representation Γ of G with integer coordinates and area O(n2) Construct planar st-graph G* Assign unit weights to edges of G and compute an optimal weighted topological numbering Y of G Assign unit weights to edges of G* and compute an optimal weighted topological numbering X of G* For each vertex v, draw the vertex-segment Γ(v) at y-coordinate Y(v) and between x-coordinates X(left(v)) and X(right(v)-1). for each vertex v do draw Γ(v) as the horizontal segment with y(Γ(v) )=Y(v); xL(Γ(v) )=X(left(v)); xR(Γ(v) )=X(right(v)-1); endfor For each edge e, draw the edge-segment Γ(e) at x-coordinate X(left(e), between y-coordinates Y(orig(e)) and Y(dest(e)-1). for each edge e do draw Γ(e) as the vertical segment with x(Γ(e) )= X(left(e)); yB(Γ(e) )=Y(orig(e)); yT(Γ(e) )=Y(dest(e));

Visibility Representation For each vertex v, draw the vertex-segment Γ(v) at y-coordinate Y(v) and between x-coordinates X(left(v)) and X(right(v)-1). for each vertex v do draw Γ(v) as the horizontal segment with y(Γ(v) )=Y(v); xL(Γ(v) )=X(left(v)); xR(Γ(v) )=X(right(v)-1); endfor 4 3 1 4 3 3 2 4 2 2 2 1 1 3 1 1 1 2 3 4

Visibility Representation For each edge e, draw the edge-segment Γ(e) at x-coordinate X(left(e), between y-coordinates Y(orig(e)) and Y(dest(e)-1). for each edge e do draw Γ(e) as the vertical segment with x(Γ(e) )= X(left(e)); yB(Γ(e) )=Y(orig(e)); yT(Γ(e) )=Y(dest(e)); endfor 4 3 1 4 3 3 2 4 2 2 2 1 1 3 1 1 1 2 3 4

Visibility Representation The correctness of the algorithm By lemma 3 and the construction of the algorithm: Any two vertex segments are separated by a horizontal or vertical strip of at least unit width (The vertex segments do not overlap). Any two edge segments on opposite sides of a face are separated by a vertical strip of at least a unit width (The edge segments do not overlap). Each edge segments (u,v) has its bottom point intersecting with u vertex segment, and his upper point intersecting with v vertex segment (sufficing the 3rd condition). The runtime of the algorithm is O(n) since each step is O(n). The area of the representation is O(n2) For any two objects o1 and o2 of a planar st-graph G, exactly one of the following holds: G has a directed path from dest(o1) to orig(o2). G has a directed path from dest(o2) to orig(o1). G* has a directed path from right(o1) to left(o2). G* has a directed path from right(o2) to left(o2).