part 2 algorithms for graph visualization - kit - iti algorithmik i - … · 2018-01-11 · dr....

58
Dr. Tamara Mchedlide · Algorithmen zur Visualisierung von Graphen Layered Layout 1 Tamara Mchedlidze Algorithms for Graph Visualization INSTITUT F ¨ UR THEORETISCHE INFORMATIK · FAKULT ¨ AT F ¨ UR INFORMATIK Layered Layout – Part 2 11.1.2018 Dr. Tamara Mchedlide · Algorithmen zur Visualisierung von Graphen Layered Layout

Upload: others

Post on 13-Jun-2020

1 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: Part 2 Algorithms for Graph Visualization - KIT - ITI Algorithmik I - … · 2018-01-11 · Dr. Tamara Mchedlide Algorithmen zur Visualisierung von Graphen Layered Layout 1 Tamara

Dr. Tamara Mchedlide · Algorithmen zur Visualisierung von Graphen Layered Layout1

Tamara Mchedlidze

Algorithms for Graph Visualization

INSTITUT FUR THEORETISCHE INFORMATIK · FAKULTAT FUR INFORMATIK

Layered Layout – Part 2

11.1.2018

Dr. Tamara Mchedlide · Algorithmen zur Visualisierung von Graphen Layered Layout

Page 2: Part 2 Algorithms for Graph Visualization - KIT - ITI Algorithmik I - … · 2018-01-11 · Dr. Tamara Mchedlide Algorithmen zur Visualisierung von Graphen Layered Layout 1 Tamara

Dr. Tamara Mchedlide · Algorithmen zur Visualisierung von Graphen Layered Layout2 - 1

Layered Layout

Given: directed graph D = (V,A)

Find: drawing of D that emphasizes the hierarchy bypositioning nodes on horizontal layers

Page 3: Part 2 Algorithms for Graph Visualization - KIT - ITI Algorithmik I - … · 2018-01-11 · Dr. Tamara Mchedlide Algorithmen zur Visualisierung von Graphen Layered Layout 1 Tamara

Dr. Tamara Mchedlide · Algorithmen zur Visualisierung von Graphen Layered Layout2 - 2

Layered Layout

Given: directed graph D = (V,A)

Find: drawing of D that emphasizes the hierarchy bypositioning nodes on horizontal layers

Criteria:• many edges pointing to the same direction• few layers or limited number of nodes per layer• preferably few edge crossings• nodes distributed evenly• edges preferably straight and short

Page 4: Part 2 Algorithms for Graph Visualization - KIT - ITI Algorithmik I - … · 2018-01-11 · Dr. Tamara Mchedlide Algorithmen zur Visualisierung von Graphen Layered Layout 1 Tamara

Dr. Tamara Mchedlide · Algorithmen zur Visualisierung von Graphen Layered Layout3 - 1

Sugiyama Framework (Sugiyama, Tagawa, Toda 1981)

given resolve cycles layerassignement

crossing minimization node positioning edge drawing

Page 5: Part 2 Algorithms for Graph Visualization - KIT - ITI Algorithmik I - … · 2018-01-11 · Dr. Tamara Mchedlide Algorithmen zur Visualisierung von Graphen Layered Layout 1 Tamara

Dr. Tamara Mchedlide · Algorithmen zur Visualisierung von Graphen Layered Layout3 - 2

Sugiyama Framework (Sugiyama, Tagawa, Toda 1981)

given resolve cycles layerassignement

crossing minimization node positioning edge drawing

Page 6: Part 2 Algorithms for Graph Visualization - KIT - ITI Algorithmik I - … · 2018-01-11 · Dr. Tamara Mchedlide Algorithmen zur Visualisierung von Graphen Layered Layout 1 Tamara

Dr. Tamara Mchedlide · Algorithmen zur Visualisierung von Graphen Layered Layout4

Step 3: Crossing Minimization

Page 7: Part 2 Algorithms for Graph Visualization - KIT - ITI Algorithmik I - … · 2018-01-11 · Dr. Tamara Mchedlide Algorithmen zur Visualisierung von Graphen Layered Layout 1 Tamara

Dr. Tamara Mchedlide · Algorithmen zur Visualisierung von Graphen Layered Layout5 - 1

Problem Statement

Given:DAG D = (V,A), nodes are partitioned in disjoint layers

Find: Order of the nodes on each layer, so that the number ofcrossing is minimized

Page 8: Part 2 Algorithms for Graph Visualization - KIT - ITI Algorithmik I - … · 2018-01-11 · Dr. Tamara Mchedlide Algorithmen zur Visualisierung von Graphen Layered Layout 1 Tamara

