/25 1
Drawing Graphs within Restricted Area
Martin Fink Department of Computer Science University of California, Santa Barbara
Joint work with Maximilian Aulbach, Julian Schuhmann, and Alexander Wolff
Drawing Graphs within Restricted Area Martin Fink Department of - - PowerPoint PPT Presentation
Drawing Graphs within Restricted Area Martin Fink Department of Computer Science University of California, Santa Barbara Joint work with Maximilian Aulbach, Julian Schuhmann, and Alexander Wolff 1 /25 Motivation Calculation Graphs
/25 1
Martin Fink Department of Computer Science University of California, Santa Barbara
Joint work with Maximilian Aulbach, Julian Schuhmann, and Alexander Wolff
/25 2
directed graph of calculation steps
1 2 2−1 2
1 − 1
2
/25 2
directed graph of calculation steps
1−1 2 1 2 2−1 2
1 − 1
2
/25 2
directed graph of calculation steps
1−1 2 1 2 2−1 2
1 − 1
2
2 6 5 3 1 2
source: studies with many students
/25 2
directed graph of calculation steps
1−1 2 1 2 2−1 2
1 − 1
2
2 6 5 3 1 2
source: studies with many students 10 6 3 8 2
/25 2
directed graph of calculation steps
1−1 2 1 2 2−1 2
1 − 1
2
2 6 5 3 1 2
source: studies with many students
10 6 3 8 2
/25 2
directed graph of calculation steps
1−1 2 1 2 2−1 2
1 − 1
2
2 6 5 3 1 2
source: studies with many students
task: allow human expert to analyze for typical calculation steps and frequent mistakes 10 6 3 8 2
/25 2
directed graph of calculation steps
1−1 2 1 2 2−1 2
1 − 1
2
2 6 5 3 1 2
source: studies with many students
task: allow human expert to analyze for typical calculation steps and frequent mistakes 10 6 3 8 2 – draw heavy subgraph in prescribed drawing area – given vertex sizes
/25 2
directed graph of calculation steps
1−1 2 1 2 2−1 2
1 − 1
2
2 6 5 3 1 2
source: studies with many students
task: allow human expert to analyze for typical calculation steps and frequent mistakes 10 6 3 8 2 – draw heavy subgraph in prescribed drawing area – given vertex sizes NP-hard
/25 3
social networks
/25 3
social networks collaboration/coauthor graphs
/25 3
social networks collaboration/coauthor graphs example: invited talk yesterday
/25 3
social networks collaboration/coauthor graphs Formally: Input: – weighted graph G = (V , E) – vertex sizes w(v) and h(v) for each v ∈ V – prescribed drawing area of width W and height H example: invited talk yesterday
/25 3
social networks collaboration/coauthor graphs Formally: Input: – weighted graph G = (V , E) – vertex sizes w(v) and h(v) for each v ∈ V – prescribed drawing area of width W and height H Output: nice drawing of heavy subgraph G ′ of G within the drawing area example: invited talk yesterday
/25 3
social networks collaboration/coauthor graphs Formally: Input: – weighted graph G = (V , E) – vertex sizes w(v) and h(v) for each v ∈ V – prescribed drawing area of width W and height H Output: nice drawing of heavy subgraph G ′ of G within the drawing area depends on application example: invited talk yesterday
/25 3
social networks collaboration/coauthor graphs Formally: Input: – weighted graph G = (V , E) – vertex sizes w(v) and h(v) for each v ∈ V – prescribed drawing area of width W and height H Output: nice drawing of heavy subgraph G ′ of G within the drawing area depends on application maximize weight example: invited talk yesterday
/25 3
social networks collaboration/coauthor graphs Formally: Input: – weighted graph G = (V , E) – vertex sizes w(v) and h(v) for each v ∈ V – prescribed drawing area of width W and height H Output: nice drawing of heavy subgraph G ′ of G within the drawing area depends on application maximize weight We present heuristics for – calculation graphs – straight-line drawings of general weighted graphs
/25 4
[Fruchterman, Reingold 1991]: prescribed rectangular drawing area but: vertices can be made arbitrarily small
/25 4
[Fruchterman, Reingold 1991]: prescribed rectangular drawing area but: vertices can be made arbitrarily small constrained graph layout, e.g., [Dwyer et al. 2006]: constrain vertex position to prescribed rectangle but: no strategy for dropping vertices
/25 4
[Fruchterman, Reingold 1991]: prescribed rectangular drawing area but: vertices can be made arbitrarily small constrained graph layout, e.g., [Dwyer et al. 2006]: constrain vertex position to prescribed rectangle but: no strategy for dropping vertices interactive methods for graph exploration: – [Dwyer et al. 2008]: overview+detail – [Da Lozzo et al. 2011]: graph exploration on smartphone
/25 5
1−1 2 1 2 2−1 2
1 − 1
2
hierarchical drawing (left to right) start vertex left
/25 6
based on Sugiyama framework extra phases for removing vertices/edges
/25 6
based on Sugiyama framework extra phases for removing vertices/edges take weights into account
/25 6
based on Sugiyama framework extra phases for removing vertices/edges take weights into account
1 2 5 6 3 4
breaking cycles
/25 6
based on Sugiyama framework extra phases for removing vertices/edges take weights into account
1 2 5 6 3 4
breaking cycles
2 5 6 3 4 1
layer assignment
/25 6
based on Sugiyama framework extra phases for removing vertices/edges take weights into account
1 2 5 6 3 4
breaking cycles
2 5 6 3 4 1
layer assignment crossing reduction
1 2 3 4 5 6
/25 6
based on Sugiyama framework extra phases for removing vertices/edges take weights into account
1 2 5 6 3 4
breaking cycles
2 5 6 3 4 1
layer assignment crossing reduction
1 2 3 4 5 6 1 2 5 6 3 4
edge routing
/25 6
based on Sugiyama framework extra phases for removing vertices/edges take weights into account
1 2 5 6 3 4
breaking cycles
2 5 6 3 4 1
layer assignment crossing reduction
1 2 3 4 5 6 1 2 5 6 3 4
edge routing
/25 6
based on Sugiyama framework extra phases for removing vertices/edges take weights into account
1 2 5 6 3 4
breaking cycles
2 5 6 3 4 1
layer assignment crossing reduction
1 2 3 4 5 6 1 2 5 6 3 4
edge routing
/25 7
breaking cycles: minimize weight of reverted edges can afford ILP solution
/25 7
breaking cycles: minimize weight of reverted edges can afford ILP solution layer assignment: first use overfull layers
/25 7
breaking cycles: minimize weight of reverted edges can afford ILP solution layer assignment: first use overfull layers from left to right: remove vertices until layer small enough
/25 7
breaking cycles: minimize weight of reverted edges can afford ILP solution layer assignment: first use overfull layers from left to right: remove vertices until layer small enough remove vertex v based on importance i(v) = w(v)/h(v)
/25 7
breaking cycles: minimize weight of reverted edges can afford ILP solution layer assignment: first use overfull layers from left to right: remove vertices until layer small enough remove layers until all vertices fit into drawing area
/25 7
breaking cycles: minimize weight of reverted edges can afford ILP solution layer assignment: first use overfull layers from left to right: remove vertices until layer small enough remove layers until all vertices fit into drawing area remove layer L based on importance i(L) =
v∈L w(v)/width(L)
/25 7
breaking cycles: minimize weight of reverted edges can afford ILP solution layer assignment: first use overfull layers from left to right: remove vertices until layer small enough remove layers until all vertices fit into drawing area crossing minimization: adjacent-exchange heuristic can take weights of crossing edges into account u v
/25 7
breaking cycles: minimize weight of reverted edges can afford ILP solution layer assignment: first use overfull layers from left to right: remove vertices until layer small enough remove layers until all vertices fit into drawing area crossing minimization: adjacent-exchange heuristic can take weights of crossing edges into account u v higher cost for crossing heavy edge
/25 7
breaking cycles: minimize weight of reverted edges can afford ILP solution layer assignment: first use overfull layers from left to right: remove vertices until layer small enough remove layers until all vertices fit into drawing area crossing minimization: adjacent-exchange heuristic can take weights of crossing edges into account too many crossings: remove edge e based on importance i(e) = w(e) total weight of edges crossing e
/25 7
breaking cycles: minimize weight of reverted edges can afford ILP solution layer assignment: first use overfull layers from left to right: remove vertices until layer small enough remove layers until all vertices fit into drawing area crossing minimization: adjacent-exchange heuristic can take weights of crossing edges into account too many crossings: remove edge e based on importance i(e) = w(e) total weight of edges crossing e try to reinsert removed
extension:
/25 8
place vertical segments between consecutive layers
/25 8
place vertical segments between consecutive layers no unnecessary crossings
/25 8
place vertical segments between consecutive layers no unnecessary crossings
/25 8
place vertical segments between consecutive layers no unnecessary crossings improve spacing of segments by force-directed method
/25 8
place vertical segments between consecutive layers no unnecessary crossings improve spacing of segments by force-directed method
/25 8
place vertical segments between consecutive layers no unnecessary crossings improve spacing of segments by force-directed method Extension: B´ ezier Curves
/25 8
place vertical segments between consecutive layers no unnecessary crossings improve spacing of segments by force-directed method Extension: B´ ezier Curves Improved Routing
/25 9
32 40 6 10 17 40 7 8 3 40
(3
8 + 1 5) (15+8) 40
(15
40 + 9 40)
((3·5)
(8·5) + (1·8) (5·8)) 1 5 120 40 23 45 4 14 11 20
(15
40 + 5 40) 29 40 23 80 4 12 13 40
(15
40 + 8 40) 21 40 1 10
(3
8 + 3 8) 16 40 1 2 1 4
117
40 4 5
( 3
40 + 1 40) 22 40 3 13 19 40 1 3 3 5 4 8 18 40 23 40 4 13 4 40 7 40 24 40
3 1
13
(30
80 + 16 80) 20 40 (3+1) (8+5)
38 of 358 vertices (10.6 %); 91.1 % of the vertex weight
/25 9
32 40 6 10 17 40 7 8 3 40
(3
8 + 1 5) (15+8) 40
(15
40 + 9 40)
((3·5)
(8·5) + (1·8) (5·8)) 1 5 120 40 23 45 4 14 11 20
(15
40 + 5 40) 29 40 23 80 4 12 13 40
(15
40 + 8 40) 21 40 1 10
(3
8 + 3 8) 16 40 1 2 1 4
117
40 4 5
( 3
40 + 1 40) 22 40 3 13 19 40 1 3 3 5 4 8 18 40 23 40 4 13 4 40 7 40 24 40
3 1
13
(30
80 + 16 80) 20 40 (3+1) (8+5)
38 of 358 vertices (10.6 %); 91.1 % of the vertex weight
/25 10
12 (34
6 · 43 6)
(8
3 · 9 2)
123
6
122
6
4 153
2
16.5 159
6
161
2
163
6 11 1 (11·3) (1·2) 24 72
(11
9 · 9 2)
51
2
99 194
5
81
6
261
2
(32
3 · 41 2)
71
3
72
6 24 6 (11·9) (3·2)
121
3
1212
6
(2
3 · 1 2)
161
3
(6
9 · 4 8)
(11
1 · 3 2)
(22
6 · 27 6 )
14 1039
6
(6
3 · 4 2)
(31
3 · 41 1) 88 6 99 5 33 2 99 6
73
5
9 (11
3 · 9 2)
(9
3 · 6 2) 33 3
4.7 % of 1031 vert.; 75.9 % vertex weight; 74.1 % edge weight
/25 10
33 3
(32
3 · 41 2)
(11
1 · 3 2) 594 36
122
6
72
6 99 5
4
99 6
13 (8
3 · 9 2)
12 (11
3 · 9 2)
8
24 72
153
2 22 27 (11·9) (3·2) 33 2
81
6
(22
6 · 27 6 )
161
2
(6
3 · 4 2)
163
6
(11
9 · 9 2)
(2
3 · 1 2) 49 6
9 194
5
(6
9 · 4 8) 594 6 (11·3) (1·2)
(31
3 · 41 1)
121
3
99
88 6
161
3
14
11 1
73
5
1212
6
(34
6 · 43 6) 24 6
16.5
4.3 % of 1031 vert.; 76.6 % vertex weight; 70.2 % edge weight
/25 11
runtime for graph with 1031 vertices and 1549 edges to A4 paper: ≈ 3s
/25 11
runtime for graph with 1031 vertices and 1549 edges to A4 paper: ≈ 3s most of it for edge routing
/25 11
runtime for graph with 1031 vertices and 1549 edges to A4 paper: ≈ 3s most of it for edge routing preprocessing removing very light vertices yielded speedup + heavier outputs
/25 11
runtime for graph with 1031 vertices and 1549 edges to A4 paper: ≈ 3s most of it for edge routing preprocessing removing very light vertices yielded speedup + heavier outputs especially with vertex/edge reinsertion: no significant influence of layer assignment algorithm
/25 12
/25 12
/25 12
/25 12
/25 12
/25 12
/25 12
/25 12
/25 13
use force-directed approach + standard forces
/25 13
use force-directed approach + standard forces keep drawing in prescribed frame
/25 13
use force-directed approach + standard forces keep drawing in prescribed frame compare [Fruchterman, Reingold ’91]
/25 13
use force-directed approach + standard forces keep drawing in prescribed frame keep drawing in frame slowly shrink frame compare [Fruchterman, Reingold ’91]
/25 13
use force-directed approach + standard forces keep drawing in prescribed frame keep drawing in frame slowly shrink frame remove vertices/edges if necessary after shrinking find new equilibrium compare [Fruchterman, Reingold ’91]
/25 14
start with some initial drawing
/25 14
start with some initial drawing compute equilibrium layout
/25 14
start with some initial drawing compute equilibrium layout initialize frame F around drawing
/25 14
start with some initial drawing compute equilibrium layout initialize frame F around drawing while F too large:
/25 14
start with some initial drawing compute equilibrium layout initialize frame F around drawing while F too large: – shrink F – find new equilibrium
/25 14
start with some initial drawing compute equilibrium layout initialize frame F around drawing while F too large: – shrink F – find new equilibrium – if necessary remove vertices/edges
/25 14
start with some initial drawing compute equilibrium layout initialize frame F around drawing while F too large: – shrink F – find new equilibrium – if necessary remove vertices/edges postprocessing: transform straight-line edges to B´ ezier curves
/25 15
repulsion between vertices
v1 v2
/25 15
repulsion between vertices
v1 v2
attraction between adjacent vertices
v1 v2
/25 15
repulsion between vertices
v1 v2
attraction between adjacent vertices
v1 v2
desired edge length [Fruchterman, Reingold 1991]
/25 15
repulsion between vertices
v1 v2
attraction between adjacent vertices
v1 v2
desired edge length edge-vertex repulsion
v3 v1 iv3 v2
[Bertault, 2000] [Fruchterman, Reingold 1991]
/25 15
repulsion between vertices
v1 v2
attraction between adjacent vertices
v1 v2
desired edge length edge-vertex repulsion
v3 v1 iv3 v2
[Bertault, 2000] v frame boundary: cut off movement [Fruchterman, Reingold 1991]
/25 16
/25 16
/25 16
/25 16
iteratively shrink frame
/25 16
iteratively shrink frame push vertices into frame v2 v1 v2 v1 v2 v1
/25 16
iteratively shrink frame push vertices into frame v2 v1 v2 v1 v2 v1 compute new equilibrium layout
/25 16
iteratively shrink frame push vertices into frame v2 v1 v2 v1 v2 v1 compute new equilibrium layout remove vertices/edges if necessary distances too short ↔ desired edge length
/25 16
iteratively shrink frame push vertices into frame v2 v1 v2 v1 v2 v1 compute new equilibrium layout remove vertices/edges if necessary distances too short ↔ desired edge length average edge length small: remove a vertex
/25 16
iteratively shrink frame push vertices into frame v2 v1 v2 v1 v2 v1 compute new equilibrium layout remove vertices/edges if necessary distances too short ↔ desired edge length average edge length small: remove a vertex
/25 17
remove lightest vertex remove vertex with worst weight-area ratio
/25 17
remove lightest vertex remove vertex with worst weight-area ratio
/25 17
remove lightest vertex remove vertex with worst weight-area ratio
/25 17
remove lightest vertex remove vertex with worst weight-area ratio
also take current drawing into account: compute pressure based on forces
/25 17
remove lightest vertex remove vertex with worst weight-area ratio
also take current drawing into account: compute pressure based on forces idea: forces in opposite directions v
/25 17
remove lightest vertex remove vertex with worst weight-area ratio
also take current drawing into account: compute pressure based on forces idea: forces in opposite directions v pressure P(v)
/25 17
remove lightest vertex remove vertex with worst weight-area ratio
also take current drawing into account: compute pressure based on forces v
/25 17
remove lightest vertex remove vertex with worst weight-area ratio
also take current drawing into account: compute pressure based on forces v
/25 17
remove lightest vertex remove vertex with worst weight-area ratio
also take current drawing into account: compute pressure based on forces v – compare with opposite octants
/25 17
remove lightest vertex remove vertex with worst weight-area ratio
also take current drawing into account: compute pressure based on forces 6 1 2 3 v – compare with opposite octants – worst pair → pressure
/25 17
remove lightest vertex remove vertex with worst weight-area ratio
also take current drawing into account: compute pressure based on forces v v 6 1 2 3 2 3 4 7 v
/25 17
remove lightest vertex remove vertex with worst weight-area ratio
also take current drawing into account: compute pressure based on forces v v 6 1 2 3 2 3 4 7 v remove vertex with highest stress value S(v) =
P(v) w(v)·(d(v)+0.001)
/25 18
movement cut off v
/25 18
movement cut off v model as force
/25 19
avoid edge-vertex intersections v5 v8 v9 v6 v2 v4 v7 v3 v1
/25 19
avoid edge-vertex intersections v5 v8 v9 v6 v2 v4 v7 v3 v1
/25 19
avoid edge-vertex intersections v5 v8 v9 v6 v2 v4 v7 v3 v1
/25 19
avoid edge-vertex intersections v5 v8 v9 v6 v2 v4 draw some edges as quadratic B´ ezier curves force-directed computation of curve
P1 v2 v3 v1
v7 v3 v1
/25 20
/25 21
Yehuda Koren Ulrich F¨
Takao Nishizeki Prosenjit Bose Maurizio Patrignani Walter Didimo Bettina Speckmann Marc J. van Kreveld Joe Marks Ashim Garg Sebastian Leipert Shin-Ichi Nakano Ugur Dogrus¨
Petra Mutzel G´ eza T´
Kim Marriott David R. Wood Ioannis G. Tollis Christian Bachmaier Gunnar W. Klau Tim Dwyer Christian A. Duncan Lev Nachmanson Georg Sander Maurizio Pizzonia Vida Dujmovic William Lenhart Stephen K. Wismath
Michael Wybrow Giuseppe Di Battista Alexander Wolff Patrizio Angelini Markus Chimani Karsten Klein Henk Meijer Giuseppe Liotta Emilio Di Giacomo Therese C. Biedl Michael T. Goodrich Roberto Tamassia Ulrik Brandes Sabine Cornelsen Carsten Gutwenger Michael Kaufmann Martin N¨
Ignaz Rutter Franz-Josef Brandenburg Peter Eades Seok-Hee Hong Dorothea Wagner Tamara Mchedlidze Sue Whitesides Antonios Symvonis Michael A. Bekos David Eppstein Stephen G. Kobourov Fabrizio Frati Jan Kratochv´ ıl Helen C. Purchase Emden R. Gansner Michael J¨ unger Stephen C. North
J´ anos Pach Stina S. Bridgeman
/25 22
Yehuda Koren Ulrich F¨
Takao Nishizeki Prosenjit Bose Maurizio Patrignani Walter Didimo Bettina Speckmann Marc J. van Kreveld Joe Marks Ashim Garg Sebastian Leipert Shin-Ichi Nakano Ugur Dogrus¨
Petra Mutzel G´ eza T´
Kim Marriott David R. Wood Ioannis G. Tollis Christian Bachmaier Gunnar W. Klau Tim Dwyer Christian A. Duncan Lev Nachmanson Georg Sander Maurizio Pizzonia Vida Dujmovic William Lenhart Stephen K. Wismath
Michael Wybrow Giuseppe Di Battista Alexander Wolff Patrizio Angelini Markus Chimani Karsten Klein Henk Meijer Giuseppe Liotta Emilio Di Giacomo Therese C. Biedl Michael T. Goodrich Roberto Tamassia Ulrik Brandes Sabine Cornelsen Carsten Gutwenger Michael Kaufmann Martin N¨
Ignaz Rutter Franz-Josef Brandenburg Peter Eades Seok-Hee Hong Dorothea Wagner Tamara Mchedlidze Sue Whitesides Antonios Symvonis Michael A. Bekos David Eppstein Stephen G. Kobourov Fabrizio Frati Jan Kratochv´ ıl Helen C. Purchase Emden R. Gansner Michael J¨ unger Stephen C. North
J´ anos Pach Stina S. Bridgeman
/25 23
Yehuda Koren Takao Nishizeki Prosenjit Bose Maurizio Patrignani Walter Didimo Joe Marks Ashim Garg Sebastian Leipert Petra Mutzel G´ eza T´
Kim Marriott David R. Wood Ioannis G. Tollis Christian Bachmaier Tim Dwyer Christian A. Duncan Lev Nachmanson Georg Sander Maurizio Pizzonia Vida Dujmovic Stephen K. Wismath
Giuseppe Di Battista Alexander Wolff Patrizio Angelini Markus Chimani Karsten Klein Henk Meijer Giuseppe Liotta Emilio Di Giacomo Therese C. Biedl Michael T. Goodrich Roberto Tamassia Ulrik Brandes Sabine Cornelsen Carsten Gutwenger Michael Kaufmann Martin N¨
Franz-Josef Brandenburg Peter Eades Seok-Hee Hong Dorothea Wagner Tamara Mchedlidze Sue Whitesides Marcus Schaefer Antonios Symvonis Michael A. Bekos David Eppstein Stephen G. Kobourov Fabrizio Frati Jan Kratochv´ ıl Emden R. Gansner Michael J¨ unger Stephen C. North J´ anos Pach Stina S. Bridgeman
/25 23
Yehuda Koren Takao Nishizeki Prosenjit Bose Maurizio Patrignani Walter Didimo Joe Marks Ashim Garg Sebastian Leipert Petra Mutzel G´ eza T´
Kim Marriott David R. Wood Ioannis G. Tollis Christian Bachmaier Tim Dwyer Christian A. Duncan Lev Nachmanson Georg Sander Maurizio Pizzonia Vida Dujmovic Stephen K. Wismath
Giuseppe Di Battista Alexander Wolff Patrizio Angelini Markus Chimani Karsten Klein Henk Meijer Giuseppe Liotta Emilio Di Giacomo Therese C. Biedl Michael T. Goodrich Roberto Tamassia Ulrik Brandes Sabine Cornelsen Carsten Gutwenger Michael Kaufmann Martin N¨
Franz-Josef Brandenburg Peter Eades Seok-Hee Hong Dorothea Wagner Tamara Mchedlidze Sue Whitesides Marcus Schaefer Antonios Symvonis Michael A. Bekos David Eppstein Stephen G. Kobourov Fabrizio Frati Jan Kratochv´ ıl Emden R. Gansner Michael J¨ unger Stephen C. North J´ anos Pach Stina S. Bridgeman
desired edgle length +25%
/25 24
GD coauthor graph (1994 - 2012): 950, vertices 2559 edges → A4 paper, 10pt font: – runtime ≈ 2 minutes
/25 24
GD coauthor graph (1994 - 2012): 950, vertices 2559 edges → A4 paper, 10pt font: – runtime ≈ 2 minutes preprocessing removing very light vertices yielded speedup + heavier outputs
/25 24
GD coauthor graph (1994 - 2012): 950, vertices 2559 edges → A4 paper, 10pt font: – runtime ≈ 2 minutes preprocessing removing very light vertices yielded speedup + heavier outputs activating edge-vertex repulsion only at the end of force-directed phase: weight of edges in output +80%
/25 25
new problem: find + draw heavy subgraph within prescribed area
/25 25
new problem: heuristic for calculation graphs force-directed approach for general graphs find + draw heavy subgraph within prescribed area
/25 25
new problem: heuristic for calculation graphs force-directed approach for general graphs nice output drawings find + draw heavy subgraph within prescribed area
/25 25
new problem: heuristic for calculation graphs force-directed approach for general graphs nice output drawings Problems: – no alternative methods to compare with: real performance? – speedup find + draw heavy subgraph within prescribed area