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
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
RALIZA ZATION ON
OF OF THE THE
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
1
2
3
4
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
P1 Cycle Removal P2 Layer Assignment P3 Crossing Minimization P4 Node Placement P5 Edge Routing
Topological Phases Geometrical Phases
Methods for visual understanding of hierarchical system structures, IEEE Trans. on Syst., Man and Cybernetics, 1981.
5
Drawing layered graphs with port constraints
Journal of Visual Languages and Computing, 2013
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 ...
7
Height Width
estimated vs effective
8
A branch-and-cut approach to the directed acyclic graph layering problem, Graph Drawing, 2002.
How to layer a directed acyclic graph, Graph Drawing, 2001.
In search for efficient heuristics for minimum-width graph layering with consideration of dummy nodes, Journal of Experimental Algorithmics, 2005.
Drawing graphs with GLEE, Graph Drawing, 2008.
"MINIMUM WIDTH" LAYERING ASPECT RATIO
A technique for drawing directed graphs, IEEE Transactions on Software Engineering, 1993.
How to draw a directed graph, Journal of Information Processing, 1990.
Optimal scheduling for two-processor systems, Acta Informatica, 1972.
9
1
Height bound by the longest path
2
Width bound by highest node degree Input graph must be acyclic
10
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
11
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
0 reversed edges, 71 edge length 2 reversed edges, 35 edge length 6 reversed edges, 16 edge length
13
Given a directed acyclic graph 𝐻 = 𝑊, 𝐹 , find a valid layering 𝑀: 𝑊 → ℕ. MINIMIZE SUBJECT TO
𝑀 𝑥 − 𝑀 𝑤 ≥ 1 ∀ 𝑤, 𝑥 ∈ 𝐹
𝑤,𝑥 ∈𝐹
𝑀 𝑥 − 𝑀(𝑤)
14
A technique for drawing directed graphs,
IEEE Transactions on Software Engineering, 1993.
𝑀 𝑥 − 𝑀 𝑤 ≥ 1
Given a directed acyclic graph 𝐻 = 𝑊, 𝐹 , find a feasible layering 𝑀: 𝑊 → ℕ. MINIMIZE SUBJECT TO
∀ 𝑤, 𝑥 ∈ 𝐹 𝑥𝑚𝑓𝑜
𝑤,𝑥 ∈𝐹
𝑀 𝑥 − 𝑀(𝑤) + 𝑥𝑠𝑓𝑤 𝑤, 𝑥 ∈ 𝐹: 𝑀 𝑤 > 𝑀(𝑥)
𝑀 𝑥 − 𝑀 𝑤 ≥ 1
15
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
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
18
A new heuristic algorithm for the linear arrangement problem, Technical Report, University of New Brunswick, 1999.
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
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
20
7 left edges, 34 edge length 6 left edes, 32 edge length
ORIGINAL CONSTRUCTION DLP & IMPROVEMENT
21
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*
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*
24
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
26
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