Dr. Tamara Mchedlide · Algorithmen zur Visualisierung von Graphen Layered Layout5 - 2

Problem Statement

Given:DAG D = (V,A), nodes are partitioned in disjoint layers

Find: Order of the nodes on each layer, so that the number ofcrossing is minimized

Properties• Problem is NP-hard even for two layers

(Bipartite Crossing Number [Garey, Johnson ’83])• No approach over several layers simultaneously• Usually iterative optimization for two adjacent layers• For that: insert dummy nodes at the intersection of edges

with layers

Page 9: Part 2 Algorithms for Graph Visualization - KIT - ITI Algorithmik I - … · 2018-01-11 · Dr. Tamara Mchedlide Algorithmen zur Visualisierung von Graphen Layered Layout 1 Tamara

Dr. Tamara Mchedlide · Algorithmen zur Visualisierung von Graphen Layered Layout6 - 1

One-sided Crossing Minimization (OSCM)

Given: 2-Layered-Graph G = (L1, L2, E) andordering of the nodes x1 of L1

Find: Node ordering x2 of L2, such that the number ofcrossing among E is minumum

Page 10: Part 2 Algorithms for Graph Visualization - KIT - ITI Algorithmik I - … · 2018-01-11 · Dr. Tamara Mchedlide Algorithmen zur Visualisierung von Graphen Layered Layout 1 Tamara

Dr. Tamara Mchedlide · Algorithmen zur Visualisierung von Graphen Layered Layout6 - 2

One-sided Crossing Minimization (OSCM)

Given: 2-Layered-Graph G = (L1, L2, E) andordering of the nodes x1 of L1

Find: Node ordering x2 of L2, such that the number ofcrossing among E is minumum

Observation:• The number of crossing in 2-layered drawing of G depends

only on ordering of the nodes, not from the exact positions• for u, v ∈ L2 the number of crossing among incident to

them edges depends on whether x2(u) < x2(v) orx2(v) < x2(u) and not on the positions of other vertices

Page 11: Part 2 Algorithms for Graph Visualization - KIT - ITI Algorithmik I - … · 2018-01-11 · Dr. Tamara Mchedlide Algorithmen zur Visualisierung von Graphen Layered Layout 1 Tamara

Dr. Tamara Mchedlide · Algorithmen zur Visualisierung von Graphen Layered Layout6 - 3

One-sided Crossing Minimization (OSCM)

Given: 2-Layered-Graph G = (L1, L2, E) andordering of the nodes x1 of L1

Find: Node ordering x2 of L2, such that the number ofcrossing among E is minumum

Observation:• The number of crossing in 2-layered drawing of G depends

only on ordering of the nodes, not from the exact positions• for u, v ∈ L2 the number of crossing among incident to

them edges depends on whether x2(u) < x2(v) orx2(v) < x2(u) and not on the positions of other vertices

Def: cuv := |(uw, vz) : w ∈ N(u), z ∈ N(v), x1(z) < x1(w)|for x2(u) < x2(v) u v

cuv = 5cvu = 7

Page 12: Part 2 Algorithms for Graph Visualization - KIT - ITI Algorithmik I - … · 2018-01-11 · Dr. Tamara Mchedlide Algorithmen zur Visualisierung von Graphen Layered Layout 1 Tamara

Dr. Tamara Mchedlide · Algorithmen zur Visualisierung von Graphen Layered Layout6 - 4

One-sided Crossing Minimization (OSCM)

Given: 2-Layered-Graph G = (L1, L2, E) andordering of the nodes x1 of L1

Find: Node ordering x2 of L2, such that the number ofcrossing among E is minumum

Observation:• The number of crossing in 2-layered drawing of G depends

only on ordering of the nodes, not from the exact positions• for u, v ∈ L2 the number of crossing among incident to

them edges depends on whether x2(u) < x2(v) orx2(v) < x2(u) and not on the positions of other vertices

Def: cuv := |(uw, vz) : w ∈ N(u), z ∈ N(v), x1(z) < x1(w)|for x2(u) < x2(v) v u

cuv = 5cvu = 7

Page 13: Part 2 Algorithms for Graph Visualization - KIT - ITI Algorithmik I - … · 2018-01-11 · Dr. Tamara Mchedlide Algorithmen zur Visualisierung von Graphen Layered Layout 1 Tamara

Dr. Tamara Mchedlide · Algorithmen zur Visualisierung von Graphen Layered Layout7 - 1

Further Properties

