On Minimizing Crossings in Storyline Visualizations

Similar documents
arxiv: v1 [cs.ds] 1 Sep 2015

Sorting and Searching

Sorting and Searching

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

Lecture 5 Using Data Structures to Improve Dijkstra s Algorithm. (AM&O Sections and Appendix A)

Technical University of Denmark

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

Block Crossings in Storyline Visualizations

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

ARC 088/ABC 083. A: Libra. DEGwer 2017/12/23. #include <s t d i o. h> i n t main ( )

CS171 Final Practice Exam

Priority Queues and Binary Heaps

Solutions. (a) Claim: A d-ary tree of height h has at most 1 + d +...

Trees & Tree-Based Data Structures. Part 4: Heaps. Definition. Example. Properties. Example Min-Heap. Definition

Lower Bound on Comparison-based Sorting

Fixed-Parameter Algorithms, IA166

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

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

9. Heap : Priority Queue

Heaps. 2/13/2006 Heaps 1

Heap: A binary heap is a complete binary tree in which each, node other than root is smaller than its parent. Heap example: Fig 1. NPTEL IIT Guwahati

1 Introduction 2. 2 A Simple Algorithm 2. 3 A Fast Algorithm 2

We will show that the height of a RB tree on n vertices is approximately 2*log n. In class I presented a simple structural proof of this claim:

10. EXTENDING TRACTABILITY

Embedding a Planar Graph using a PQ-Tree

CS171 Final Practice Exam

Self-Balancing Search Trees. Chapter 11

CSE 332 Autumn 2013: Midterm Exam (closed book, closed notes, no calculators)

Recall: Properties of B-Trees

COMP 251 Winter 2017 Online quizzes with answers

Design and Analysis of Algorithms - - Assessment

CSCE 411 Design and Analysis of Algorithms

Binary Heaps in Dynamic Arrays

CS521 \ Notes for the Final Exam

Chapter 6 Heapsort 1

KAIST 8th ACM-ICPC Mock Competition

Faster parameterized algorithms for Minimum Fill-In

Final Examination CSE 100 UCSD (Practice)

Chapter 2: Basic Data Structures

Midterm solutions. n f 3 (n) = 3

Topic: Heaps and priority queues

with Dana Richards December 1, 2017 George Mason University New Results On Routing Via Matchings Indranil Banerjee The Routing Model

Figure 4.1: The evolution of a rooted tree.

Friday Four Square! 4:15PM, Outside Gates

Binary heaps (chapters ) Leftist heaps

Conflict Graphs for Combinatorial Optimization Problems

Recent Advances in FPT and Exact Algorithms for NP-Complete Problems

Minimum-weight tree shortcutting for Metric TSP

CSE 100: B+ TREE, 2-3 TREE, NP- COMPLETNESS

2-3 Tree. Outline B-TREE. catch(...){ printf( "Assignment::SolveProblem() AAAA!"); } ADD SLIDES ON DISJOINT SETS

Search Trees - 1 Venkatanatha Sarma Y

Algorithms and Theory of Computation. Lecture 7: Priority Queue

Reference Sheet for CO142.2 Discrete Mathematics II

Heaps Goodrich, Tamassia. Heaps 1

Trees and Intro to Counting

CMSC 341 Lecture 15 Leftist Heaps

Given a graph, find an embedding s.t. greedy routing works

Data Structures and Algorithms

3 Competitive Dynamic BSTs (January 31 and February 2)

HEAPS: IMPLEMENTING EFFICIENT PRIORITY QUEUES

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

Exam Sample Questions CS3212: Algorithms and Data Structures

CS2223: Algorithms Sorting Algorithms, Heap Sort, Linear-time sort, Median and Order Statistics

CMSC 341 Lecture 15 Leftist Heaps

Here is a recursive algorithm that solves this problem, given a pointer to the root of T : MaxWtSubtree [r]

Faster parameterized algorithms for Minimum Fill-In

Binary Trees, Binary Search Trees

CSE 548: Analysis of Algorithms. Lectures 14 & 15 ( Dijkstra s SSSP & Fibonacci Heaps )

Advanced Algorithm Design and Analysis (Lecture 12) SW5 fall 2005 Simonas Šaltenis E1-215b

INDIAN STATISTICAL INSTITUTE

Data Structures in Java

1 Format. 2 Topics Covered. 2.1 Minimal Spanning Trees. 2.2 Union Find. 2.3 Greedy. CS 124 Quiz 2 Review 3/25/18

Programming II (CS300)

CH 8. HEAPS AND PRIORITY QUEUES

Advanced Algorithms. Class Notes for Thursday, September 18, 2014 Bernard Moret

quiz heapsort intuition overview Is an algorithm with a worst-case time complexity in O(n) data structures and algorithms lecture 3

CH. 8 PRIORITY QUEUES AND HEAPS

Properties of a heap (represented by an array A)

