Seminar Graph Drawing H.1 - 3.2: Introduction to Graph Drawing Jesper Nederlof Roeland Luitwieler.

Slides:



Advertisements
Similar presentations
Octagonal Drawing Johan van Rooij. Overview What is an octagonal drawing Good slicing graphs Octagonal drawing algorithm for good slicing graphs Correctness.
Advertisements

Chapter 9 (Layered drawings of digraphs) By: Waldo & Ludo uv.
Planar graphs Algorithms and Networks. Planar graphs2 Can be drawn on the plane without crossings Plane graph: planar graph, given together with an embedding.
Orthogonal Drawing Kees Visser. Overview  Introduction  Orthogonal representation  Flow network  Bend optimal drawing.
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.
Efficient access to TIN Regular square grid TIN Efficient access to TIN Let q := (x, y) be a point. We want to estimate an elevation at a point q: 1. should.
Planar Orientations Chapter 4 ( ) in the book Written By: Tomer Heber.
Approximations of points and polygonal chains
Advanced Topics in Algorithms and Data Structures Lecture 7.2, page 1 Merging two upper hulls Suppose, UH ( S 2 ) has s points given in an array according.
Lecture 3: Parallel Algorithm Design
2/14/13CMPS 3120 Computational Geometry1 CMPS 3120: Computational Geometry Spring 2013 Planar Subdivisions and Point Location Carola Wenk Based on: Computational.
Greedy Algorithms Greed is good. (Some of the time)
Label Placement and graph drawing Imo Lieberwerth.
Divide and Conquer: Rooted Trees. 2 Introduction Rooted trees: acyclic graphs (no cycles) all edges directed away from root. downward planar drawing (child.
Brute-Force Triangulation
Label placement Rules, techniques. Labels on a map Text, name of map features No fixed geographical position Labels of point features (0-dim), line features.
UNC Chapel Hill M. C. Lin Polygon Triangulation Chapter 3 of the Textbook Driving Applications –Guarding an Art Gallery –3D Morphing.
Tree Drawing Algorithms and Visualization Methods Kai (Kevin) Xu.
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.
Discrete Structure Li Tak Sing( 李德成 ) Lectures
Advanced Topics in Algorithms and Data Structures Lecture 7.1, page 1 An overview of lecture 7 An optimal parallel algorithm for the 2D convex hull problem,
1 Monotone Drawings of Graphs Thanks to Peter Eades Patrizio Angelini, Enrico Colasante, Giuseppe Di Battista, Fabrizio Frati,
Constrained Optimisation and Graph Drawing Tim Dwyer Monash University Australia
Rectangular Drawing (continue) Harald Scheper. Overview algorithm (directions) algorithm in linear time outline of algorithm (placement) Rect. Drawings.
Graph Drawing Introduction 2005/2006. Graph Drawing: Introduction2 Contents Applications of graph drawing Planar graphs: some theory Different types of.
Implicit Hitting Set Problems Richard M. Karp Harvard University August 29, 2011.
A general approximation technique for constrained forest problems Michael X. Goemans & David P. Williamson Presented by: Yonatan Elhanani & Yuval Cohen.
CSE 6405 Graph Drawing Text Books T. Nishizeki and M. S. Rahman, Planar Graph Drawing, World Scientific, Singapore, G. Di Battista,
I/O-Algorithms Lars Arge University of Aarhus March 1, 2005.
SIMS 247: Information Visualization and Presentation jeffrey heer
2IL90: Graph Drawing Introduction Fall Graphs  Vertices  Edges.
Chapter 4: Straight Line Drawing Ronald Kieft. Contents Introduction Algorithm 1: Shift Method Algorithm 2: Realizer Method Other parts of chapter 4 Questions?
R-Trees 2-dimensional indexing structure. R-trees 2-dimensional version of the B-tree: B-tree of maximum degree 8; degree between 3 and 8 Internal nodes.
Routing 2 Outline –Maze Routing –Line Probe Routing –Channel Routing Goal –Understand maze routing –Understand line probe routing.
Floorplanning. Obtained by subdividing a given rectangle into smaller rectangles. Each smaller rectangle corresponds to a module.
Important Problem Types and Fundamental Data Structures
Brute-Force Triangulation
Binary Trees Chapter 6.
Graph Algorithms Using Depth First Search Prepared by John Reif, Ph.D. Distinguished Professor of Computer Science Duke University Analysis of Algorithms.
Delaunay Triangulations Presented by Glenn Eguchi Computational Geometry October 11, 2001.
CSE53111 Computational Geometry TOPICS q Preliminaries q Point in a Polygon q Polygon Construction q Convex Hulls Further Reading.
CPSC 335 BTrees Dr. Marina Gavrilova Computer Science University of Calgary Canada.
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.
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
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.
Crossing Minimisation (1) Ronald Kieft. Global contents Specific 2-layer Crossing Minimisation techniques After the break, by Johan Crossing Minimisation.
Department of Computer Science and Engineering Bangladesh University of Engineering and Technology Md. Emran Chowdhury Department of CSE Northern University.
Straight line drawings of planar graphs – part II Roeland Luitwieler.
1 Orthogonal Drawing (continued)  Sections 8.3 – 8.5 from the book  Bert Spaan.
A split&push approach to 3D orthogonal drawings giuseppe di battista univ. rome III maurizio patrignani univ. rome III francesco vargiu aipa.
Advanced Seminar on Graph Drawing – Planar Orientations Olga Maksin Victor Makarenkov Department of Computer Science. Ben-Gurion University of the Negev.
Chapter 6 Binary Trees. 6.1 Trees, Binary Trees, and Binary Search Trees Linked lists usually are more flexible than arrays, but it is difficult to use.
Paradigms for Graph Drawing Graph Drawing: Algorithms for the Visualization of Graphs - Chapter 2 Presented by Liana Diesendruck.
Agenda Review: –Planar Graphs Lecture Content:  Concepts of Trees  Spanning Trees  Binary Trees Exercise.
© The McGraw-Hill Companies, Inc., Chapter 12 On-Line Algorithms.
UNC Chapel Hill M. C. Lin Delaunay Triangulations Reading: Chapter 9 of the Textbook Driving Applications –Height Interpolation –Constrained Triangulation.
11 -1 Chapter 12 On-Line Algorithms On-Line Algorithms On-line algorithms are used to solve on-line problems. The disk scheduling problem The requests.
Chapter 11. Chapter Summary  Introduction to trees (11.1)  Application of trees (11.2)  Tree traversal (11.3)  Spanning trees (11.4)
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.
Honors Track: Competitive Programming & Problem Solving Seminar Topics Kevin Verbeek.
Algorithms and Networks
Lecture 3: Parallel Algorithm Design
Graph Drawing.
Chapter 5 : Trees.
Greedy Technique.
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.
Chapter 6: Transform and Conquer
Presentation transcript:

Seminar Graph Drawing H : Introduction to Graph Drawing Jesper Nederlof Roeland Luitwieler

Outline Chapter 2 (Paradigms for Graph Drawing) –Parameters –Paradigms –General framework for Graph Drawing (GD) Chapter 3 (Divide & Conquer) –Trees –Series-Parallel Digraphs

Parameters Different contexts pose different requirements In general: readable to the user A “nice” graph drawing satisfies –Drawing conventions (general musts) –Aesthetics (desires) –Constraints (specific musts)

Parameters: drawing conventions Polyline drawing –Edges are drawn as polygonal chains Straight-line drawing –Edges are drawn as straight lines Orthogonal drawing –Like a polyline drawing, but only horizontal and vertical line segments are allowed Grid drawing –Vertices, crossings and edge bends have integer coordinates

Parameters: drawing conventions Planar drawing –No crossings are allowed (Strictly) upward drawing –Arcs are drawn as nondecreasing (strictly increasing) curves in the vertical direction (Strictly) downward drawing –Arcs are drawn as nonincreasing (strictly decreasing) curves in the vertical direction

Parameters: aesthetics Properties of the drawing we would like to apply as much as possible –Minimize number of crossings –Minimize area (polygon or convex hull) –Min. sum / maximum / variance of edge lengths –Min. sum / max. / var. of number of bends per edge –Max. angle between two incident arcs of a vertex –Min. aspect ratio: longest side convex hull over shortest side convex hull –Symmetry

Parameters: constraints Refer to specific subgraphs or subdrawings Examples from the book: –Place some given vertices In the centre On the outer boundary Close together –Draw a given path horizontally aligned from left to right (or vertically aligned from top to bottom) –Draw a given subgraph with a predefined shape

GD algorithms Graph drawing algorithms –Satisfy as much parameters as possible Usually parameters conflict Best drawing doesn’t exist most of the time Establish precedence relation among aesthetics (often implicit in algorithm) –Are computationally as efficient as possible Often real-time response required

Paradigms Topology-Shape-Metrics approach Hierarchical approach Visibility approach Augmentation approach Force-Directed approach (first session) Divide & Conquer approach (Ch. 3)

Topology-Shape-Metrics approach Suitable for orthogonal grid drawings Based on three equivalence classes –Topology: the same up to a continuous deformation (the same neighbour order) –Shape: the same up to changing lengths of line segments, but no angles between them –Metrics: the same up to a translation / rotation –Metrics implies Shape implies Topology

Topology-Shape-Metrics approach 1.Planarization step: determine topology (Ch. 3, 7) –Minimize number of edge crossings –Introduce dummy vertices if necessary –Output: embedded planar graph 2.Orthogonalization step: determine shape (Ch. 4, 5) –Make drawing orthogonal (introduce bends) –Output: orthogonal representation 3.Compaction step: determine metrics (Ch. 5) –Usually: minimize area –Finally, replace dummy vertices by crossings –Output: orthogonal grid drawing

Topology-Shape-Metrics approach Aesthetics –Implicit precedence (crossings more important then bends, etc.) –Others can be taken into account Constraints –Several can be taken into account –Must be treated in the right step The above goes for all of the approaches discussed in this session

Hierarchical approach Suitable for polyline drawings, especially upward (or downward) polyline drawings Input: acyclic digraph, however: –If digraph not acyclic, arcs can be temporarily reversed –If graph not directed, edges can be temporarily replaced by arcs (not introducing cycles, of course)

Hierarchical approach 1.Layer assignment step: determine y-coordinates (Ch. 9) 1.Assign vertices to layers (layer = y-coordinate) –Output: layered digraph 2.Force children on to reside on the next layer only (by introducing dummy vertices on each layer spanned) –Output: proper layered digraph 2.Crossing reduction step: determine topology (Ch. 9) –Determine the order of vertices for each layer –Output: proper layered digraph 3.x-coordinate assignment step: determine x-coordinates (Ch. 9) –Finally, replace dummy vertices by bends –Output: strictly downward (or upward) polyline drawing

Visibility approach Suitable for polyline drawings 1.Planarization step: determine topology (Ch. 3, 7) –Minimize number of edge crossings –Introduce dummy vertices if necessary –Output: embedded planar graph 2.Visibility step (Ch. 4) –Map vertices to horizontal segments, edges to vertical segments between the associated horizontal segments, not intersecting any other horizontal segments –Usually: minimize area –Output: visibility representation 3.Replacement step (Ch. 4) –Replacement strategies exist constructing a planar polyline drawing –Finally, replace dummy vertices by crossings –Output: polyline drawing

Augmentation approach Suitable for polyline drawings 1.Planarization step: determine topology (Ch. 3, 7) –Minimize number of edge crossings –Introduce dummy vertices if necessary –Output: embedded planar graph 2.Augmentation step (Ch. 4) –Add dummy edges to obtain a maximal planar graph (=triangulated planar graph) –Usually: minimize degrees of vertices –Output: triangulated planar graph 3.Triangulation drawing step –Represent each face as a triangle –Finally, remove dummy edges, replace dummy vertices by crossings –Output: polyline drawing

General framework for GD There are many other possible approaches –Mix functional steps from approaches Take input and output classes into account! –Lots of unmentioned steps exist –Invent your own steps… Many steps will be treated in this course

Chapter 3 Tree drawing –Layering technique for normal drawings –Radial drawing –Horizontal-vertical-drawing Series-Parallel Digraph drawing

Layering Most natural and most used way.

Layering On a grid Planar Parent always higher than child. Same subtrees give same drawing. Tries to minimize the total width of the drawing. Not always optimal.

Layering Y-coordinate = -depth

Layering: X-coordinate Base-case: T is a leaf, trivial Divide: Recur on left and right subtree Conquer: –Move the drawing of the left and right subtree towards each other until the minimum horizontal distance becomes 2 –Place root in the middle of its children. –Compute the left contour –Compute the right contour Input: Tree T Output: Drawing of T and his contours

Layering: X-coordinate The left (right) contour of a tree with height h is a sequence of vertices v 1,..,v h such that v i is the most left (right) vertex with depth i. These contours can be computed during the conquer step.

Layering: Computing contours Contour of base case (leaf) is trivial. Compute the left contour of the new tree during the conquer step(right contour can be computed in a similar way) : –h(T) = height of T –lc(T) = left contour of T –T’ and T’’ are the left and right subtrees –2 cases: h(T’) ≥ h(T’’): lc(T) = v concatenated with lc(T’) h(T’) < h(T’’): lc(T) = v concatenated with lc(T’) followed by lc(T’’) starting with element h(T’)+1

Layering: Running Time The procedure will be executed one time on each subtree. On each execution 3* (1 + min{h(T’),h(T’’)}) operations are done for computing the distance between the subtrees and computing the contours of T. If n is the number of nodes in the tree, the running time is bounded by

Layering: Running time

Layering: Not optimal

Radial Drawing Variation on layered drawing: Layers become circles It seems reasonably to make the wedge angle proportional to the size of the subtree. Problem:

Radial Drawing So use a convex subset of the wedge Now, determine the angle β v of the wedge with parent(u) = v as follows: a cici C i+1 Where l(v) = #leaves of subtree with v as root Now, we can place the vertices in the middle of the wedge.

Horizontal Vertical Drawing Only orthogonal lines allowed Simple algorithm “Right-Heavy-HV-Tree-Draw”: –Divide: Recursively construct drawings of left and right subtrees of T –Conquer: Place the largest subtree (most leaves) to the right and the other one below the root Used area (of smallest rectangle containing the drawing) is O(n log n). Poor aspect ratio (n / log n)

Recursive winding Arrange the tree such that l(leftChild(v)) ≤ l(rightChild(v)) for each v Fix a parameter A to determine later W(n) and H(n) are the width and height of the drawing of a tree with n nodes. If n ≤ A. Using the algorithm “Right-Heavy- HV-Tree-Draw”, gives: –H(n) ≤ log 2 n –W(n) ≤ A Input: Tree T with l leaves Output: Horizontal-Vertical drawing of T

Recursive winding If n > A: Find the vertex v k on the right contour, such that: –l(v k ) > n – A –l(v k+1 ) ≤ n -A. v1v1 v2v2 V k-1 vkvk T1T1 T2T2 T k-1 T’T’’ T1T1 T2T2 T k-2 T k-1 v1v1 v2v2 V k-2 V k-1 k

Recursive winding n’ and n’’ are the number of leaves of the left and right subtree W(n) ≤ max{W(n'), W(n"), A} + O(log n) H(n) ≤ max{H(n') + H(n") + O(log n), A} A = (n log n) 1/2 max(n', n") ≤ n – A Solution: –W(n)=O(n log n) 1/2 Aspect ratio = O(1)

Series parallel digraphs

Divide & Conquer again Base Case: If T is a leaf, draw a single vertical line. Divide: Else, construct a drawing of the left and right subtree. –Glue the drawings together depending on the kind of node. Input: Tree T with l leaves Output: Horizontal-Vertical drawing of T

Divide & Conquer again 1 2

Conclusion Different applications require different drawings Several paradigms exist to meet those requirements The divide & conquer paradigm can be used for drawing trees and series parallel graphs Questions?