Def: Crossing number of G with orders x1 and x2 for L1 andL2 is denoted by cr(G, x1, x2);for fixed x1 then opt(G, x1) = minx2

cr(G, x1, x2)

Lemma 1: The following equalities hold:• cr(G, x1, x2) =

∑x2(u)<x2(v)

cuv• opt(G, x1) ≥

∑u,v mincuv, cvu

Page 14: Part 2 Algorithms for Graph Visualization - KIT - ITI Algorithmik I - … · 2018-01-11 · Dr. Tamara Mchedlide Algorithmen zur Visualisierung von Graphen Layered Layout 1 Tamara

Dr. Tamara Mchedlide · Algorithmen zur Visualisierung von Graphen Layered Layout7 - 2

Further Properties

Def: Crossing number of G with orders x1 and x2 for L1 andL2 is denoted by cr(G, x1, x2);for fixed x1 then opt(G, x1) = minx2

cr(G, x1, x2)

Lemma 1: The following equalities hold:• cr(G, x1, x2) =

∑x2(u)<x2(v)

cuv• opt(G, x1) ≥

∑u,v mincuv, cvu

Efficient computation of cr(G, x1, x2) see Exercise.

Page 15: Part 2 Algorithms for Graph Visualization - KIT - ITI Algorithmik I - … · 2018-01-11 · Dr. Tamara Mchedlide Algorithmen zur Visualisierung von Graphen Layered Layout 1 Tamara

Dr. Tamara Mchedlide · Algorithmen zur Visualisierung von Graphen Layered Layout7 - 3

Further Properties

Def: Crossing number of G with orders x1 and x2 for L1 andL2 is denoted by cr(G, x1, x2);for fixed x1 then opt(G, x1) = minx2

cr(G, x1, x2)

Lemma 1: The following equalities hold:• cr(G, x1, x2) =

∑x2(u)<x2(v)

cuv• opt(G, x1) ≥

∑u,v mincuv, cvu

Efficient computation of cr(G, x1, x2) see Exercise.

Think for a minute and then share

1 minWhy the second inequality is not anequality?

Page 16: Part 2 Algorithms for Graph Visualization - KIT - ITI Algorithmik I - … · 2018-01-11 · Dr. Tamara Mchedlide Algorithmen zur Visualisierung von Graphen Layered Layout 1 Tamara

Dr. Tamara Mchedlide · Algorithmen zur Visualisierung von Graphen Layered Layout8 - 1

Iterative Crossing Minimization

Let G = (V,E) be a DAG with layers L1, . . . , Lh.

(1) compute a random ordering x1 for layer L1

(2) for i = 1, . . . , h− 1 consider layers Li and Li+1 andminimize cr(G, xi, xi+1) with fixed xi (→ OSCM)

(3) for i = h− 1, . . . , 1 consider layers Li+1 and Li andminimize cr(G, xi, xi+1) with fixed xi+1 (→ OSCM)

(4) repeat (2) and (3) until no further improvement happens(5) repeat steps (1)–(4) with another x1(6) return the best found solution

Page 17: Part 2 Algorithms for Graph Visualization - KIT - ITI Algorithmik I - … · 2018-01-11 · Dr. Tamara Mchedlide Algorithmen zur Visualisierung von Graphen Layered Layout 1 Tamara

Dr. Tamara Mchedlide · Algorithmen zur Visualisierung von Graphen Layered Layout8 - 2

Iterative Crossing Minimization

Let G = (V,E) be a DAG with layers L1, . . . , Lh.

(1) compute a random ordering x1 for layer L1

(2) for i = 1, . . . , h− 1 consider layers Li and Li+1 andminimize cr(G, xi, xi+1) with fixed xi (→ OSCM)

(3) for i = h− 1, . . . , 1 consider layers Li+1 and Li andminimize cr(G, xi, xi+1) with fixed xi+1 (→ OSCM)

(4) repeat (2) and (3) until no further improvement happens(5) repeat steps (1)–(4) with another x1(6) return the best found solution

Theorem 1: The One-Sided Crossing Minimization (OSCM)problem is NP-hard (Eades, Wormald 1994).

Page 18: Part 2 Algorithms for Graph Visualization - KIT - ITI Algorithmik I - … · 2018-01-11 · Dr. Tamara Mchedlide Algorithmen zur Visualisierung von Graphen Layered Layout 1 Tamara

Dr. Tamara Mchedlide · Algorithmen zur Visualisierung von Graphen Layered Layout9

Algorithms for OSCM

Heuristics:• Barycenter• Median

