Drawing Problem. Possible properties Minimum number of edge crossings Small area Straight or short edges Good representation of graph structure...

Similar documents
Algorithms for Graph Visualization

CSCI-401 Examlet #5. Name: Class: Date: True/False Indicate whether the sentence or statement is true or false.

Multi-way Search Trees. (Multi-way Search Trees) Data Structures and Programming Spring / 25

NP-Completeness of Minimal Width Unordered Tree Layout

March 20/2003 Jayakanth Srinivasan,

Graph and Tree Layout

Hierarchies and Trees 1 (Node-link) CS Information Visualization November 12, 2012 John Stasko

Graph and Tree Layout

1.2 Graph Drawing Techniques

Algorithms for Graph Visualization Layered Layout

(2,4) Trees. 2/22/2006 (2,4) Trees 1

Algorithms for Graph Visualization Layered Layout

Graph Layout. Last Time: Conveying Structure. Framework for conveying structure. Photographs and illustrations. What is a good view?

An undirected graph is a tree if and only of there is a unique simple path between any 2 of its vertices.

Figure 4.1: The evolution of a rooted tree.

(2,4) Trees Goodrich, Tamassia (2,4) Trees 1

Trees : Part 1. Section 4.1. Theory and Terminology. A Tree? A Tree? Theory and Terminology. Theory and Terminology

FINALTERM EXAMINATION Fall 2009 CS301- Data Structures Question No: 1 ( Marks: 1 ) - Please choose one The data of the problem is of 2GB and the hard

Tree-Structured Indexes

12 Abstract Data Types

cs6964 March TREES & GRAPHS Miriah Meyer University of Utah

Algorithms. Deleting from Red-Black Trees B-Trees

CSE 530A. B+ Trees. Washington University Fall 2013

Basic Properties The Definition of Catalan Numbers

Canonical Forms and Algorithms for Steiner Trees in Uniform Orientation Metrics

Trees. Eric McCreath

We assume uniform hashing (UH):

Question Bank Subject: Advanced Data Structures Class: SE Computer

Recoloring k-degenerate graphs

Accepting that the simple base case of a sp graph is that of Figure 3.1.a we can recursively define our term:

EDGE OFFSET IN DRAWINGS OF LAYERED GRAPHS WITH EVENLY-SPACED NODES ON EACH LAYER

Spring 2018 Mentoring 8: March 14, Binary Trees

Straight-Line Drawings of Binary Trees with Linear Area and Arbitrary Aspect Ratio

STUDY AND IMPLEMENTATION OF SOME TREE DRAWING ALGORITHMS A THESIS SUBMITTED TO THE GRADUATE SCHOOL IN PARTIAL FULFILLMENT OF THE REQUIREMENTS

B-Trees. CS321 Spring 2014 Steve Cutchin

COMP 103 RECAP-TODAY. Priority Queues and Heaps. Queues and Priority Queues 3 Queues: Oldest out first

Sorting and Selection

Module 2: Classical Algorithm Design Techniques

CS171 Final Practice Exam

Section 1: True / False (1 point each, 15 pts total)

Trees. Russell Impagliazzo and Miles Jones Thanks to Janine Tiefenbruck. April 29, 2016

Programming II (CS300)

E.G.S. PILLAY ENGINEERING COLLEGE (An Autonomous Institution, Affiliated to Anna University, Chennai) Nagore Post, Nagapattinam , Tamilnadu.

Graph and Digraph Glossary

CS301 - Data Structures Glossary By

Section Summary. Introduction to Trees Rooted Trees Trees as Models Properties of Trees

The ILP approach to the layered graph drawing. Ago Kuusik

Chapter 10: Trees. A tree is a connected simple undirected graph with no simple circuits.

Tree-Structured Indexes. Chapter 10

Solutions. Suppose we insert all elements of U into the table, and let n(b) be the number of elements of U that hash to bucket b. Then.

Visualisation of state machines using the Sugiyama framework. Master of Science Thesis in Computer Science VIKTOR MAZETTI HANNES SÖRENSSON

Data Structures and Algorithms

Notes slides from before lecture. CSE 21, Winter 2017, Section A00. Lecture 10 Notes. Class URL:

