Label Placement and graph drawing Imo Lieberwerth.

Slides:



Advertisements
Similar presentations
The Primal-Dual Method: Steiner Forest TexPoint fonts used in EMF. Read the TexPoint manual before you delete this box.: AA A A AA A A A AA A A.
Advertisements

Chapter 4 Partition I. Covering and Dominating.
Lecture 7. Network Flows We consider a network with directed edges. Every edge has a capacity. If there is an edge from i to j, there is an edge from.
Introduction to Algorithms NP-Complete
Chapter 8 Topics in Graph Theory
O(N 1.5 ) divide-and-conquer technique for Minimum Spanning Tree problem Step 1: Divide the graph into  N sub-graph by clustering. Step 2: Solve each.
An Introduction to Channel Routing
22C:19 Discrete Math Graphs Fall 2014 Sukumar Ghosh.
Midwestern State University Department of Computer Science Dr. Ranette Halverson CMPS 2433 – CHAPTER 4 GRAPHS 1.
Approximations of points and polygonal chains
1 Discrete Structures & Algorithms Graphs and Trees: III EECE 320.
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.
Tutorial 6 of CSCI2110 Bipartite Matching Tutor: Zhou Hong ( 周宏 )
Optimization of Pearl’s Method of Conditioning and Greedy-Like Approximation Algorithm for the Vertex Feedback Set Problem Authors: Ann Becker and Dan.
Lectures on Network Flows
C++ Programming: Program Design Including Data Structures, Third Edition Chapter 21: Graphs.
Last time: terminology reminder w Simple graph Vertex = node Edge Degree Weight Neighbours Complete Dual Bipartite Planar Cycle Tree Path Circuit Components.
1 Discrete Structures & Algorithms Graphs and Trees: II EECE 320.
Graph Drawing Zsuzsanna Hollander. Reviewed Papers Effective Graph Visualization via Node Grouping Janet M. Six and Ioannis G. Tollis. Proc InfoVis 2001.
Automated Layout and Phase Assignment for Dark Field PSM Andrew B. Kahng, Huijuan Wang, Alex Zelikovsky UCLA Computer Science Department
Approximation Algorithms
Computational Complexity, Physical Mapping III + Perl CIS 667 March 4, 2004.
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.
Job Scheduling Lecture 19: March 19. Job Scheduling: Unrelated Multiple Machines There are n jobs, each job has: a processing time p(i,j) (the time to.
9-1 Chapter 9 Approximation Algorithms. 9-2 Approximation algorithm Up to now, the best algorithm for solving an NP-complete problem requires exponential.
Rectangular Drawing Imo Lieberwerth. Content Introduction Rectangular Drawing and Matching Thomassen’s Theorem Rectangular drawing algorithm Advanced.
Lecture 11. Matching A set of edges which do not share a vertex is a matching. Application: Wireless Networks may consist of nodes with single radios,
On Channel-Discontinuity-Constraint Routing in Multi-Channel Wireless Infrastructure Networks Abishek Gopalan, Swaminathan Sankararaman 1.
Minimum Spanning Trees. Subgraph A graph G is a subgraph of graph H if –The vertices of G are a subset of the vertices of H, and –The edges of G are a.
Domain decomposition in parallel computing Ashok Srinivasan Florida State University COT 5410 – Spring 2004.
Escaping local optimas Accept nonimproving neighbors – Tabu search and simulated annealing Iterating with different initial solutions – Multistart local.
GRAPH Learning Outcomes Students should be able to:
May 5, 2015Applied Discrete Mathematics Week 13: Boolean Algebra 1 Dijkstra’s Algorithm procedure Dijkstra(G: weighted connected simple graph with vertices.
1 Introduction to Approximation Algorithms. 2 NP-completeness Do your best then.
Homework 2. Problem 1 Families 1…..N go out for dinner together. To increase their social interaction, no two members of the same family use the same.
A Fast Algorithm for Enumerating Bipartite Perfect Matchings Takeaki Uno (National Institute of Informatics, JAPAN)
Crossing Minimisation (1) Ronald Kieft. Global contents Specific 2-layer Crossing Minimisation techniques After the break, by Johan Crossing Minimisation.
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.:
1 Introduction to Approximation Algorithms. 2 NP-completeness Do your best then.
May 1, 2002Applied Discrete Mathematics Week 13: Graphs and Trees 1News CSEMS Scholarships for CS and Math students (US citizens only) $3,125 per year.
Register Placement for High- Performance Circuits M. Chiang, T. Okamoto and T. Yoshimura Waseda University, Japan DATE 2009.
All Pair Shortest Path IOI/ACM ICPC Training June 2004.
Graph Colouring L09: Oct 10. This Lecture Graph coloring is another important problem in graph theory. It also has many applications, including the famous.
CSE 589 Part VI. Reading Skiena, Sections 5.5 and 6.8 CLR, chapter 37.
1 12/2/2015 MATH 224 – Discrete Mathematics Formally a graph is just a collection of unordered or ordered pairs, where for example, if {a,b} G if a, b.
Graphs A ‘Graph’ is a diagram that shows how things are connected together. It makes no attempt to draw actual paths or routes and scale is generally inconsequential.
Graph Theory and Applications
Network Flows Chun-Ta, Yu Graduate Institute Information Management Dept. National Taiwan University.
Graph Algorithms Maximum Flow - Best algorithms [Adapted from R.Solis-Oba]
NP-completeness NP-complete problems. Homework Vertex Cover Instance. A graph G and an integer k. Question. Is there a vertex cover of cardinality k?
Example Apply hierarchical clustering with d min to below data where c=3. Nearest neighbor clustering d min d max will form elongated clusters!
Chapter 20: Graphs. Objectives In this chapter, you will: – Learn about graphs – Become familiar with the basic terminology of graph theory – Discover.
1 Assignment #3 is posted: Due Thursday Nov. 15 at the beginning of class. Make sure you are also working on your projects. Come see me if you are unsure.
Iterative Improvement for Domain-Specific Problems Lecturer: Jing Liu Homepage:
Proof of correctness of Dijkstra’s algorithm: Basically, we need to prove two claims. (1)Let S be the set of vertices for which the shortest path from.
::Network Optimization:: Minimum Spanning Trees and Clustering Taufik Djatna, Dr.Eng. 1.
Theory of Computational Complexity Yusuke FURUKAWA Iwama Ito lab M1.
Algorithms and Networks
The minimum cost flow problem
Algorithms and Networks
Lectures on Network Flows
Power and Polynomial Functions
Chapter 5. Optimal Matchings
Exact Inference Continued
Haim Kaplan and Uri Zwick
CIS 488/588 Bruce R. Maxim UM-Dearborn
Problem Solving 4.
Exact Inference Continued
Automated Layout and Phase Assignment for Dark Field PSM
離散數學 DISCRETE and COMBINATORIAL MATHEMATICS
Presentation transcript:

Label Placement and graph drawing Imo Lieberwerth

Overview Introduction The Edge Label Placement problem The Multiple Label Placement problem

Introduction Automated label placement originates from the Cartography Many years of research Three types: Point labeling Line labeling Area labeling

Point labeling Label features like cities nodes of a graph

Line labeling Label features like Rivers streets

Rules for line labeling The label must follow the shape of the line (but not to strict) At long lines the label must be repeated No extra white spaces between characters Vertical lines: Left of the map: First letter towards the bottom Right of the map: First letter towards the top

Rules according Imhof(1962)

Area labeling Label features like Countries Oceans

Rules for area labeling Stretch label over whole the area Areal labels preferably have the same shape Use horizontal or curved labels Evenly curved labels Repeat labels at suitable intervals

Labeling quality Problem of assigning text labels to graphical features such that association of labels is clear The label assignment must be unambiguous Lot of work is done by Imhof and Yoeli

Problematic cases Problem visibility highway 20 Problem association Thunder Bay and point Problem readability name

Basic rules for labeling quality Labels should be easily read and easily and quickly located No overlap of a label with other labels or other graphical features are allowed Each label can be easily identified with exactly one graphical feature of the layout (the assignment is unambiguous) Each label must be placed in the best possible position

COST-function A optimal assignment can produces labels that do not strictly follow the rules COST(i, j) is penalty for label j to edge i Penalty with respect to the ranking of label j Penalty for violating the basic rules

Labeling space Discrete labeling spaceContinuous labeling space

The ELP problem ELP: Is the problem of placing text labels assigned to particular edges of a graph ELP problem has received little attention Complexity is solved in 1996 and is NP-Hard by Kakoulis and Tollis Most algorithms do not produce desired results Trapped in local optima Take exponential time The ELP-algorithm

The optimal ELP problem Question: Find a labeling assignment that minimizes the following function:

The ELP algorithm Assumptions: All labels have the same size Each edge has only one label associated with it Any acceptable solution must guarantee: Any label must be free of overlap (except his associated edge) Any label must be very close (touch) to its associated edge

Main idea of the algorithm Divide the input drawing into horizontal strips of equal height Finite number of label positions Find the set of label positions for each edge Each position must be inside a strip Each position has to touch a edge but not intersect this edge (or other graphical feature) Each label position overlaps at most with one other label position

Example

31 2 4

31 2 4

31 2 4

Matching problem Transform ELP problem where each edge is matched to one of his label positions Group label positions together: If two positions overlap they belong to the same group Else to a single member group Only one member of group in assignment Guaranties labels do not overlap each other

Matching graph Define matching graph G m (V e,V g,E m ) Each node e inV e corresponds to an edge Each node r in V g corresponds to a group of label positions Each edge(e, r) in E m connects a node e inV e to a node r in V g if and only if e has a label positioning that belongs to group r G m is a bipartite graph For each edge in G m add the cost for assigning label

Example ,23,4 g1g1 g3g3 g4g4 g5g5 g2g2 g1g1 g2g2 g3g3 g4g4 g5g5 g6g6 g6g6

ELP_Algorithm INPUT: A drawing D of the graph G(V, E) OUTPUT: A label assignment 1. Split D into horizontal strips 2. Find all label positions for each edge and construct the groups R 3. Create the matching graph G m for D 4. Match edges to label positions, by finding a matching in G m

Finding a matching Theorem. Let A be the set of label positions for all edges of a drawing D of graph G(V, E). If every label position in A overlaps at most one other label position in A, then a maximum cardinality minimum weight matching of the corresponding matching graph G m produces an optimal solution to the ELP problem with no overlaps. You can use any known algorithm to find a maximum cardinality minimum weight matching

Fast Matching Heuristic INPUT: Matching graph G m OUTPUT: A maximum cardinality matching for G m with low weight 1. IF the minimum weight incident edge a node in V E connects this node to a node in V G of degree 1 THEN Assign this edge as a matched edge update G m 2. IF a node in V E in has degree one THEN Assign its incident edge as a matched edge update G m 3. Repeat steps 1 and 2 until no new edge can be matched 4. Delete all nodes of degree 0 from G m FOR each node e in V E DO: Remove all but the two incidents edges of e with the least weight 5. The remaining graph consists of simple cycles and/or paths. Find the only two maximum cardinality matchings for each component. Choose the matching of minimum weight.

Step 1 INPUT: Matching graph G m OUTPUT: A maximum cardinality matching for G m with low weight 1. IF the minimum weight incident edge a node in V E connects this node to a node in V G of degree 1 THEN Assign this edge as a matched edge update G m 2. IF a node in V E in has degree one THEN Assign its incident edge as a matched edge update G m 3. Repeat steps 1 and 2 until no new edge can be matched 4. Delete all nodes of degree 0 from G m FOR each node e in V E DO: Remove all but the two incidents edges of e with the least weight 5. The remaining graph consists of simple cycles and/or paths. Find the only two maximum cardinality matchings for each component. Choose the matching of minimum weight.

Example step 1 VgVg VeVe VeVe VgVg

Step 2 INPUT: Matching graph G m OUTPUT: A maximum cardinality matching for G m with low weight 1. IF the minimum weight incident edge a node in V E connects this node to a node in V G of degree 1 THEN Assign this edge as a matched edge update G m 2. IF a node in V E in has degree one THEN Assign its incident edge as a matched edge update G m 3. Repeat steps 1 and 2 until no new edge can be matched 4. Delete all nodes of degree 0 from G m FOR each node e in V E DO: Remove all but the two incidents edges of e with the least weight 5. The remaining graph consists of simple cycles and/or paths. Find the only two maximum cardinality matchings for each component. Choose the matching of minimum weight.

Example step 2 VgVg VgVg VeVe VeVe

Fast Matching Heuristic INPUT: Matching graph G m OUTPUT: A maximum cardinality matching for G m with low weight 1. IF the minimum weight incident edge a node in V E connects this node to a node in V G of degree 1 THEN Assign this edge as a matched edge update G m 2. IF a node in V E in has degree one THEN Assign its incident edge as a matched edge update G m 3. Repeat steps 1 and 2 until no new edge can be matched 4. Delete all nodes of degree 0 from G m FOR each node e in V E DO: Remove all but the two incidents edges of e with the least weight 5. The remaining graph consists of simple cycles and/or paths. Find the only two maximum cardinality matchings for each component. Choose the matching of minimum weight.

Fast Matching Heuristic INPUT: Matching graph G m OUTPUT: A maximum cardinality matching for G m with low weight 1. IF the minimum weight incident edge a node in V E connects this node to a node in V G of degree 1 THEN Assign this edge as a matched edge update G m 2. IF a node in V E in has degree one THEN Assign its incident edge as a matched edge update G m 3. Repeat steps 1 and 2 until no new edge can be matched 4. Delete all nodes of degree 0 from G m FOR each node e in V E DO: Remove all but the two incidents edges of e with the least weight 5. The remaining graph consists of simple cycles and/or paths. Find the only two maximum cardinality matchings for each component. Choose the matching of minimum weight.

Example step 4 VgVg VgVg VeVe VeVe

Fast Matching Heuristic INPUT: Matching graph G m OUTPUT: A maximum cardinality matching for G m with low weight 1. IF the minimum weight incident edge a node in V E connects this node to a node in V G of degree 1 THEN Assign this edge as a matched edge update G m 2. IF a node in V E in has degree one THEN Assign its incident edge as a matched edge update G m 3. Repeat steps 1 and 2 until no new edge can be matched 4. Delete all nodes of degree 0 from G m FOR each node e in V E DO: Remove all but the two incidents edges of e with the least weight 5. The remaining graph consists of simple cycles and/or paths. Find the only two maximum cardinality matchings for each component. Choose the matching of minimum weight.

Example step 5 Traverse cycle (or path) and pick only the even or odd edges as part of the matching VgVg VeVe VgVg VeVe

Remark Algorithm don’t label horizontal edges Solution: rotate the drawing

Extension and results Post processing step: Relaxing the restrictions by allowing labels to overlap their associated edges The algorithm works very well for hierarchical and other straight-line drawing Not suitable for orthogonal drawings

Result algorithm

The MLP problem Konstantinos G. Kakoulis and Ioannis G. Tollis. On the multiple label placement problem. In Proc. 10th Canadian Conf. Computational Geometry (CCCG’98), pages 66–67, Each graphical feature is associated with more then one label Constraints: example with single edge and source and target node Proximity: Label L s must be in close proximity with source node. Define maximum distance Partial Order: The source node label must closer to the source node then the other label. Define a partial order Priority: First important labels and then the other labels if there is a space

Algorithm 1 Algorithm for solving the MLP problem Iterative approach Main loop i-th iteration of the loop, assigns the i-th label for graphical feature This algorithm can take into account all three constraints This algorithm can use the ELP-algorithm

Example An orthogonal drawingA hierarchical drawing

Algorithm 2 Non-iterative fashion and extension of ELP-algorithm Sketch algorithm: Find set of label positions for each graphical feature Label positions that overlap each other are grouped in clusters Each cluster is matched to at most one graphical feature using flow techniques

Graphs First create bipartite graph matching graph G m (V f, V c, E m ) Each graphical feature is represented by a node in V f Each cluster is represented by a node in V c Each edge in E m connect Then transform G m to a flow graph G flow (s, t,V f, V c, E m )

Flow graph The flow graph of algorithm 2

Flow graph Assign capacities: Each edge of original matching graph has capacity one Each edge (c, t) has capacity one Each edge (s, v) has capacity equal to the number of labels associated with v Include the cost of the label positioning for each edge Solve the maximum flow minimum cost problem for the flow graph G flow

Flow graph The flow graph of algorithm 2

Example Circular drawing with 3 labels per edge and node

Experimental Results Both algorithms perform well and the same with respect to the success rate The flow method produces a slightly better quality of label assignments If labels have variable size the algorithm 1 would be the best choice

Questions?