Exact:• ILP Model

Page 19: Part 2 Algorithms for Graph Visualization - KIT - ITI Algorithmik I - … · 2018-01-11 · Dr. Tamara Mchedlide Algorithmen zur Visualisierung von Graphen Layered Layout 1 Tamara

Dr. Tamara Mchedlide · Algorithmen zur Visualisierung von Graphen Layered Layout10 - 1

Barycenter Heuristic (Sugiyama, Tagawa, Toda 1981)

Idea: few crossing when nodes are close to their neighbours• set

x2(u) =1

deg(u)

∑v∈N(u)

x1(v)

• in case of equality introduce tiny gap

Page 20: Part 2 Algorithms for Graph Visualization - KIT - ITI Algorithmik I - … · 2018-01-11 · Dr. Tamara Mchedlide Algorithmen zur Visualisierung von Graphen Layered Layout 1 Tamara

Dr. Tamara Mchedlide · Algorithmen zur Visualisierung von Graphen Layered Layout10 - 2

Barycenter Heuristic (Sugiyama, Tagawa, Toda 1981)

Idea: few crossing when nodes are close to their neighbours• set

x2(u) =1

deg(u)

∑v∈N(u)

x1(v)

• in case of equality introduce tiny gap

Properties:• trivial implementation• quick (exactly?)• usually very good results• finds optimum if opt(G, x1) = 0 (see Exercises)• there are graphs on which it performs Ω(

√n) times worse than

optimal

Page 21: Part 2 Algorithms for Graph Visualization - KIT - ITI Algorithmik I - … · 2018-01-11 · Dr. Tamara Mchedlide Algorithmen zur Visualisierung von Graphen Layered Layout 1 Tamara

Dr. Tamara Mchedlide · Algorithmen zur Visualisierung von Graphen Layered Layout10 - 3

Barycenter Heuristic (Sugiyama, Tagawa, Toda 1981)

Idea: few crossing when nodes are close to their neighbours• set

x2(u) =1

deg(u)

∑v∈N(u)

x1(v)

• in case of equality introduce tiny gap

Properties:• trivial implementation• quick (exactly?)• usually very good results• finds optimum if opt(G, x1) = 0 (see Exercises)• there are graphs on which it performs Ω(

√n) times worse than

optimal

Work with your neighbour and then share

5 minConstruct an example proving that barycentermethod works at least

√n times worse than optimal

Page 22: Part 2 Algorithms for Graph Visualization - KIT - ITI Algorithmik I - … · 2018-01-11 · Dr. Tamara Mchedlide Algorithmen zur Visualisierung von Graphen Layered Layout 1 Tamara

Dr. Tamara Mchedlide · Algorithmen zur Visualisierung von Graphen Layered Layout11 - 1

Median-Heuristic (Eades, Wormald 1994)

Idea: use the median of the coordinates of neightbours• for a node v ∈ L2 with neighbours v1, . . . , vk setx2(v) = med(v) = x1(vdk/2e)and x2(v) = 0 if N(v) = ∅• if x2(u) = x2(v) and u, v have different parity, place the

node with odd degree to the left• if x2(u) = x2(v) and u, v have the same parity, place an

arbitrary of them to the left• Runs in time O(|E|)

Page 23: Part 2 Algorithms for Graph Visualization - KIT - ITI Algorithmik I - … · 2018-01-11 · Dr. Tamara Mchedlide Algorithmen zur Visualisierung von Graphen Layered Layout 1 Tamara

Dr. Tamara Mchedlide · Algorithmen zur Visualisierung von Graphen Layered Layout11 - 2

Median-Heuristic (Eades, Wormald 1994)

Idea: use the median of the coordinates of neightbours• for a node v ∈ L2 with neighbours v1, . . . , vk setx2(v) = med(v) = x1(vdk/2e)and x2(v) = 0 if N(v) = ∅• if x2(u) = x2(v) and u, v have different parity, place the

node with odd degree to the left• if x2(u) = x2(v) and u, v have the same parity, place an

arbitrary of them to the left• Runs in time O(|E|)

Properties:• trivial implementation• fast• mostly good performance• finds optimum when opt(G, x1) = 0• Factor-3 Approximation

Page 24: Part 2 Algorithms for Graph Visualization - KIT - ITI Algorithmik I - … · 2018-01-11 · Dr. Tamara Mchedlide Algorithmen zur Visualisierung von Graphen Layered Layout 1 Tamara

Dr. Tamara Mchedlide · Algorithmen zur Visualisierung von Graphen Layered Layout12 - 1

Approximation Factor