6.856 Randomized Algorithms

Recitation 9. Prelim Review

Section 5.5. Left subtree The left subtree of a vertex V on a binary tree is the graph formed by the left child L of V, the descendents

Trees. Q: Why study trees? A: Many advance ADTs are implemented using tree-based data structures.

7.1 Introduction. A (free) tree T is A simple graph such that for every pair of vertices v and w there is a unique path from v to w

Tree-Structured Indexes

Algorithms (VII) Yijia Chen Shanghai Jiaotong University

MULTIMEDIA COLLEGE JALAN GURNEY KIRI KUALA LUMPUR

A GENERALIZATION OF THE

Binary Search Tree (3A) Young Won Lim 6/6/18

CS24 Week 8 Lecture 1

MAT 7003 : Mathematical Foundations. (for Software Engineering) J Paul Gibson, A207.

CS 465 Program 4: Modeller

Information Visualization. Jing Yang Spring Hierarchy and Tree Visualization

Computer Science 210 Data Structures Siena College Fall Topic Notes: Trees

Tree traversals and binary trees

Priority Queues and Binary Heaps

Algorithms and Theory of Computation. Lecture 7: Priority Queue

CS 151. Binary Trees. Friday, October 5, 12

Programming II (CS300)

Binary Trees

1 The range query problem

Hamilton paths & circuits. Gray codes. Hamilton Circuits. Planar Graphs. Hamilton circuits. 10 Nov 2015

Algorithms in Systems Engineering ISE 172. Lecture 16. Dr. Ted Ralphs

Tree-Structured Indexes ISAM. Range Searches. Comments on ISAM. Example ISAM Tree. Introduction. As for any index, 3 alternatives for data entries k*:

Copyright 2000, Kevin Wayne 1

CS127: B-Trees. B-Trees

Introduction to Algorithms

Trees. Tree Structure Binary Tree Tree Traversals

ITI Introduction to Computing II

Smart Graphics: Methoden 4 point feature labeling, graph drawing. Vorlesung Smart Graphics Andreas Butz, Otmar Hilliges Dienstag, 6.

Algorithms (VII) Yijia Chen Shanghai Jiaotong University

CMSC th Lecture: Graph Theory: Trees.

Chapter 6. Planar Orientations. 6.1 Numberings of Digraphs

Data Structures Question Bank Multiple Choice

On Minimizing Crossings in Storyline Visualizations

Interactive, Tree-Based Graph Visualization

Algorithm Design and Analysis

Name CPTR246 Spring '17 (100 total points) Exam 3

CS 4100 // artificial intelligence

CS 8391 DATA STRUCTURES

Algorithms and complexity: 2 The dictionary problem: search trees

Google SketchUp. and SketchUp Pro 7. The book you need to succeed! CD-ROM Included! Kelly L. Murdock. Master SketchUp Pro 7 s tools and features

Garbage Collection: recycling unused memory

8. Write an example for expression tree. [A/M 10] (A+B)*((C-D)/(E^F))

KAIST 8th ACM-ICPC Mock Competition

arxiv: v1 [cs.ds] 1 Sep 2015

Transcription:

Graph Drawing

Embedding Embedding For a given graph G = (V, E), an embedding (into R 2 ) assigns each vertex a coordinate and each edge a (not necessarily straight) line connecting the corresponding coordinates. 0 1 1 3 4 0 2 5 1 2 3 1 3 0 2 4 2 0 5 4 0 3 5 3 4 5 1 4 2 / 18

Drawing Problem Graph Drawing Problem For a given graph G, find an embedding Γ such that Γ satisfies a certain set of properties, i. e., Γ is a nice drawing of G. Possible properties Minimum number of edge crossings Small area Straight or short edges Good representation of graph structure... 3 / 18

Drawing (Rooted) Trees

Level-Based Approach Aesthetic Requirements (A0) Straight non-crossing edges. (A1) The layout displays the hierarchical structure of the tree, i. e., the y-coordinate of a node is given by its level. (A2) The order of the children of a node is displayed in the drawing. (A3) A parent node is centred above its children. (Exception: only one child in a binary tree) (A4) The drawing of a subtree does not depend on its position in the tree, i. e., equal subtrees are drawn identically up to translation and symmetry. (A5) The algorithm works symmetrically, i. e., the drawing of the reflection of a tree is the reflected drawing of the original tree. Sometimes: Only integer coordinates Minimal width 5 / 18

