2 3 P ROBLEM Diagrams in practice often have an unfortunate aspect - - PowerPoint PPT Presentation

2 3
SMART_READER_LITE
LIVE PREVIEW

2 3 P ROBLEM Diagrams in practice often have an unfortunate aspect - - PowerPoint PPT Presentation

A G ENERAL RALIZA ZATION ON OF OF THE THE D IRE TED G RA PH L AYERI NG P ROBLEM RECTED RAPH YERING OBLEM Ulf Regg, Thorsten Ehlers, Miro Spnemann, and Reinhard von Hanxleden Department of Computer Science Kiel University T HE M


slide-1
SLIDE 1

A GENERAL

RALIZA ZATION ON

OF OF THE THE

DIRE

RECTED TED GRA RAPH PH LAYERI YERING NG PROBLEM OBLEM

Ulf Rüegg, Thorsten Ehlers, Miro Spönemann, and Reinhard von Hanxleden

Department of Computer Science Kiel University

slide-2
SLIDE 2

THE MOTIVATION

1

slide-3
SLIDE 3

2

slide-4
SLIDE 4

3

slide-5
SLIDE 5

PROBLEM

4

  • C. Gutwenger, R. von Hanxleden, P. Mutzel, U. Rüegg, and M. Spönemann

Examining the compactness of automatic layout algorithms for practical diagrams, GraphViP 2014

resulting in

poor utilization of the drawing area small diagram elements a lot of whitespace

Diagrams in practice often have

an unfortunate aspect ratio

slide-6
SLIDE 6

SUGIYAMA LAYOUT

P1 Cycle Removal P2 Layer Assignment P3 Crossing Minimization P4 Node Placement P5 Edge Routing

Topological Phases Geometrical Phases

  • K. Sugiyama, S. Tagawa, M. Toda

Methods for visual understanding of hierarchical system structures, IEEE Trans. on Syst., Man and Cybernetics, 1981.

5

  • C. D. Schulze, M. Spönemann, R. v. Hanxleden

Drawing layered graphs with port constraints

Journal of Visual Languages and Computing, 2013

slide-7
SLIDE 7

ALTERING THE ASPECT RATIO

6

Which phase has influence?

P3 Crossing Minimization

(almost) nothing to do with it

P4 Node Placement P5 Edge Routing

certainly have an impact, still, the topology is already fixed

edges may occupy space between layers straight edges may increase width

P1 Cycle Removal P2 Layer Assignment

This leaves us with ...

slide-8
SLIDE 8

LAYERING

7

Height Width

estimated vs effective

slide-9
SLIDE 9

EXISTING WORK

8

  • P. Healy and N. Nikolov,

A branch-and-cut approach to the directed acyclic graph layering problem, Graph Drawing, 2002.

  • P. Healy and N. Nikolov,

How to layer a directed acyclic graph, Graph Drawing, 2001.

  • N. Nikolov, A. Tarassov, and J. Branke,

In search for efficient heuristics for minimum-width graph layering with consideration of dummy nodes, Journal of Experimental Algorithmics, 2005.

  • L. Nachmanson, G. Robertson, and B. Lee,

Drawing graphs with GLEE, Graph Drawing, 2008.

"MINIMUM WIDTH" LAYERING ASPECT RATIO

  • E. R. Gansner, E. Koutsofios, S. C. North, and K.-P. Vo,

A technique for drawing directed graphs, IEEE Transactions on Software Engineering, 1993.

  • P. Eades and K. Sugiyama,

How to draw a directed graph, Journal of Information Processing, 1990.

  • E. G. Coffman and R. L. Graham,

Optimal scheduling for two-processor systems, Acta Informatica, 1972.

slide-10
SLIDE 10

NOT ADDRESSED SO FAR

9

1

Height bound by the longest path

2

Width bound by highest node degree Input graph must be acyclic

slide-11
SLIDE 11

DIG-COLA

10

  • T. Dwyer and Y. Koren,

DIG-COLA: Directed Graph Layout through Constrained Energy Minimization, INFOVIS, 2005.

"We have found that allowing small deviation sometimes gives us the necessary freedom for overcoming local inefficiencies in the layout, without affecting visualization of the overall directionality."

all edges point downwards some edges point upwards less crossings

slide-12
SLIDE 12

SOMETHING NEW

11

slide-13
SLIDE 13

WARNING

12

From now on, drawing are left to right instead of top down.

(I will most definitely use them wrongly at some point ...)

Hence ...

Height is Width Width is Height

and

slide-14
SLIDE 14

OBSERVATION

0 reversed edges, 71 edge length 2 reversed edges, 35 edge length 6 reversed edges, 16 edge length

13

slide-15
SLIDE 15

DIRECTED LAYERING (DLP)

Given a directed acyclic graph 𝐻 = 𝑊, 𝐹 , find a valid layering 𝑀: 𝑊 → ℕ. MINIMIZE SUBJECT TO

𝑀 𝑥 − 𝑀 𝑤 ≥ 1 ∀ 𝑤, 𝑥 ∈ 𝐹 ෍

𝑤,𝑥 ∈𝐹

𝑀 𝑥 − 𝑀(𝑤)

14

  • E. R. Gansner, E. Koutsofios, S. C. North, and K.-P. Vo,

A technique for drawing directed graphs,

IEEE Transactions on Software Engineering, 1993.

slide-16
SLIDE 16

𝑀 𝑥 − 𝑀 𝑤 ≥ 1

Given a directed acyclic graph 𝐻 = 𝑊, 𝐹 , find a feasible layering 𝑀: 𝑊 → ℕ. MINIMIZE SUBJECT TO

∀ 𝑤, 𝑥 ∈ 𝐹 𝑥𝑚𝑓𝑜 ෍