Theorem 2: Let G = (L1, L2, E) be a 2-layered graph and x1an arbitrary ordering of L1. Then it holds that

med(G, x1) ≤ 3 opt(G, x1).

Page 25: Part 2 Algorithms for Graph Visualization - KIT - ITI Algorithmik I - … · 2018-01-11 · Dr. Tamara Mchedlide Algorithmen zur Visualisierung von Graphen Layered Layout 1 Tamara

Dr. Tamara Mchedlide · Algorithmen zur Visualisierung von Graphen Layered Layout12 - 2

Approximation Factor

Theorem 2: Let G = (L1, L2, E) be a 2-layered graph and x1an arbitrary ordering of L1. Then it holds that

med(G, x1) ≤ 3 opt(G, x1).

u v

med(u) med(v)

α δ γ β

Page 26: Part 2 Algorithms for Graph Visualization - KIT - ITI Algorithmik I - … · 2018-01-11 · Dr. Tamara Mchedlide Algorithmen zur Visualisierung von Graphen Layered Layout 1 Tamara

Dr. Tamara Mchedlide · Algorithmen zur Visualisierung von Graphen Layered Layout12 - 3

Approximation Factor

Theorem 2: Let G = (L1, L2, E) be a 2-layered graph and x1an arbitrary ordering of L1. Then it holds that

med(G, x1) ≤ 3 opt(G, x1).

u v

med(u) med(v)

α δ γ β

uv

med(u) med(v)

αδγ

β

Page 27: Part 2 Algorithms for Graph Visualization - KIT - ITI Algorithmik I - … · 2018-01-11 · Dr. Tamara Mchedlide Algorithmen zur Visualisierung von Graphen Layered Layout 1 Tamara

Dr. Tamara Mchedlide · Algorithmen zur Visualisierung von Graphen Layered Layout13 - 1

Integer Linear Programming

Properties:• branch-and-cut technique for DAGS of limited size• useful for graphs of small to medium size• finds optimal solution• solution in polynomial time is not guaranteed

Page 28: Part 2 Algorithms for Graph Visualization - KIT - ITI Algorithmik I - … · 2018-01-11 · Dr. Tamara Mchedlide Algorithmen zur Visualisierung von Graphen Layered Layout 1 Tamara

Dr. Tamara Mchedlide · Algorithmen zur Visualisierung von Graphen Layered Layout13 - 2

Integer Linear Programming

Properties:• branch-and-cut technique for DAGS of limited size• useful for graphs of small to medium size• finds optimal solution• solution in polynomial time is not guaranteed

Modell: see Blackboard

Page 29: Part 2 Algorithms for Graph Visualization - KIT - ITI Algorithmik I - … · 2018-01-11 · Dr. Tamara Mchedlide Algorithmen zur Visualisierung von Graphen Layered Layout 1 Tamara

Dr. Tamara Mchedlide · Algorithmen zur Visualisierung von Graphen Layered Layout14

Experimental Evaluation (Junger, Mutzel 1997)

Results for 100 instances on 20 + 20nodes with increasing density

Time for 100 instances on 20 +20 nodes with increasing density

Page 30: Part 2 Algorithms for Graph Visualization - KIT - ITI Algorithmik I - … · 2018-01-11 · Dr. Tamara Mchedlide Algorithmen zur Visualisierung von Graphen Layered Layout 1 Tamara

Dr. Tamara Mchedlide · Algorithmen zur Visualisierung von Graphen Layered Layout15

Experimental Evaluation (Junger, Mutzel 1997)

Results for 10 instances of sparsegraphs with increasing size

Time for 10 instances of sparsegraphs with increasing size

Page 31: Part 2 Algorithms for Graph Visualization - KIT - ITI Algorithmik I - … · 2018-01-11 · Dr. Tamara Mchedlide Algorithmen zur Visualisierung von Graphen Layered Layout 1 Tamara

Dr. Tamara Mchedlide · Algorithmen zur Visualisierung von Graphen Layered Layout16 - 1

Example

Page 32: Part 2 Algorithms for Graph Visualization - KIT - ITI Algorithmik I - … · 2018-01-11 · Dr. Tamara Mchedlide Algorithmen zur Visualisierung von Graphen Layered Layout 1 Tamara

Dr. Tamara Mchedlide · Algorithmen zur Visualisierung von Graphen Layered Layout16 - 2

Example

Page 33: Part 2 Algorithms for Graph Visualization - KIT - ITI Algorithmik I - … · 2018-01-11 · Dr. Tamara Mchedlide Algorithmen zur Visualisierung von Graphen Layered Layout 1 Tamara