CSE 332 Autumn 2016 Final Exam (closed book, closed notes, no calculators)

Constraint Satisfaction Problems

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

Randomized incremental construction. Trapezoidal decomposition: Special sampling idea: Sample all except one item

Graph Algorithms Matching

V Advanced Data Structures

Priority queues. Priority queues. Priority queue operations

Heaps 2. Recall Priority Queue ADT. Heaps 3/19/14

Heaps with merging. We can implement the other priority queue operations in terms of merging!

Data Structures and Algorithms

Leftist Heaps and Skew Heaps. (Leftist Heaps and Skew Heaps) Data Structures and Programming Spring / 41

CMSC 341 Leftist Heaps

Direct Addressing Hash table: Collision resolution how handle collisions Hash Functions:

CSCI2100B Data Structures Trees

Outline. Other Use of Triangle Inequality Algorithms for Nearest Neighbor Search: Lecture 2. Orchard s Algorithm. Chapter VI

Breadth-First Search, 1. Slides for CIS 675 DPV Chapter 4. Breadth-First Search, 3. Breadth-First Search, 2

Notes on Binary Dumbbell Trees

1 Minimum Cut Problem

Question 7.11 Show how heapsort processes the input:

CMSC 754 Computational Geometry 1

Construction of Minimum-Weight Spanners Mikkel Sigurd Martin Zachariasen

Parameterized coloring problems on chordal graphs

Transcription:

On Minimizing Crossings in Storyline Visualizations Irina Kostitsyna Martin No llenburg Valentin Polishchuk Andre Schulz Darren Strash www.xkcd.com, CC BY-NC 2.5 Kostitsyna, No llenburg, V.and Polishchuk, A. Schulz, KIT I. University of the StateM. of Baden-Wuerttemberg National of the Helmholtz Association OnLaboratory Minimizing Crossings in Storyline Visualizations D. Strash: www.kit.edu

Storyline Visualizations Input: A story (e.g., movie, play, etc.): set of n characters and their interactions over time (m meetings) Output: Visualization of character interactions x-axis! time Characters! curves monotone w.r.t time (no time travel) Curves converge during an interaction, and diverge otherwise a b c d time

Storyline Visualizations Input: A story (e.g., movie, play, etc.): set of n characters and their interactions over time (m meetings) Output: Visualization of character interactions x-axis! time Characters! curves monotone w.r.t time (no time travel) Curves converge during an interaction, and diverge otherwise a b c Meetings have start and end times d time

Previous Results Draw pretty pictures! minimize crossings between curves NP-hard in general! reduction from BIPARTITE CROSSING NUMBER! In practice: Layered graph drawing! try permutations of curve ordering [Sugiyama et al. 8] Heuristics to minimize crossings, wiggles, and gaps [Tanahashi et al. 2, Muelder et al. 3] 2

Towards a Theoretical Understanding of Storylines Almost no existing theoretical results! Many interesting questions... Among them: Can we bound the number of crossings? Fixed-parameter tractable (FPT) for realistic inputs? 3

Towards a Theoretical Understanding of Storylines Almost no existing theoretical results! Many interesting questions... Among them: Can we bound the number of crossings? Yes! We show: matching upper and lower bounds for a special case Fixed-parameter tractable (FPT) for realistic inputs? Yes! We show:! FPT on # characters k 3

Pairwise One-Time Meetings We consider a special case: meetings are restricted to two characters these characters meet only once Event graph: characters! vertices, meetings! edges a pairwise one-time meetings a event graph b b c d d c 4

Pairwise One-Time Meetings We consider a special case: meetings are restricted to two characters these characters meet only once Event graph: characters! vertices, meetings! edges a pairwise one-time meetings a event graph b b c d d c We further restrict to the case where the event graph is a tree. 4

Algorithm for O(n log n) Crossings Intuition: Full binary tree can be drawn with O(n log n) crossings Achieve the same bound for arbitrary trees using a heavy path decomposition 5

Algorithm for O(n log n) Crossings Intuition: Full binary tree can be drawn with O(n log n) crossings Achieve the same bound for arbitrary trees using a heavy path decomposition 5

Algorithm for O(n log n) Crossings Intuition: Full binary tree can be drawn with O(n log n) crossings Achieve the same bound for arbitrary trees using a heavy path decomposition 5

Algorithm for O(n log n) Crossings Intuition: Full binary tree can be drawn with O(n log n) crossings Achieve the same bound for arbitrary trees using a heavy path decomposition 5

Algorithm for O(n log n) Crossings Intuition: Full binary tree can be drawn with O(n log n) crossings Achieve the same bound for arbitrary trees using a heavy path decomposition 5

Algorithm for O(n log n) Crossings Intuition: Full binary tree can be drawn with O(n log n) crossings Achieve the same bound for arbitrary trees using a heavy path decomposition Observation: Build bottom-up! draw subtree and connect with root. 5

