The ILP approach to the layered graph drawing. Ago Kuusik

Similar documents
Algorithms for Graph Visualization Layered Layout

February 19, Integer programming. Outline. Problem formulation. Branch-andbound

/ Approximation Algorithms Lecturer: Michael Dinitz Topic: Linear Programming Date: 2/24/15 Scribe: Runze Tang

3 INTEGER LINEAR PROGRAMMING

Algorithms for Integer Programming

5.3 Cutting plane methods and Gomory fractional cuts

A New Heuristic Layout Algorithm for Directed Acyclic Graphs *

Algorithms for Graph Visualization Layered Layout

CS 473: Algorithms. Ruta Mehta. Spring University of Illinois, Urbana-Champaign. Ruta (UIUC) CS473 1 Spring / 36

Algorithms for Decision Support. Integer linear programming models

An SDP Approach to Multi-level Crossing Minimization

A Technique for Drawing Directed Graphs

Polyhedral Compilation Foundations

16.410/413 Principles of Autonomy and Decision Making

Linear and Integer Programming :Algorithms in the Real World. Related Optimization Problems. How important is optimization?

MVE165/MMG630, Applied Optimization Lecture 8 Integer linear programming algorithms. Ann-Brith Strömberg

Integer Programming Theory

Optimal k-level Planarization and Crossing Minimization

4 LINEAR PROGRAMMING (LP) E. Amaldi Fondamenti di R.O. Politecnico di Milano 1

Approximation Algorithms

11. APPROXIMATION ALGORITHMS

Mathematical and Algorithmic Foundations Linear Programming and Matchings

Combinatorial Optimization

11. APPROXIMATION ALGORITHMS

CS599: Convex and Combinatorial Optimization Fall 2013 Lecture 14: Combinatorial Problems as Linear Programs I. Instructor: Shaddin Dughmi

Linear Programming Duality and Algorithms

Integer and Combinatorial Optimization

THEORY OF LINEAR AND INTEGER PROGRAMMING

Introduction to Mathematical Programming IE496. Final Review. Dr. Ted Ralphs

COT 6936: Topics in Algorithms! Giri Narasimhan. ECS 254A / EC 2443; Phone: x3748

CS 372: Computational Geometry Lecture 10 Linear Programming in Fixed Dimension

A New Exact Algorithm for the Two-Sided Crossing Minimization Problem

11. APPROXIMATION ALGORITHMS

MVE165/MMG631 Linear and integer optimization with applications Lecture 9 Discrete optimization: theory and algorithms

Linear Programming in Small Dimensions

Programming, numerics and optimization

CS599: Convex and Combinatorial Optimization Fall 2013 Lecture 1: Introduction to Optimization. Instructor: Shaddin Dughmi

Advanced Algorithms Linear Programming

Linear Programming. Readings: Read text section 11.6, and sections 1 and 2 of Tom Ferguson s notes (see course homepage).

CS 580: Algorithm Design and Analysis. Jeremiah Blocki Purdue University Spring 2018

Linear Programming. Widget Factory Example. Linear Programming: Standard Form. Widget Factory Example: Continued.

A Heuristic for the Constrained One-Sided Two-Layered Crossing Reduction Problem for Dynamic Graph Layout. Dung Mai

GENERAL ASSIGNMENT PROBLEM via Branch and Price JOHN AND LEI

Linear Programming. Course review MS-E2140. v. 1.1

Approximation Algorithms for Geometric Intersection Graphs

Algorithm Design and Analysis

Construction of Minimum-Weight Spanners Mikkel Sigurd Martin Zachariasen

Integer and Combinatorial Optimization: Clustering Problems

Last topic: Summary; Heuristics and Approximation Algorithms Topics we studied so far:

Design and Analysis of Algorithms (V)

NETWORK SURVIVABILITY AND POLYHEDRAL ANALYSIS

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

MA4254: Discrete Optimization. Defeng Sun. Department of Mathematics National University of Singapore Office: S Telephone:

Minimum Weight Constrained Forest Problems. Problem Definition

A GENERALIZATION OF THE

Discrete Optimization 2010 Lecture 5 Min-Cost Flows & Total Unimodularity

1. Lecture notes on bipartite matching February 4th,

CS675: Convex and Combinatorial Optimization Spring 2018 The Simplex Algorithm. Instructor: Shaddin Dughmi

Fundamentals of Integer Programming

CMPSCI611: The Simplex Algorithm Lecture 24

Real life Problem. Review