Dr. Tamara Mchedlide · Algorithmen zur Visualisierung von Graphen Layered Layout16 - 3

Example

Page 34: Part 2 Algorithms for Graph Visualization - KIT - ITI Algorithmik I - … · 2018-01-11 · Dr. Tamara Mchedlide Algorithmen zur Visualisierung von Graphen Layered Layout 1 Tamara

Dr. Tamara Mchedlide · Algorithmen zur Visualisierung von Graphen Layered Layout16 - 4

Example

Page 35: Part 2 Algorithms for Graph Visualization - KIT - ITI Algorithmik I - … · 2018-01-11 · Dr. Tamara Mchedlide Algorithmen zur Visualisierung von Graphen Layered Layout 1 Tamara

Dr. Tamara Mchedlide · Algorithmen zur Visualisierung von Graphen Layered Layout16 - 5

Example

Page 36: Part 2 Algorithms for Graph Visualization - KIT - ITI Algorithmik I - … · 2018-01-11 · Dr. Tamara Mchedlide Algorithmen zur Visualisierung von Graphen Layered Layout 1 Tamara

Dr. Tamara Mchedlide · Algorithmen zur Visualisierung von Graphen Layered Layout16 - 6

Example

Page 37: Part 2 Algorithms for Graph Visualization - KIT - ITI Algorithmik I - … · 2018-01-11 · Dr. Tamara Mchedlide Algorithmen zur Visualisierung von Graphen Layered Layout 1 Tamara

Dr. Tamara Mchedlide · Algorithmen zur Visualisierung von Graphen Layered Layout16 - 7

Example

Page 38: Part 2 Algorithms for Graph Visualization - KIT - ITI Algorithmik I - … · 2018-01-11 · Dr. Tamara Mchedlide Algorithmen zur Visualisierung von Graphen Layered Layout 1 Tamara

Dr. Tamara Mchedlide · Algorithmen zur Visualisierung von Graphen Layered Layout16 - 8

Example

Page 39: Part 2 Algorithms for Graph Visualization - KIT - ITI Algorithmik I - … · 2018-01-11 · Dr. Tamara Mchedlide Algorithmen zur Visualisierung von Graphen Layered Layout 1 Tamara

Dr. Tamara Mchedlide · Algorithmen zur Visualisierung von Graphen Layered Layout16 - 9

Example

Page 40: Part 2 Algorithms for Graph Visualization - KIT - ITI Algorithmik I - … · 2018-01-11 · Dr. Tamara Mchedlide Algorithmen zur Visualisierung von Graphen Layered Layout 1 Tamara

Dr. Tamara Mchedlide · Algorithmen zur Visualisierung von Graphen Layered Layout17

CrossingX

There was even aniPad gameCrossingX for theOSCM Problem!Winner of Graph Drawing Game Contest 2012

Page 41: Part 2 Algorithms for Graph Visualization - KIT - ITI Algorithmik I - … · 2018-01-11 · Dr. Tamara Mchedlide Algorithmen zur Visualisierung von Graphen Layered Layout 1 Tamara

Dr. Tamara Mchedlide · Algorithmen zur Visualisierung von Graphen Layered Layout18

Step 4: Coordinate Computation

Which could be the goals?

Page 42: Part 2 Algorithms for Graph Visualization - KIT - ITI Algorithmik I - … · 2018-01-11 · Dr. Tamara Mchedlide Algorithmen zur Visualisierung von Graphen Layered Layout 1 Tamara

Dr. Tamara Mchedlide · Algorithmen zur Visualisierung von Graphen Layered Layout19 - 1

Steightening Edges

Goal:minimize deviation from a straight-line for the edges withdummy-nodes

Idea: use quadratic Program• let puv = (u, d1, . . . , dk, v) path with k dummy nodes betwen u and v• let ai = x(u) + i

k+1 (x(v)− x(u)) the x-coordinate of di when (u, v)is straight• g(puv) =

∑ki=1(x(di)− ai)2

• minimize∑

uv∈E g(puv)• constraints: x(w)− x(z) ≥ δ for consecutive nodes on the same layer,w right from z (δ distance parameter)

Page 43: Part 2 Algorithms for Graph Visualization - KIT - ITI Algorithmik I - … · 2018-01-11 · Dr. Tamara Mchedlide Algorithmen zur Visualisierung von Graphen Layered Layout 1 Tamara

Dr. Tamara Mchedlide · Algorithmen zur Visualisierung von Graphen Layered Layout19 - 2