𝑤,𝑥 ∈𝐹

𝑀 𝑥 − 𝑀(𝑤) + 𝑥𝑠𝑓𝑤 𝑤, 𝑥 ∈ 𝐹: 𝑀 𝑤 > 𝑀(𝑥)

GENERALIZED LAYERING (GLP)

𝑀 𝑥 − 𝑀 𝑤 ≥ 1

15

slide-17
SLIDE 17

IP MODEL

16

MINIMIZE 𝜕𝑚𝑓𝑜 ෍

𝑣,𝑤 ∈𝐹

𝑚 𝑣 − 𝑚(𝑤) + 𝜕𝑠𝑓𝑤 ෍

𝑣,𝑤 ∈𝐹

𝑠(𝑣, 𝑤) SUBJECT TO 1 ≤ 𝑚 𝑤 ≤ 𝑜 𝑚 𝑣 − 𝑚(𝑤) ≥ 1 𝑜 ⋅ 𝑠 𝑣, 𝑤 + 𝑚 𝑤 ≥ 𝑚 𝑣 + 1 ∀ 𝑤 ∈ 𝑊 ∀ (𝑣, 𝑤) ∈ 𝐹 ∀ 𝑣, 𝑤 ∈ 𝐹 BOOLEAN VARIABLES 𝑠(𝑣, 𝑤) 1 iff 𝑓 𝑣, 𝑤 ∈ 𝐹 reversed, 0 otherwise ∀ (𝑣, 𝑤) ∈ 𝐹 INTEGER VARIABLES 𝑚 𝑤 ∀ 𝑤 ∈ 𝑊 takes values in 1, … , 𝑜 ( 𝑊 = 𝑜) indicating node 𝑤 is placed in layer 𝑚(𝑤) INPUT Graph 𝐻 = 𝑊, 𝐹 𝜕𝑠𝑓𝑤, 𝜕𝑚𝑓𝑜 weighting constants

slide-18
SLIDE 18

HEURISTIC

17

Remove leaf nodes iteratively

1

Construct initial feasible layering, deduce edge directions

2

Run DLP

3

Greedily improve result

4

Reattach leaf nodes

5

slide-19
SLIDE 19

LAYERING CONSTRUCTION

18

  • A. J. McAllister,

A new heuristic algorithm for the linear arrangement problem, Technical Report, University of New Brunswick, 1999.

  • J. Pantrigo, R. Mart, A. Duarte, and E. Pardo,

Scatter search for the cutwidth minimization problem, Annals of Operations Research, 2012. v

u, ai, ao Place nodes on a line (assign indexes), try to keep edges short and the number of left edges small

IDEA

select candidate with smallest |u| (start with random node) if |ai|< |ao| assign index to the left of currently placed nodes else assign to the right

LOOP

unassigned neighbors assigned, incoming assigned, outgoing u ai ao

STEP 2

slide-20
SLIDE 20

LAYERING IMPROVEMENT

19

profit n4, 2, 2 = 2 + 1 = 3

PROFIT

Identify badly placed nodes and move them to a different layer

MOVE IDEA

move n4 = 2 move 𝑤 = ൞ 0, if WS = ∅ 𝑚 𝑤 − min 𝑚 WS + 1, if WP = ∅ 𝑚 𝑤 − max 𝑚 WP − 1, else profit 𝑤, 𝑛, 𝑦 = ቊ0, if 𝑛 ≤ 1 𝑛 ⋅ ( Wx| − 𝐅 ) + WS|x , else

STEP 4

slide-21
SLIDE 21

EXAMPLE

20

7 left edges, 34 edge length 6 left edes, 32 edge length

ORIGINAL CONSTRUCTION DLP & IMPROVEMENT

slide-22
SLIDE 22

RESULTS

21

slide-23
SLIDE 23

TOPOLOGICAL METRICS

2.74 1.47 1.02 0.72 0.56 7.07 8.55

22

3.71 2.89 2.64 2.54 2.44 2.93 8.67 10.36 39.91 55.47 65.73 75.66 82.47 141.3 53.53 68.91 34.45 46.73 52.79 56.14 60.53 72.64 48.48 58.21

Dummy Nodes North Random Reversed Edges North Random 1-40 1-20 1-30 1-10 1-50 EAGA Heur Heur*

slide-24
SLIDE 24

GEOMETRICAL METRICS

587,727 622,838 641,581 660,842 695,494 874,374 629,778 691,372

23

631,737 672,717 691,216 700,385 708,361 737,159 656,070 720,798 1,068 1,224 1,334 1,409 1,469 1,727 1,137 1,216 843 943 980 1,004 1,025 1,084 930 1,027

Width (px) North Random Area (px) North Random 1-40 1-20 1-30 1-10 1-50 EAGA Heur Heur*

slide-25
SLIDE 25

WRAP UP

24

slide-26
SLIDE 26

25

QUESTIONS

Do people accept reversed edges? Are there better metrics for compactness? Does an iterative procedure/portfolio of algorithms help?

NOTES

GLP does not consider node sizes and is too slow Heuristic fails for paths and trees Averages of estimated and effective values show the same tendency

Still, for 64% of the graphs: estimated increased and effective decreased

slide-27
SLIDE 27

APPENDIX

26

slide-28
SLIDE 28

DIFFERENT PHASE STRATEGIES

27

Polyline BK LS

Random graphs

Width (px)

1,165 1,043 898 943 824 732 790 711 652 817 746 678

Orthogonal LS BK

EaGa 1-30 Heur

Area (px)

20,19418,68315,575 12,38311,03510,075 13,58212,64211,272 10,666 9,917 9,295

Aspect Ratio

0.59 0.67 0.67 0.55 0.64 0.64 0.84 0.96 0.9 0.63 0.7 0.68