Graphs and Network Flows IE411. Lecture 21. Dr. Ted Ralphs

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

Approximation slides 1. An optimal polynomial algorithm for the Vertex Cover and matching in Bipartite graphs

Convex Optimization CMU-10725

Combinatorial Optimization and Integer Linear Programming

Introduction to Linear Programming

56:272 Integer Programming & Network Flows Final Examination -- December 14, 1998

Approximation Algorithms

Introduction to Linear Programming. Algorithmic and Geometric Foundations of Optimization

Constraint Satisfaction Problems

The Size Robust Multiple Knapsack Problem

Rubber bands. Chapter Rubber band representation

Copyright 2007 Pearson Addison-Wesley. All rights reserved. A. Levitin Introduction to the Design & Analysis of Algorithms, 2 nd ed., Ch.

Linear Programming. Linear Programming. Linear Programming. Example: Profit Maximization (1/4) Iris Hui-Ru Jiang Fall Linear programming

CS 473: Algorithms. Ruta Mehta. Spring University of Illinois, Urbana-Champaign. Ruta (UIUC) CS473 1 Spring / 50

Investigating Mixed-Integer Hulls using a MIP-Solver

Approximation Algorithms

ACO Comprehensive Exam October 12 and 13, Computability, Complexity and Algorithms

Submodularity Reading Group. Matroid Polytopes, Polymatroid. M. Pawan Kumar

COT 6936: Topics in Algorithms! Giri Narasimhan. ECS 254A / EC 2443; Phone: x3748

Towards Efficient Higher-Order Semidefinite Relaxations for Max-Cut

Some Advanced Topics in Linear Programming

LOCAL SEARCH FOR THE MINIMUM FUNDAMENTAL CYCLE BASIS PROBLEM

Mathematical Tools for Engineering and Management

arxiv: v1 [cs.cc] 30 Jun 2017

Graph/Network Visualization

APPROXIMATION ALGORITHMS FOR GEOMETRIC PROBLEMS

Modelling of LP-problems (2WO09)

A List Heuristic for Vertex Cover

3 No-Wait Job Shops with Variable Processing Times

COVERING POINTS WITH AXIS PARALLEL LINES. KAWSAR JAHAN Bachelor of Science, Bangladesh University of Professionals, 2009

Integer Programming Explained Through Gomory s Cutting Plane Algorithm and Column Generation

CMPSCI 311: Introduction to Algorithms Practice Final Exam

CSE 417 Branch & Bound (pt 4) Branch & Bound

Geometric Modeling. Mesh Decimation. Mesh Decimation. Applications. Copyright 2010 Gotsman, Pauly Page 1. Oversampled 3D scan data

Artificial Intelligence

NOTES ON COMBINATORIAL OPTIMIZATION

Distance-based Phylogenetic Methods Near a Polytomy

15-451/651: Design & Analysis of Algorithms October 11, 2018 Lecture #13: Linear Programming I last changed: October 9, 2018

Transcription:

The ILP approach to the layered graph drawing Ago Kuusik Veskisilla Teooriapäevad 1-3.10.2004 1

Outline Introduction Hierarchical drawing & Sugiyama algorithm Linear Programming (LP) and Integer Linear Programming (ILP) Multi-level crossing minimisation ILP Maximum level planar subgraph ILP 2

Graphs Set of vertices V (real world: entities) Set of edges E ::= pairs of vertices (real world: relations) Directed graph: E ::= set of ordered pairs of vertices 3

Graph drawing Started to grow in 1960s, aim software understanding Now, used in number of areas, for example Software engineering (call graphs, class diagrams, database schemas) Social studies (relationship diagrams) Chemistry (molecular structures) 4

Graph drawing Definition: Given a graph G=(V, E), represent the graph on a plane: Vertices closed shapes Edges Jordan curves between vertex shapes (Jordan curve = a closed curve that does not intersect itself) 5

Aesthetic criteria General Min. number of edge crossings Uniform edge direction (directed graph) Min. number of edge bends Min. area Application-specific Specific vertex shapes (E-R diagram) Specific vertex locations (class hierarchy) 6

Hierachical drawing Given: a directed acyclic graph (A cyclic graph can be converted acyclic by reversing some edges; minimum feedback arc set is NP hard) Objective: Uniform edge direction Min. Number of edge crossings 7

Sugiyama algorithm Published by Sugiyama, Tagawa, Toda 1981 Vertices are placed on discrete layers Edges have uniform direction Edges connect vertices of adjacent layers Reduced edge crossings Overall balance of vertex locations 8