Steightening Edges

Goal:minimize deviation from a straight-line for the edges withdummy-nodes

Idea: use quadratic Program• let puv = (u, d1, . . . , dk, v) path with k dummy nodes betwen u and v• let ai = x(u) + i

k+1 (x(v)− x(u)) the x-coordinate of di when (u, v)is straight• g(puv) =

∑ki=1(x(di)− ai)2

• minimize∑

uv∈E g(puv)• constraints: x(w)− x(z) ≥ δ for consecutive nodes on the same layer,w right from z (δ distance parameter)

Properties:• quadratic program is time-expensive• width can be exponential• optimization function can be adapted to optimize ”verticality”

Page 44: Part 2 Algorithms for Graph Visualization - KIT - ITI Algorithmik I - … · 2018-01-11 · Dr. Tamara Mchedlide Algorithmen zur Visualisierung von Graphen Layered Layout 1 Tamara

Dr. Tamara Mchedlide · Algorithmen zur Visualisierung von Graphen Layered Layout20 - 1

Example

Page 45: Part 2 Algorithms for Graph Visualization - KIT - ITI Algorithmik I - … · 2018-01-11 · Dr. Tamara Mchedlide Algorithmen zur Visualisierung von Graphen Layered Layout 1 Tamara

Dr. Tamara Mchedlide · Algorithmen zur Visualisierung von Graphen Layered Layout20 - 2

Example

Page 46: Part 2 Algorithms for Graph Visualization - KIT - ITI Algorithmik I - … · 2018-01-11 · Dr. Tamara Mchedlide Algorithmen zur Visualisierung von Graphen Layered Layout 1 Tamara

Dr. Tamara Mchedlide · Algorithmen zur Visualisierung von Graphen Layered Layout21

Step 5: Drawing edges

Possibility: Substitute polylines by Bezier curves

Page 47: Part 2 Algorithms for Graph Visualization - KIT - ITI Algorithmik I - … · 2018-01-11 · Dr. Tamara Mchedlide Algorithmen zur Visualisierung von Graphen Layered Layout 1 Tamara

Dr. Tamara Mchedlide · Algorithmen zur Visualisierung von Graphen Layered Layout22 - 1

Example

Page 48: Part 2 Algorithms for Graph Visualization - KIT - ITI Algorithmik I - … · 2018-01-11 · Dr. Tamara Mchedlide Algorithmen zur Visualisierung von Graphen Layered Layout 1 Tamara

Dr. Tamara Mchedlide · Algorithmen zur Visualisierung von Graphen Layered Layout22 - 2

Example

Page 49: Part 2 Algorithms for Graph Visualization - KIT - ITI Algorithmik I - … · 2018-01-11 · Dr. Tamara Mchedlide Algorithmen zur Visualisierung von Graphen Layered Layout 1 Tamara

Dr. Tamara Mchedlide · Algorithmen zur Visualisierung von Graphen Layered Layout22 - 3

Example

Page 50: Part 2 Algorithms for Graph Visualization - KIT - ITI Algorithmik I - … · 2018-01-11 · Dr. Tamara Mchedlide Algorithmen zur Visualisierung von Graphen Layered Layout 1 Tamara

Dr. Tamara Mchedlide · Algorithmen zur Visualisierung von Graphen Layered Layout23 - 1

Summary

given resolve cycles layerassignement

crossing minimization node positioning edge drawing

Page 51: Part 2 Algorithms for Graph Visualization - KIT - ITI Algorithmik I - … · 2018-01-11 · Dr. Tamara Mchedlide Algorithmen zur Visualisierung von Graphen Layered Layout 1 Tamara

Dr. Tamara Mchedlide · Algorithmen zur Visualisierung von Graphen Layered Layout23 - 2

Summary

given resolve cycles layerassignement

crossing minimization node positioning edge drawing

• flexible Framework to draw directed graphs• sequential optimization of various criteria• modelling gives NP-hard problems, which can

still can be solved quite well

Page 52: Part 2 Algorithms for Graph Visualization - KIT - ITI Algorithmik I - … · 2018-01-11 · Dr. Tamara Mchedlide Algorithmen zur Visualisierung von Graphen Layered Layout 1 Tamara

Dr. Tamara Mchedlide · Algorithmen zur Visualisierung von Graphen Layered Layout24 - 1

Practical Task

• Graph Drawing Contest holding at Graph Drawingconference each September

• Game of Thrones graph:http://www.graphdrawing.de/contest2018/topics.html

• Create nice, readable, suitable for potential tasksvisualization

• Use any software/library you like