Heavy-Path Decomposition Heavy edge := child subtree > /2 parent subtree Light edge := otherwise Key property: O(log n) light edges on any root-leaf path 3 8 9 5 6

Heavy-Path Decomposition Heavy edge := child subtree > /2 parent subtree Light edge := otherwise Key property: O(log n) light edges on any root-leaf path 3 8 9 5 Treat heavy paths as single unit 6

Heavy-Path Decomposition Heavy edge := child subtree > /2 parent subtree Light edge := otherwise Key property: O(log n) light edges on any root-leaf path 3 8 9 5 Treat heavy paths as single unit Key idea: Draw light subtrees, then connect roots 6

Drawing Tree Event Graphs Draw each light subtree in an axis-aligned rectangle 7

Drawing Tree Event Graphs Draw each light subtree in an axis-aligned rectangle Order light children vertically by start time of meeting with root 7

Drawing Tree Event Graphs Draw each light subtree in an axis-aligned rectangle Order light children vertically by start time of meeting with root 7

Drawing Tree Event Graphs Draw each light subtree in an axis-aligned rectangle Order light children vertically by start time of meeting with Introduce detours : connect roots on heavy path root 7

Drawing Tree Event Graphs Draw each light subtree in an axis-aligned rectangle Order light children vertically by start time of meeting with Introduce detours : connect roots on heavy path root 7

Drawing Tree Event Graphs Draw each light subtree in an axis-aligned rectangle Order light children vertically by start time of meeting with Introduce detours : connect roots on heavy path root New light subtree embedded in axis-aligned rectangle! 7

Drawing Tree Event Graphs Draw each light subtree in an axis-aligned rectangle Order light children vertically by start time of meeting with Introduce detours : connect roots on heavy path root New light subtree embedded in axis-aligned rectangle! Recurrence: N(T ) apple  light subtrees L N(L) + 5n light subtree crossings! N(T )=O(n log n) depth of recurrence is O(log n) root crossings 7

Lower Bound for All Inputs Use length L of optimal linear ordering of a graph Embed vertices on the line (unique integers) to minimize total edge length 2 3 total edge length = 7! 2 L = 5 8

Lower Bound for All Inputs Use length L of optimal linear ordering of a graph Embed vertices on the line (unique integers) to minimize total edge length 2 3 total edge length = 7! 2 L = 5 0 0 0 Our problem: Optimal cost = L # edges Edge! meeting Crossings for 2 vertices to meet! edge length - 8

Lower Bound for All Inputs Claim: total # of crossings L #edges 2 0 0 0! meet 0 0 L changes: New cost for to meet! 0 Other costs increase by: apple # crossings 2 9

Lower Bound for All Inputs Claim: total # of crossings L #edges 2 0 0 0! meet 0 0 L changes: New cost for to meet! 0 Other costs increase by: apple # crossings 2 u u, v cross v! v u Each edge has cost increase of Increase by apple d(u)+d(v) apple 2 9

Lower Bound for All Inputs Claim: total # of crossings L #edges 2 0 0 0! meet 0 0 L changes: New cost for to meet! 0 Other costs increase by: apple # crossings 2 total u # of crossings 2 v u, v cross v! u total # of crossings total cost Eachincrease edge has cost increase of original total cost L #edges L #edges Increase by apple d(u)+d(v) apple 2 2 9

Lower Bound for Tree Event Graphs Trees: Optimal linear ordering = minimum valuation Minimized for full binary tree 4 8 2 2 6 0 4 3 5 7 9 3 5 L = (n log n) [Chung 78], = 3 (n log n) m # crossings = ( 2 3 )= (nlog n) 0

FPT for All Inputs We transform to shortest path problem vertex! valid vertical ordering of curves at meeting start time edge! transformation between orderings by swaps (weight = min # crossings) characters meet meet 3 2

FPT for All Inputs We transform to shortest path problem vertex! valid vertical ordering of curves at meeting start time edge! transformation between orderings by swaps (weight = min # crossings) characters meet meet adjacent during meeting 3 2 adjacent during meeting

FPT for All Inputs Evaluate all vertical orderings with one search valid vertical orderings s t s s 2... s applem meeting start times 2

FPT for Crossing Minimization Parameter! k characters precompute edge weights between all k! 2 pairs in time O(k! 2 k log k) with merge sort find shortest s! t path in linear time O(k!m) vertices s t Total running time O(k! 2 k log k + k! 2 m) O(k! 2 m) edges 3

Questions? Is the FPT algorithm efficient in practice for small k (e.g., k apple 6)? Is there a polynomial time exact algorithm for tree event graphs? How about other graph classes? (e.g., small arboricity, unicyclic graphs, cactus graphs) Are there sparse event graphs that require (n 2 ) crossings? What about minimizing the number of bends/wiggles? www.xkcd.com, CC BY-NC 2.5 4