0. random layout 1. layering 2. sorting on layers 3. final positioning 9

1. Layering Assign vertices to discrete layers so that the edges point to common direction Longest path layering, shortest path layering: simple DFS algorithms Coffman-Graham layering constrains the width of the drawing ILP approaches (Nikolov, 2002) 10

Proper and non-proper layering Proper Non-Proper Dummy vertex 11

2. Sorting of vertices on layers A combinatorial problem of re-ordering a set instead of a geometric placement problem Objective: min. edge crossings NP-hard even for 2 layers (Eades et al, 1986) Heuristics: barycenter, median, stochastic ILP approach 12

3. Positioning of vertices Objective: balanced positioning, reduction of edge bends Algorithms: Linear Programming method (Sugiyama et al., 1981) Pendulum heuristic (Sander, 1995) 13

Our improvement to Sugiyama algorithm We aim to improve the 2 nd step: reordering of vertices: Find the optimal solution or a solution with guaranteed quality Optimise accross all layers Consider visualising the maximum level planar subgraph as an alternative to crossing minimisation 14

Min. crossings vs max. planar subgraph Max. planar subgraph Min. crossings 15

ILP - motivation Possible to get the optimum result faster than by complete enumeration Known precision of the solution, if a terminated run Applications where quality is important (like publishing) Generation of comparative results for proving heuristics Study of the problem from a different angle 16

ILP vs other approaches time ILP Complete enumeration heuristics quality 17

Linear program - Example A chemical factory has a line with 3 machines: A B C x 1 : 16t/day x 2 : 4t/day x 1 : 4t/day x 2 : 6t/day x 1 : 6t/day x 2 : 6t/day Max. daily capacity (exclusively) x 1 x 2 Unit price 100 EEK/t 200 EEK/t Find the daily amounts (x 1 and x 2 ) of products so that the total price is maximal. 18

Linear program - formulation x 2 max(100 x + 200 x ) subject to: 1 2 1 2 1 1 (A) x1 + x2 1 16 4 1 1 (B) x1 + x2 1 4 16 1 1 (C) x1 + x2 1 6 6 x, x 0 4 3 2 1 1 x 1 1 + x2 1 16 4 1 x 1 1 + x2 1 6 6 x = 3.33; x = 2.67 1 2 1 2 3 4 100x + 200x 1 1 x1 + x2 1 4 16 1 2 x 1 19

LP solution methods Simplex method (Dantzig 1947) basically a greedy search along the vertices of the polytope determined by constraints polynomially unbounded works well in practice Ellipsoid (Khachyan 1979) and interior point (Karmarkar 1984) methods polynomially bounded 20

Integer Linear program - Example A car factory has a line with 3 machines: A B C x 1 : 16p/day x 2 : 4p/day x 1 : 4p/day x 2 : 6p/day x 1 : 6p/day x 2 : 6p/day Max. daily capacity (exclusively) x 1 x 2 Piece price 100 keek 200 keek How many (x 1 and x 2 ) of the different car models must be manufactured so that the total price will be maximal. 21

Integer linear program - formulation max(100x + 200 x ) subject to: 1 2 1 2 1 2 (A) (B) 1 1 x1 + x2 16 4 1 1 x1 + x2 4 16 1 1 (C) 1 1 x + x 1 2 6 6 1 x, x 0 x, x integral x 2 4 3 2 1 1 x 1 1 + x2 1 16 4 1 2 1 x 1 1 + x2 1 6 6 3 4 100x + 200x 1 2 1 1 x1 + x2 1 4 16 x 1 22

ILP algorithms When the solution of a LP-relaxation is Integral we have found the optimal solution Fractional need to define a more constrained problem 23

Branch-and-bound algorithm Solve the initial LP, let LB = cx Select a fractional variable x i =t i and create two subproblems: { cx Ax b xi ti } { cx Ax b xi ti } min, min, For each subproblem, SOLVE, if cx > LB don t explore this branch cx < LB Non-integral x: REPEAT with some x j Integral x: LB = cx, if no more unexplored subproblems optimal solution x is infeasible don t explore this branch 24

Branch-and-bound 25

The lower and upper bounds Consider a minimisation problem: cx The upper bound = min(cx) over the integral solutions so far The lower bound = max(cx) over the not yet branched non-integral solutions time 26

Cutting plane algorithm Do 1. Solve the LP-relaxation 2. If x is not integral 1. Add a constraint to LP-relaxation that separates x from the polytope While x not integral 27