• think about processing the graph: clustering, findinginteresting patterns

• work in groups of 2-3

• submit your visualization by 28/2/2018

Page 53: Part 2 Algorithms for Graph Visualization - KIT - ITI Algorithmik I - … · 2018-01-11 · Dr. Tamara Mchedlide Algorithmen zur Visualisierung von Graphen Layered Layout 1 Tamara

Dr. Tamara Mchedlide · Algorithmen zur Visualisierung von Graphen Layered Layout24 - 2

Practical Task

• Graph Drawing Contest holding at Graph Drawingconference each September

• Game of Thrones graph:http://www.graphdrawing.de/contest2018/topics.html

• Create nice, readable, suitable for potential tasksvisualization

• Use any software/library you like

• think about processing the graph: clustering, findinginteresting patterns

• work in groups of 2-3

• submit your visualization by 28/2/2018

Page 54: Part 2 Algorithms for Graph Visualization - KIT - ITI Algorithmik I - … · 2018-01-11 · Dr. Tamara Mchedlide Algorithmen zur Visualisierung von Graphen Layered Layout 1 Tamara

Dr. Tamara Mchedlide · Algorithmen zur Visualisierung von Graphen Layered Layout24 - 3

Practical Task

• Graph Drawing Contest holding at Graph Drawingconference each September

• Game of Thrones graph:http://www.graphdrawing.de/contest2018/topics.html

• Create nice, readable, suitable for potential tasksvisualization

• Use any software/library you like

• think about processing the graph: clustering, findinginteresting patterns

• work in groups of 2-3

• submit your visualization by 28/2/2018

Page 55: Part 2 Algorithms for Graph Visualization - KIT - ITI Algorithmik I - … · 2018-01-11 · Dr. Tamara Mchedlide Algorithmen zur Visualisierung von Graphen Layered Layout 1 Tamara

Dr. Tamara Mchedlide · Algorithmen zur Visualisierung von Graphen Layered Layout24 - 4

Practical Task

• Graph Drawing Contest holding at Graph Drawingconference each September

• Game of Thrones graph:http://www.graphdrawing.de/contest2018/topics.html

• Create nice, readable, suitable for potential tasksvisualization

• Use any software/library you like

• think about processing the graph: clustering, findinginteresting patterns

• work in groups of 2-3

• submit your visualization by 28/2/2018

Page 56: Part 2 Algorithms for Graph Visualization - KIT - ITI Algorithmik I - … · 2018-01-11 · Dr. Tamara Mchedlide Algorithmen zur Visualisierung von Graphen Layered Layout 1 Tamara

Dr. Tamara Mchedlide · Algorithmen zur Visualisierung von Graphen Layered Layout24 - 5

Practical Task

• Graph Drawing Contest holding at Graph Drawingconference each September

• Game of Thrones graph:http://www.graphdrawing.de/contest2018/topics.html

• Create nice, readable, suitable for potential tasksvisualization

• Use any software/library you like

• think about processing the graph: clustering, findinginteresting patterns

• work in groups of 2-3

• submit your visualization by 28/2/2018

Page 57: Part 2 Algorithms for Graph Visualization - KIT - ITI Algorithmik I - … · 2018-01-11 · Dr. Tamara Mchedlide Algorithmen zur Visualisierung von Graphen Layered Layout 1 Tamara

Dr. Tamara Mchedlide · Algorithmen zur Visualisierung von Graphen Layered Layout24 - 6

Practical Task

• Graph Drawing Contest holding at Graph Drawingconference each September

• Game of Thrones graph:http://www.graphdrawing.de/contest2018/topics.html

• Create nice, readable, suitable for potential tasksvisualization

• Use any software/library you like

• think about processing the graph: clustering, findinginteresting patterns

• work in groups of 2-3

• submit your visualization by 28/2/2018

Page 58: Part 2 Algorithms for Graph Visualization - KIT - ITI Algorithmik I - … · 2018-01-11 · Dr. Tamara Mchedlide Algorithmen zur Visualisierung von Graphen Layered Layout 1 Tamara

Dr. Tamara Mchedlide · Algorithmen zur Visualisierung von Graphen Layered Layout24 - 7

Practical Task

• Graph Drawing Contest holding at Graph Drawingconference each September

• Game of Thrones graph:http://www.graphdrawing.de/contest2018/topics.html

• Create nice, readable, suitable for potential tasksvisualization

• Use any software/library you like

• think about processing the graph: clustering, findinginteresting patterns

• work in groups of 2-3

• submit your visualization by 28/2/2018