Reingold-Tilford Algorithm for Binary Trees General Idea Draw the left and right subtree recursively. Shift subtrees such that there is enough but minimal space between the subtrees. Place the root in the middle between the roots of the subtrees. Shifting Trees Each node knows its x-coordinate relative to its parent. Left (right) contour of a subtree: The sequence of leftmost (rightmost) nodes in each level. Can be implemented as list. Iterate top down over left contour of right subtree and right contour of left subtree. Compare coordinates of vertices and shift subtree if necessary. 6 / 18

Reingold-Tilford-Algorithm for Binary Trees Runtime for shifting (iteration over contour) Every node is accessed at most twice: When comparing with node left of it and when comparing with node right of it. Therefore: O(n) time Area and width Some trees require Ω(n 2 ) area Width not optimal (even with non-integer coordinates) Note: There is no efficient algorithm to compute the optimal width when restricted to integer coordinates. 7 / 18

Walker s Algorithm for General Trees Drawing general trees Same approach as Reingold and Tilford: Draw subtrees recursively, shift them to ovoid overlapping Problem: small subtrees between large subtrees Walker s idea Spread small subtrees evenly between large subtrees. Can be implemented to run in linear time. (See Buchheim et. al 2002) 8 / 18

Walker s Algorithm for General Trees Spreading of trees Index subtrees from left to right, starting with 0. Iterate over left contour of subtree T k. If T k is shifted by s because of T i, shift all subtrees T j between T i and T k by s j := s (j i)/(k i) T i T j T k s j s 9 / 18

Hierarchical Drawings

Hierarchical Drawings 11 / 18

Hierarchical Drawings Hierarchical Drawings = Drawing Directed Acyclic Graphs Requirements Edges point in a uniform direction (usually down) Polyline edges (straight between adjacent layers) Possibly short edges Possibly low number of edge crossings Possibly straight edges Possibly low width 12 / 18

Hierarchical Drawings Basic approach 1. Layer Assignment. Assign each vertex to a layer, i. e., a y-coordinate. Try to minimise width or depth. 2. Minimise Crossings. Determine order of vertices within a layer. Long edges are replaced dummy vertices such that edges are only between two layers. 3. Assign x-coordinates. Parent should be close to children, ideally centred above. Straighten long edges, i. e., try to align dummy edges of same edge below each other. 13 / 18

Layer Assignment Using topological order Assign all sinks to layer i. Remove sinks from graph. Repeat for i + 1 until graph is empty. Properties Runs in linear time. Gives minimal height. No control over width. 14 / 18

Precedence Constrained Scheduling Problem Given A set S = {J 1,..., J n } of jobs (All jobs require one time unit.) A partial order on S (If J i J j, J i has to be completed before J j can start.) A number k of processors Problem Find a valid scheduling for S with minimal height. Theorem There is (probably) no polynomial time algorithm to solve the Precedence Constrained Scheduling Problem. In 1972, Coffman and Graham gave an O(n 2 ) time 2-approximation algorithm, i. e., the generated hight is at most twice the optimal height. 15 / 18

Minimise Crossings Minimise Crossings Determine order of vertices within a layer to minimise number of crossings. Exact x-coordinates have no influence on number of crossings. We can ignore edge directions. Theorem For two given layers, there is (probably) no polynomial time algorithm to minimize the number of crossings, even if the order of vertices in one layer is fixed. Garey and Johnson 1983, Eades and Wormald 1994 There are many heuristics to minimise the number of crossings. 16 / 18

Force Based Drawings

Force Based Drawings General idea Vertices are equally charged particles repelling each other. Force decreases (quadratically) with distance. Edges are springs. If length is larger than 1, vertices are pulled towards each other. If length is shorter than 1, vertices are pushed away from each other. Force increases (or decreases) linear with distance. Algorithm Compute total force for each vertex. Move each vertex according to force. Repeat until stable position is found, i. e., force at each vertex is 0. 18 / 18