Cutting plane 28

Branch and Cut Based on branch-and bound algorithm Each time a subproblem results in a non-integer solution x, try to find a cutting plane separating x from the polytope Use only binding constraints for a subproblem 29

Polyhedral combinatorics Binary vector: The set of all valid binary vectors: Weights vector: x S c General combinatorial optimisation problem: min { cx subject to x S} Replace it with a linear optimisation problem: min { cx subject to Ax b} n { R } S = P Z n, P = x : Ax b 30

Polyhedral combinatorics How to define Ax b? This an art! The best inequalities are those that define a facet of the polytope. A facet-defining inequality holds as an equality for x linearly independent solutions. 31

How to derive an ILP formulation? Derive from the ILP formulation of some similar problem, e.g.: Multi-level crossing minimisation linear ordering Maximum level planar subgraph maximum planar subgraph Analyse smaller problem instances by software. http://www.informatik.uni-heidelberg.de/groups/comopt/software/porta/ (PORTA derives from all enumerated solutions the facets of the polytope supported by these solutions) 32

Multi-Level Crossing Minimisation ILP Minimise p 1 r = 1 ( i, j )( k, l ) Er c r ijkl Subject to c x x c ( i, j),( k, l) E, j < l r r + 1 r r ijkl jl ik ijkl r r r + 1 r r 1 ijkl lj ik 1 ijkl (, ),(, ) r, c x + x + c i j k l E j < l r r r 0 x + x x 1 i < j < k x r ij ij jk ik { } r, c 0,1 ijkl i j k l r r+1 i j k l r r+1 i j k r x ij r x ik r x jk r 33

The vertex-exchange graph Consider the crossing constraints: They establish relationships between linear ordering variables. Objects & relationships Graph c x x c r r + 1 r r ijkl jl ik ijkl r r + 1 r r 1 cijkl xlj + xik 1+ cijkl r If c = 0: x x r + 1 jl r + 1 lj ijkl = x r ik = 1 x r ik a b de - ab + ce c d e + gh - + cd + + fh f g h + fg 34

Level planarity testing a b 1 de - 0 ab + 0 ce c f e h d g + gh 1 - + cd + fg 0 0 + + fh 0 a b c d e f g + de ce + ab + - + fg cd 35

Benefits of V-E graph O( V 2 ) level planarity testing algorithm ( E < 2 V - 4) O( V 3 ) layout algorithm for level planar graph V-E graph odd/labelled cycle inequalities to crossing minimisation ILP: c r ijkl C c r ijkl 1, C - an odd-labelled fundamental cycle in V-E graph 36

Example (random layout) 96 vertices, 110 edges 37

Example (Sugiyama layout) 98 crossings 38

Example (ILP layout) 31 crossings 88s on 300MHz DEC AlphaStation 39

Example (Gansner et al., 93) 41 crossings 40

Example (ILP) 38 crossings, 143s 41

Independence system A set E; I is a set of subsets of E, F 1 F 2 E and F 2 I F 1 I (E,I) is an independence system If C E, C I and for every F C, F I C is a circuit Determine the maximum weighted member of I: T max c x subject to: a x + a x +... + a x = C 1, i = 1, 2..., a i1 1 i2 2 i E E i ij 0, e = 1, e j j C C i i 42

Maximum level planar subgraph ILP Independent sets level planar subgraphs Circuits minimal level non-planar subgraphs Given a level graph G=(V,E): Maximise Subject to: x e 1, E p E, e E, xe = 0, S is a MLNP subgraph e S x e S 1 e E e E p p 43

MLNP subgraphs - trees 44

MLNP subgraphs LNP cycles 45

MLNP subgraphs LP cycles + paths 46

Separation algorithm 47

Using odd-labelled cycles of V-E graph Use the edges of the original graph that induced an odd-labelled cycles in the vertex-exchange graph 48

Primal heuristic - is executed each time a subproblem is solved. - The result vector x is employed as weight function for a greedy heuristic 2 stages: 4. Removal 5. Adding attempts 49

MLP subgraph example - original 50

MLP subgraph example B&C 6 of 65 edges non-planar 96 inequalities 24s 51

Conclusions Results MLNP subgraphs Vertex exchange graph Improved crossings minimisation ILP Max. planar subgraph ILP Open problems Specific algorithms for detecting MLNP subgraphs? Can we estimate the crossing number by V-E graph? Efficiency of ILP-s: employ O(n) level planarity testing b&c crossing min ILP 52

Thank you for attention! 53