for Graph Visualization Flow Methods: Orthogonal Layout

INSTITUT FUR¨ THEORETISCHE INFORMATIK · FAKULTAT¨ FUR¨ INFORMATIK

Tamara Mchedlidze 18.01.2018

1 Dr. Tamara Mchedlidze · Algorithmen zur Visualisierung von Graphen Flussmethoden: orthogonales Graphenzeichnen Orthogonal Layout • Edges consist of vertical and horizontal segments • Applied in many areas ER diagram in OGDF UML diagram by Oracle Organigram of HS Limburg Circuit diagram by Jeff Atwood

2 - 1 Dr. Tamara Mchedlidze · Algorithmen zur Visualisierung von Graphen Flussmethoden: orthogonales Graphenzeichnen Orthogonal Layout • Edges consist of vertical and horizontal segments • Applied in many areas

Aesthetic functions? ER diagram in OGDF UML diagram by Oracle Organigram of HS Limburg Circuit diagram by Jeff Atwood

2 - 2 Dr. Tamara Mchedlidze · Algorithmen zur Visualisierung von Graphen Flussmethoden: orthogonales Graphenzeichnen Orthogonal Layout • Edges consist of vertical and horizontal segments • Applied in many areas

Aesthetic functions: • number of bends • length of edges •

ER diagram in OGDF width, height, • monotonicity of edges UML diagram by Oracle • ... Organigram of HS Limburg Circuit diagram by Jeff Atwood

2 - 3 Dr. Tamara Mchedlidze · Algorithmen zur Visualisierung von Graphen Flussmethoden: orthogonales Graphenzeichnen (Planar) Orthogonal Drawings

Three-step approach: Topology – Shape – Metrics [Tamassia SIAM J. Comput. 1987]

V = {v1, v2, v3, v4} E = {v1v2, v1v3, v1v4, v2v3, v2v4}

3 - 1 Dr. Tamara Mchedlidze · Algorithmen zur Visualisierung von Graphen Flussmethoden: orthogonales Graphenzeichnen (Planar) Orthogonal Drawings

Three-step approach: Topology – Shape – Metrics [Tamassia SIAM J. Comput. 1987]

V = {v1, v2, v3, v4} E = {v1v2, v1v3, v1v4, v2v3, v2v4} combinatorial embedding/ planarization 4 3

Reduce Crossings 2 1

3 - 2 Dr. Tamara Mchedlidze · Algorithmen zur Visualisierung von Graphen Flussmethoden: orthogonales Graphenzeichnen (Planar) Orthogonal Drawings

Three-step approach: Topology – Shape – Metrics [Tamassia SIAM J. Comput. 1987]

V = {v1, v2, v3, v4} E = {v1v2, v1v3, v1v4, v2v3, v2v4} combinatorial embedding/ planarization 4 4 3 Bend Minimization Reduce Crossings 1 3 2 orthogonal 1 representation 2

3 - 3 Dr. Tamara Mchedlidze · Algorithmen zur Visualisierung von Graphen Flussmethoden: orthogonales Graphenzeichnen (Planar) Orthogonal Drawings

Three-step approach: Topology – Shape – Metrics [Tamassia SIAM J. Comput. 1987]

4 V = {v1, v2, v3, v4} 3 E = {v1v2, v1v3, v1v4, v2v3, v2v4} 1 combinatorial 2 embedding/ planar planarization Area- orthogonal minimization 4 drawing 4 3 Bend Minimization Reduce Crossings 1 3 2 orthogonal 1 representation 2

3 - 4 Dr. Tamara Mchedlidze · Algorithmen zur Visualisierung von Graphen Flussmethoden: orthogonales Graphenzeichnen (Planar) Orthogonal Drawings

Three-step approach: Topology – Shape – Metrics [Tamassia SIAM J. Comput. 1987]

4 V = {v1, v2, v3, v4} 3 E = {v1v2, v1v3, v1v4, v2v3, v2v4} 1 combinatorial 2 embedding/ planar planarization Area- orthogonal minimization 4 drawing 4 3 Bend Minimization Reduce Crossings 1 3 2 orthogonal 1 representation 2

3 - 5 Dr. Tamara Mchedlidze · Algorithmen zur Visualisierung von Graphen Flussmethoden: orthogonales Graphenzeichnen Orthogonal Representation Given: G = (V,E), set of faces F, outer face f0 Find: orthogonale representation H(G) = {H(f) | f ∈ F}

Face representation H(f): of f is a clockwise* ordered sequence of edge descriptions (e, δ, α) with • e edge of f • δ is sequence of {0, 1}∗ (0 = right bend, 1 = left bend) • π 3π 0 α is angle ∈ { 2 , π, 2 , 2π} between e and next edge e

4 Dr. Tamara Mchedlidze · Algorithmen zur Visualisierung von Graphen Flussmethoden: orthogonales Graphenzeichnen Orthogonal Representation: Example

π 3π π H(f0) = ((e1, 11, 2 ), (e5, 111, 2 ), (e4, ∅, π), (e3, ∅, π), (e2, ∅, 2 )) 3π π H(f1) = ((e1, 00, 2 ), (e2, ∅, 2 ), (e6, 00, π)) π π π H(f2) = ((e5, 000, 2 ), (e6, 11, 2 ), (e3, ∅, π), (e4, ∅, 2 ))

e3 f e2 0 Combinatorial “drawing” of H(G)? f1 f2 e4 e6 e1 e5

5 - 1 Dr. Tamara Mchedlidze · Algorithmen zur Visualisierung von Graphen Flussmethoden: orthogonales Graphenzeichnen Orthogonal Representation: Example

π 3π π H(f0) = ((e1, 11, 2 ), (e5, 111, 2 ), (e4, ∅, π), (e3, ∅, π), (e2, ∅, 2 )) 3π π H(f1) = ((e1, 00, 2 ), (e2, ∅, 2 ), (e6, 00, π)) π π π H(f2) = ((e5, 000, 2 ), (e6, 11, 2 ), (e3, ∅, π), (e4, ∅, 2 ))

1 e1 1 f0 0 0 1 e2 e3 e4 e e 3 0 f0 2 0 f1 0 f1 f2 e4 e 1 f2 e6 1 6 e1 0 0 e5 1 e5 1

5 - 2 Dr. Tamara Mchedlidze · Algorithmen zur Visualisierung von Graphen Flussmethoden: orthogonales Graphenzeichnen Orthogonal Representation: Example

π 3π π H(f0) = ((e1, 11, 2 ), (e5, 111, 2 ), (e4, ∅, π), (e3, ∅, π), (e2, ∅, 2 )) H(f ) = ((e , 00, 3π ), (e , ∅, π ), (e , 00, π)) 1 1 2 2 2 6 is f0 listed wrongly!? π π π H(f2) = ((e5, 000, 2 ), (e6, 11, 2 ), (e3, ∅, π), (e4, ∅, 2 ))

1 e1 1 f0 0 0 1 e2 e3 e4 e e 3 0 f0 2 0 f1 0 f1 f2 e4 e 1 f2 e6 1 6 e1 0 0 e5 1 e5 1

5 - 3 Dr. Tamara Mchedlidze · Algorithmen zur Visualisierung von Graphen Flussmethoden: orthogonales Graphenzeichnen Orthogonal Representation: Example

π 3π π H(f0) = ((e1, 11, 2 ), (e5, 111, 2 ), (e4, ∅, π), (e3, ∅, π), (e2, ∅, 2 )) 3π π H(f1) = ((e1, 00, 2 ), (e2, ∅, 2 ), (e6, 00, π)) π π π H(f2) = ((e5, 000, 2 ), (e6, 11, 2 ), (e3, ∅, π), (e4, ∅, 2 ))

1 e1 1 f0 0 0 π π e2 e3 π e4 3π 1 2 π 3π 2 π e3 π π π π π 2 e 0 2 2 2 2 2 f0 2 0 f1 0 f1 f2 e4 e 1 f2 e6 1 6 e1 0 0 e5 1 e5 1

5 - 4 Dr. Tamara Mchedlidze · Algorithmen zur Visualisierung von Graphen Flussmethoden: orthogonales Graphenzeichnen Orthogonal Representation: Example

π 3π π H(f0) = ((e1, 11, 2 ), (e5, 111, 2 ), (e4, ∅, π), (e3, ∅, π), (e2, ∅, 2 )) 3π π H(f1) = ((e1, 00, 2 ), (e2, ∅, 2 ), (e6, 00, π)) π π π H(f2) = ((e5, 000, 2 ), (e6, 11, 2 ), (e3, ∅, π), (e4, ∅, 2 ))

1 e1 1 f0 π 0 0 2 π π π e2 e3 π e4 3π 1 0 3π 2 π e3 2 π π π π 2 e 2 2 2 2 f0 2 f1 f1 f2 e4 0 0 f2 e6 1 e6 1 e1 0 0 e5 1 e5 1

5 - 5 Dr. Tamara Mchedlidze · Algorithmen zur Visualisierung von Graphen Flussmethoden: orthogonales Graphenzeichnen Orthogonal Representation: Example

π 3π π H(f0) = ((e1, 11, 2 ), (e5, 111, 2 ), (e4, ∅, π), (e3, ∅, π), (e2, ∅, 2 )) 3π π H(f1) = ((e1, 00, 2 ), (e2, ∅, 2 ), (e6, 00, π)) π π π H(f2) = ((e5, 000, 2 ), (e6, 11, 2 ), (e3, ∅, π), (e4, ∅, 2 ))

1 e1 1 f0 π 0 0 2 π π π e2 e3 π e4 3π 1 0 3π 2 π e3 2 π π π π 2 e 2 2 2 2 f0 2 f1 f1 f2 e4 0 0 f2 e6 1 e6 1 e1 0 0 e5 1 e5 1

concrete coordinates are not fixed yet!

5 - 6 Dr. Tamara Mchedlidze · Algorithmen zur Visualisierung von Graphen Flussmethoden: orthogonales Graphenzeichnen Correctness of an Orthogonal Representation

(H1) H(G) corresponds to F, f0

6 - 1 Dr. Tamara Mchedlidze · Algorithmen zur Visualisierung von Graphen Flussmethoden: orthogonales Graphenzeichnen Correctness of an Orthogonal Representation

(H1) H(G) corresponds to F, f0 (H2) for an edge {u, v} shared by faces f and g with ((u, v), δ1, α1) ∈ H(f) and ((v, u), δ2, α2) ∈ H(g) sequence δ1 is reverced and inverted δ2

6 - 2 Dr. Tamara Mchedlidze · Algorithmen zur Visualisierung von Graphen Flussmethoden: orthogonales Graphenzeichnen Correctness of an Orthogonal Representation

(H1) H(G) corresponds to F, f0 (H2) for an edge {u, v} shared by faces f and g with ((u, v), δ1, α1) ∈ H(f) and ((v, u), δ2, α2) ∈ H(g) sequence δ1 is reverced and inverted δ2

(H3) Let |δ|0 (resp. |δ|1) be the number of zeros (resp. ones) in δ and r = (e, δ, α). For C(r) := |δ|0 − |δ|1 + 2 − 2α/π holds X X that: C(r) = 4 for f 6= f0 and C(r) = −4

r∈H(f) r∈H(f0)

6 - 3 Dr. Tamara Mchedlidze · Algorithmen zur Visualisierung von Graphen Flussmethoden: orthogonales Graphenzeichnen Correctness of an Orthogonal Representation

(H1) H(G) corresponds to F, f0 (H2) for an edge {u, v} shared by faces f and g with ((u, v), δ1, α1) ∈ H(f) and ((v, u), δ2, α2) ∈ H(g) sequence δ1 is reverced and inverted δ2

(H3) Let |δ|0 (resp. |δ|1) be the number of zeros (resp. ones) in δ and r = (e, δ, α). For C(r) := |δ|0 − |δ|1 + 2 − 2α/π holds X X that: C(r) = 4 for f 6= f0 and C(r) = −4

r∈H(f) r∈H(f0) (H4) For each node v the summ of incident angles is 2π

6 - 4 Dr. Tamara Mchedlidze · Algorithmen zur Visualisierung von Graphen Flussmethoden: orthogonales Graphenzeichnen Correctness of an Orthogonal Representation

(H1) H(G) corresponds to F, f0 (H2) for an edge {u, v} shared by faces f and g with ((u, v), δ1, α1) ∈ H(f) and ((v, u), δ2, α2) ∈ H(g) sequence δ1 is reverced and inverted δ2

(H3) Let |δ|0 (resp. |δ|1) be the number of zeros (resp. ones) in δ and r = (e, δ, α). For C(r) := |δ|0 − |δ|1 + 2 − 2α/π holds X X that: C(r) = 4 for f 6= f0 and C(r) = −4

r∈H(f) r∈H(f0) (H4) For each node v the summ of incident angles is 2π

Pair, think and share: 5 min What does the condition (H3) mean intuitively?

6 - 5 Dr. Tamara Mchedlidze · Algorithmen zur Visualisierung von Graphen Flussmethoden: orthogonales Graphenzeichnen Bend Minization with Given Embedding Problem: Geometric Bend Minimization Given: • planar Graph G = (V,E) with maximum degree 4 • combinatorial embedding F and outer face f0 Find: orthogonal drawing with minimum number of bends that preserves the embedding

7 - 1 Dr. Tamara Mchedlidze · Algorithmen zur Visualisierung von Graphen Flussmethoden: orthogonales Graphenzeichnen Bend Minization with Given Embedding Problem: Geometric Bend Minimization Given: • planar Graph G = (V,E) with maximum degree 4 • combinatorial embedding F and outer face f0 Find: orthogonal drawing with minimum number of bends that preserves the embedding

compare with the following variation

Problem Combinatorial Bend Minimization Given: • planar Graph G = (V,E) with maximum degree 4 • combinatorial embedding F and outer face f0 Find: orthogonal representation H(G) with minimum number of bends that preserves the embedding

7 - 2 Dr. Tamara Mchedlidze · Algorithmen zur Visualisierung von Graphen Flussmethoden: orthogonales Graphenzeichnen Combinatorial Bend Minimization Problem Combinatorial Bend Minimization Given: • Graph G = (V,E) with maximum degree 4 • combinatorial embedding F and outer face f0 Find: orthogonal representation H(G) with minimum number of bends that preserves the embedding

8 - 1 Dr. Tamara Mchedlidze · Algorithmen zur Visualisierung von Graphen Flussmethoden: orthogonales Graphenzeichnen Combinatorial Bend Minimization Problem Combinatorial Bend Minimization Given: • Graph G = (V,E) with maximum degree 4 • combinatorial embedding F and outer face f0 Find: orthogonal representation H(G) with minimum number of bends that preserves the embedding

Idea: formulate as a network flow problem • a unit of flow represents an angle π/2 • flow from vertices to faces represents the angles at the vertices • flow between adjacent faces represent the bends at the edges

8 - 2 Dr. Tamara Mchedlidze · Algorithmen zur Visualisierung von Graphen Flussmethoden: orthogonales Graphenzeichnen Reminder: s-t Flow Network Flow network (D = (V,A); s, t; c) with • directed graph D = (V,A) • + Edge capacity c : A → R0 • Source s ∈ V , Sink t ∈ V

+ A function X : A → R0 is called s-t-flow, if: 0 ≤ X(u, v) ≤ c(u, v) ∀(u, v) ∈ A (1) X X X(u, v) − X(v, u) = 0 ∀u ∈ V \{s, t} (2) (u,v)∈A (v,u)∈A

9 Dr. Tamara Mchedlidze · Algorithmen zur Visualisierung von Graphen Flussmethoden: orthogonales Graphenzeichnen Reminder: General Flow Network Flow network (D = (V,A); `; u; b) with • directed graph D = (V,A) • + edge lower bound ` : A → R0 • + edge capacity c : A → R0 • node production/consumption b : V → R with P i∈V b(i) = 0

+ An assignement X : A → R0 is called valid flow, if: `(u, v) ≤ X(u, v) ≤ c(u, v) ∀(u, v) ∈ A (3) X X X(u, v) − X(v, u) = b(u) ∀u ∈ V (4) (u,v)∈A (v,u)∈A

10 Dr. Tamara Mchedlidze · Algorithmen zur Visualisierung von Graphen Flussmethoden: orthogonales Graphenzeichnen Problems for Flow Networks (A) Valid Flow: + Find a Valid Flow X : A → R0 , such that. • Lower bounds and capacities `(e), u(e) are respected (inequalities (3)) • Consumption/production is b(v) satisfied (inequality (4))

11 - 1 Dr. Tamara Mchedlidze · Algorithmen zur Visualisierung von Graphen Flussmethoden: orthogonales Graphenzeichnen Problems for Flow Networks (A) Valid Flow: + Find a Valid Flow X : A → R0 , such that. • Lower bounds and capacities `(e), u(e) are respected (inequalities (3)) • Consumption/production is b(v) satisfied (inequality (4))

+ Additionally provided: Cost function cost : A → R0 P Def: cost(X) := (u,v)∈A cost(u, v) · X(u, v)

11 - 2 Dr. Tamara Mchedlidze · Algorithmen zur Visualisierung von Graphen Flussmethoden: orthogonales Graphenzeichnen Problems for Flow Networks (A) Valid Flow: + Find a Valid Flow X : A → R0 , such that. • Lower bounds and capacities `(e), u(e) are respected (inequalities (3)) • Consumption/production is b(v) satisfied (inequality (4))

+ Additionally provided: Cost function cost : A → R0 P Def: cost(X) := (u,v)∈A cost(u, v) · X(u, v) (B) Miminum Cost Flow + Find a valid flow X : A → R0 , that minimizes cost function cost(X) (over all valid flows)

11 - 3 Dr. Tamara Mchedlidze · Algorithmen zur Visualisierung von Graphen Flussmethoden: orthogonales Graphenzeichnen Flow Network for Bend Minimization Flow Network N(G) = ((V ∪ F,A); `; c; b; cost) • A = {(v, f) ∈ V × F | v incident tof} ∪ A = {(f, g) ∈ F × F | f, g adjacent through edge e}

12 - 1 Dr. Tamara Mchedlidze · Algorithmen zur Visualisierung von Graphen Flussmethoden: orthogonales Graphenzeichnen Flow Network for Bend Minimization Flow Network N(G) = ((V ∪ F,A); `; c; b; cost) • A = {(v, f) ∈ V × F | v incident tof} ∪ A = {(f, g) ∈ F × F | f, g adjacent through edge e} • b(v) = 4 ∀v ∈ V

12 - 2 Dr. Tamara Mchedlidze · Algorithmen zur Visualisierung von Graphen Flussmethoden: orthogonales Graphenzeichnen Flow Network for Bend Minimization Flow Network N(G) = ((V ∪ F,A); `; c; b; cost) • A = {(v, f) ∈ V × F | v incident tof} ∪ A = {(f, g) ∈ F × F | f, g adjacent through edge e} • b(v) = 4 ∀v ∈ V

• b(f) = −2(dG(f) − 2) ∀f ∈ F \ {f0} • b(f0) = −2(dG(f0) + 2)

12 - 3 Dr. Tamara Mchedlidze · Algorithmen zur Visualisierung von Graphen Flussmethoden: orthogonales Graphenzeichnen Flow Network for Bend Minimization Flow Network N(G) = ((V ∪ F,A); `; c; b; cost) • A = {(v, f) ∈ V × F | v incident tof} ∪ A = {(f, g) ∈ F × F | f, g adjacent through edge e} • b(v) = 4 ∀v ∈ V   • P ? b(f) = −2(dG(f) − 2) ∀f ∈ F \ {f0} ⇒ w b(w) = 0 • b(f0) = −2(dG(f0) + 2) 

12 - 4 Dr. Tamara Mchedlidze · Algorithmen zur Visualisierung von Graphen Flussmethoden: orthogonales Graphenzeichnen Flow Network for Bend Minimization Flow Network N(G) = ((V ∪ F,A); `; c; b; cost) • A = {(v, f) ∈ V × F | v incident tof} ∪ A = {(f, g) ∈ F × F | f, g adjacent through edge e} • b(v) = 4 ∀v ∈ V   • P b(f) = −2(dG(f) − 2) ∀f ∈ F \ {f0} ⇒ w b(w) = 0 (Euler) • b(f0) = −2(dG(f0) + 2) 

12 - 5 Dr. Tamara Mchedlidze · Algorithmen zur Visualisierung von Graphen Flussmethoden: orthogonales Graphenzeichnen Flow Network for Bend Minimization Flow Network N(G) = ((V ∪ F,A); `; c; b; cost) • A = {(v, f) ∈ V × F | v incident tof} ∪ A = {(f, g) ∈ F × F | f, g adjacent through edge e} • b(v) = 4 ∀v ∈ V   • P b(f) = −2(dG(f) − 2) ∀f ∈ F \ {f0} ⇒ w b(w) = 0 (Euler) • b(f0) = −2(dG(f0) + 2) 

∀(f, g) ∈ A, f, g ∈ F `(f, g) := 0 ≤ X(f, g) ≤ ∞ =: c(f, g) cost(f, g) = 1 ∀(v, f) ∈ A, v ∈ V, f ∈ F `(v, f) := 1 ≤ X(v, f) ≤ 4 =: c(v, f) cost(v, f) = 0

12 - 6 Dr. Tamara Mchedlidze · Algorithmen zur Visualisierung von Graphen Flussmethoden: orthogonales Graphenzeichnen Example Flow Network

f0 v 2 e3 v3 e2

f1 f2

v1 e4 e6

e1 v v5 e5 4

13 - 1 Dr. Tamara Mchedlidze · Algorithmen zur Visualisierung von Graphen Flussmethoden: orthogonales Graphenzeichnen Example Flow Network

f0 v 2 e3 v3 e2

f1 f2

v1 e4 e6

e1 v v5 e5 4

V F

13 - 2 Dr. Tamara Mchedlidze · Algorithmen zur Visualisierung von Graphen Flussmethoden: orthogonales Graphenzeichnen Example Flow Network

f0 v 2 e3 v3 e2

f1 f2

v1 e4 e6

e1 V × F ⊇ v v5 e5 4

V F

13 - 3 Dr. Tamara Mchedlidze · Algorithmen zur Visualisierung von Graphen Flussmethoden: orthogonales Graphenzeichnen Example Flow Network

f0 v 2 e3 v3 e2

f1 f2

v1 e4 e6

e1 V × F ⊇ v v5 e5 4 F × F ⊇ V F

13 - 4 Dr. Tamara Mchedlidze · Algorithmen zur Visualisierung von Graphen Flussmethoden: orthogonales Graphenzeichnen Example Flow Network

f0 -14 v 2 4 e3 v3 e2 4

f1 f2

v1 -4 e4 -2 4 e6

e1 4 V × F ⊇ e v 4 v5 5 4 F × F ⊇ V F

13 - 5 Dr. Tamara Mchedlidze · Algorithmen zur Visualisierung von Graphen Flussmethoden: orthogonales Graphenzeichnen Example Flow Network

f0 -14 v 2 4 e3 v3 e2 4

f1 f2

v1 -4 e4 -2 4 e6 `/u/c 1/4/0 e1 4 V × F ⊇ e v 4 v5 5 4 F × F ⊇ V F

13 - 6 Dr. Tamara Mchedlidze · Algorithmen zur Visualisierung von Graphen Flussmethoden: orthogonales Graphenzeichnen Example Flow Network

f0 -14 v 2 4 e3 v3 e2 4

f1 f2

v1 -4 e4 -2 4 e6 `/u/c 1/4/0 e1 4 V × F ⊇ e v 4 v5 5 4 0/∞/1 F × F ⊇ V F

13 - 7 Dr. Tamara Mchedlidze · Algorithmen zur Visualisierung von Graphen Flussmethoden: orthogonales Graphenzeichnen Example Flow Network

f0 3 -14 v 2 2 4 e3 v3 e2 4 1 1 3 f1 1 f2 1 v1 -4 e4 -2 4 1 e6 1 1 `/u/c 1/4/0 e1 1 4 V × F ⊇ v e5 v4 2 4 5 0/∞/1 3 F × F ⊇ V F

13 - 8 Dr. Tamara Mchedlidze · Algorithmen zur Visualisierung von Graphen Flussmethoden: orthogonales Graphenzeichnen Example Flow Network

cost = 1 f0 3 bend! -14 v 2 2 4 e3 v3 outside e2 4 1 1 3 f1 1 f2 1 v1 -4 e4 4 -2 1 e6 1 1 `/u/c 1/4/0 e1 1 4 V × F ⊇ v e5 v4 2 4 5 0/∞/1 3 F × F ⊇ V F

13 - 9 Dr. Tamara Mchedlidze · Algorithmen zur Visualisierung von Graphen Flussmethoden: orthogonales Graphenzeichnen Main Statement

Thm 1: A planar embedded graph (G, F, f0) has a valid orthogonal description H(G) with k bends iff the flow network N(G) has a valid flow X with cost k.

14 - 1 Dr. Tamara Mchedlidze · Algorithmen zur Visualisierung von Graphen Flussmethoden: orthogonales Graphenzeichnen Main Statement

Thm 1: A planar embedded graph (G, F, f0) has a valid orthogonal description H(G) with k bends iff the flow network N(G) has a valid flow X with cost k.

Proof: ⇐ Given flow X in N(G) with cost k Construct orthogonal representation H(G) with k bends

14 - 2 Dr. Tamara Mchedlidze · Algorithmen zur Visualisierung von Graphen Flussmethoden: orthogonales Graphenzeichnen Main Statement

Thm 1: A planar embedded graph (G, F, f0) has a valid orthogonal description H(G) with k bends iff the flow network N(G) has a valid flow X with cost k.

Proof: ⇐ Given flow X in N(G) with cost k Construct orthogonal representation H(G) with k bends • transform from to orthogonal description • show properties (H1)–(H4)

14 - 3 Dr. Tamara Mchedlidze · Algorithmen zur Visualisierung von Graphen Flussmethoden: orthogonales Graphenzeichnen Main Statement

Thm 1: A planar embedded graph (G, F, f0) has a valid orthogonal description H(G) with k bends iff the flow network N(G) has a valid flow X with cost k.

Proof: ⇐ Given flow X in N(G) with cost k Construct orthogonal representation H(G) with k bends • transform from to orthogonal description • show properties (H1)–(H4) ⇒ Given an orthogonal description H(G) with k bends Construct flow X in N(G) with cost k

14 - 4 Dr. Tamara Mchedlidze · Algorithmen zur Visualisierung von Graphen Flussmethoden: orthogonales Graphenzeichnen Main Statement

Thm 1: A planar embedded graph (G, F, f0) has a valid orthogonal description H(G) with k bends iff the flow network N(G) has a valid flow X with cost k.

Proof: ⇐ Given flow X in N(G) with cost k Construct orthogonal representation H(G) with k bends • transform from to orthogonal description • show properties (H1)–(H4) ⇒ Given an orthogonal description H(G) with k bends Construct flow X in N(G) with cost k • + define assignement X : A → R0 • show that X is a valid flow and has cost k

14 - 5 Dr. Tamara Mchedlidze · Algorithmen zur Visualisierung von Graphen Flussmethoden: orthogonales Graphenzeichnen Summary of Bend Minimization • From Theorem 1 is follows that a combinatorial orthogonal bend minimization problem for embedded planar graphs can be solved using an for Min-Cost-Flow Problem.

15 - 1 Dr. Tamara Mchedlidze · Algorithmen zur Visualisierung von Graphen Flussmethoden: orthogonales Graphenzeichnen Summary of Bend Minimization • From Theorem 1 is follows that a combinatorial orthogonal bend minimization problem for embedded planar graphs can be solved using an algorithm for Min-Cost-Flow Problem. • This special flow problem for planar network N(G) can be slolved in O(n3/2) time. [Cornelsen, Karrenbauer GD 2011]

15 - 2 Dr. Tamara Mchedlidze · Algorithmen zur Visualisierung von Graphen Flussmethoden: orthogonales Graphenzeichnen Summary of Bend Minimization • From Theorem 1 is follows that a combinatorial orthogonal bend minimization problem for embedded planar graphs can be solved using an algorithm for Min-Cost-Flow Problem. • This special flow problem for planar network N(G) can be slolved in O(n3/2) time. [Cornelsen, Karrenbauer GD 2011] • Bend minimization without a given combinatorial embedding is an NP-hard problem. [Garg, Tamassia SIAM J. Comput. 2001]

15 - 3 Dr. Tamara Mchedlidze · Algorithmen zur Visualisierung von Graphen Flussmethoden: orthogonales Graphenzeichnen Summary of Bend Minimization • From Theorem 1 is follows that a combinatorial orthogonal bend minimization problem for embedded planar graphs can be solved using an algorithm for Min-Cost-Flow Problem. • This special flow problem for planar network N(G) can be slolved in O(n3/2) time. [Cornelsen, Karrenbauer GD 2011] • Bend minimization without a given combinatorial embedding is an NP-hard problem. [Garg, Tamassia SIAM J. Comput. 2001]

15 - 4 Dr. Tamara Mchedlidze · Algorithmen zur Visualisierung von Graphen Flussmethoden: orthogonales Graphenzeichnen (Planare) Orthogonale Zeichnungen

Three-step approach: Topology – Shape – Metrics [Tamassia SIAM J. Comput. 1987]

4 V = {v1, v2, v3, v4} 3 E = {v1v2, v1v3, v1v4, v2v3, v2v4} 1 combinatorial 2 embedding/ planar planarization Area- orthogonal minimization 4 drawing 4 3 Bend Minimization Reduce Crossings 1 3 2 orthogonal 1 representation 2

16 - 1 Dr. Tamara Mchedlidze · Algorithmen zur Visualisierung von Graphen Flussmethoden: orthogonales Graphenzeichnen (Planare) Orthogonale Zeichnungen

Three-step approach: Topology – Shape – Metrics [Tamassia SIAM J. Comput. 1987]

4 V = {v1, v2, v3, v4} 3 E = {v1v2, v1v3, v1v4, v2v3, v2v4} 1 combinatorial 2 embedding/ planar planarization Area- orthogonal minimization 4 drawing 4 3 Bend Minimization Reduce Crossings 1 3 2 orthogonal 1 representation 2

16 - 2 Dr. Tamara Mchedlidze · Algorithmen zur Visualisierung von Graphen Flussmethoden: orthogonales Graphenzeichnen Compaction Problem Compaction Given: • planar graph G = (V,E) with maximum degree 4 • orthogonal representation H(G) Find: compact orthogonal layout of G that realizes H(G)

17 - 1 Dr. Tamara Mchedlidze · Algorithmen zur Visualisierung von Graphen Flussmethoden: orthogonales Graphenzeichnen Compaction Problem Compaction Given: • planar graph G = (V,E) with maximum degree 4 • orthogonal representation H(G) Find: compact orthogonal layout of G that realizes H(G)

Special Case: all faces are rectangles → Guaratiees possible • minimum total edge length • minimum area

17 - 2 Dr. Tamara Mchedlidze · Algorithmen zur Visualisierung von Graphen Flussmethoden: orthogonales Graphenzeichnen Compaction Problem Compaction Given: • planar graph G = (V,E) with maximum degree 4 • orthogonal representation H(G) Find: compact orthogonal layout of G that realizes H(G)

Special Case: all faces are rectangles → Guaratiees possible • minimum total edge length • minimum area Properties: • bends only on the outer face • opposite sides of a face have the same length

17 - 3 Dr. Tamara Mchedlidze · Algorithmen zur Visualisierung von Graphen Flussmethoden: orthogonales Graphenzeichnen Compaction Problem Compaction Given: • planar graph G = (V,E) with maximum degree 4 • orthogonal representation H(G) Find: compact orthogonal layout of G that realizes H(G)

Special Case: all faces are rectangles → Guaratiees possible • minimum total edge length • minimum area Properties: • bends only on the outer face • opposite sides of a face have the same length Think for a minute: 1 min Why the two properties hold?

17 - 4 Dr. Tamara Mchedlidze · Algorithmen zur Visualisierung von Graphen Flussmethoden: orthogonales Graphenzeichnen Compaction Problem Compaction Given: • planar graph G = (V,E) with maximum degree 4 • orthogonal representation H(G) Find: compact orthogonal layout of G that realizes H(G)

Special Case: all faces are rectangles → Guaratiees possible • minimum total edge length • minimum area Properties: • bends only on the outer face • opposite sides of a face have the same length We will formulate a flow network for (horizontal) compaction

17 - 5 Dr. Tamara Mchedlidze · Algorithmen zur Visualisierung von Graphen Flussmethoden: orthogonales Graphenzeichnen Flow Network for Edge Length Computation

Def: Flow Network Nhor = ((Whor,Ahor); `; u; b; cost) • Whor = F\{f0} ∪ {s, t} • Ahor = {(f, g) | f, g share a horizontal segment and f lies below g} ∪ {(t, s)} • `(a) = 1 ∀a ∈ Ahor • u(a) = ∞ ∀a ∈ Ahor • cost(a) = 1 ∀a ∈ Ahor • b(f) = 0 ∀f ∈ W t hor

s 18 - 1 Dr. Tamara Mchedlidze · Algorithmen zur Visualisierung von Graphen Flussmethoden: orthogonales Graphenzeichnen Flow Network for Edge Length Computation

Def: Flow Network Nhor = ((Whor,Ahor); `; u; b; cost) • Whor = F\{f0} ∪ {s, t} • Ahor = {(f, g) | f, g share a horizontal segment and f lies below g} ∪ {(t, s)} • `(a) = 1 ∀a ∈ Ahor s and t represent lower and • u(a) = ∞ ∀a ∈ Ahor upper side of f0 • cost(a) = 1 ∀a ∈ Ahor • b(f) = 0 ∀f ∈ W t hor

s 18 - 2 Dr. Tamara Mchedlidze · Algorithmen zur Visualisierung von Graphen Flussmethoden: orthogonales Graphenzeichnen Flow Network for Edge Length Computation

Def: Flow Network Nver = ((Wver,Aver); `; u; b; cost) • Wver = F\{f0} ∪ {s, t} • Aver = {(f, g) | f, g share a vertical segment and f lies to the left of g} ∪ {(t, s)} • `(a) = 1 ∀a ∈ Aver • u(a) = ∞ ∀a ∈ Aver • cost(a) = 1 ∀a ∈ Aver • b(f) = 0 ∀f ∈ Wver

s t

19 - 1 Dr. Tamara Mchedlidze · Algorithmen zur Visualisierung von Graphen Flussmethoden: orthogonales Graphenzeichnen Flow Network for Edge Length Computation

Def: Flow Network Nver = ((Wver,Aver); `; u; b; cost) • Wver = F\{f0} ∪ {s, t} • Aver = {(f, g) | f, g share a vertical segment and f lies to the left of g} ∪ {(t, s)} • `(a) = 1 ∀a ∈ Aver • u(a) = ∞ ∀a ∈ Aver • cost(a) = 1 ∀a ∈ Aver • b(f) = 0 ∀f ∈ Wver

Pair&think&share: 3 min What values of the drawing represent s t the following? • |xhor(t, s)| and |xver(t, s)|? • P x (a) + P x (a) a∈Ahor hor a∈Aver ver

19 - 2 Dr. Tamara Mchedlidze · Algorithmen zur Visualisierung von Graphen Flussmethoden: orthogonales Graphenzeichnen Optimal Layout

Thm 2:Integer flows xhor and xver in Nhor and Nver with minimum cost induce valid orthogonal layout with minumum total edge length. The layout can be computed in O(n3/2)? time.

20 Dr. Tamara Mchedlidze · Algorithmen zur Visualisierung von Graphen Flussmethoden: orthogonales Graphenzeichnen Faster Flow Computation

• ? ? construct the duals Nhor and Nver of Nhor and Nver • ? ? topologial numbering Thor and Tver of Nhor and Nver • for edge (f, g) of Nhor set flow xhor(f, g) = Thor(b) − Thor(a), where b is dual vertex on the left and b is dual vertex on the right of (f, g), similar for xver • easy to see that the constructed assignements xhor, xver have minumun value 21 - 1 Dr. Tamara Mchedlidze · Algorithmen zur Visualisierung von Graphen Flussmethoden: orthogonales Graphenzeichnen Faster Flow Computation

• ? ? construct the duals Nhor and Nver of Nhor and Nver • ? ? topologial numbering Thor and Tver of Nhor and Nver • for edge (f, g) of Nhor set flow xhor(f, g) = Thor(b) − Thor(a), where b is dual vertex on the left and b is dual vertex on the right of (f, g), similar for xver • easy to see that the constructed assignements xhor, xver have minumun value 21 - 2 Dr. Tamara Mchedlidze · Algorithmen zur Visualisierung von Graphen Flussmethoden: orthogonales Graphenzeichnen Faster Flow Computation

• ? ? construct the duals Nhor and Nver of Nhor and Nver • ? ? topologial numbering Thor and Tver of Nhor and Nver • for edge (f, g) of Nhor set flow xhor(f, g) = Thor(b) − Thor(a), where b is dual vertex on the left and b is dual vertex on the right of (f, g), similar for xver • easy to see that the constructed assignements xhor, xver have minumun value 21 - 3 Dr. Tamara Mchedlidze · Algorithmen zur Visualisierung von Graphen Flussmethoden: orthogonales Graphenzeichnen Faster Flow Computation

• ? ? construct the duals Nhor and Nver of Nhor and Nver • ? ? topologial numbering Thor and Tver of Nhor and Nver • for edge (f, g) of Nhor set flow xhor(f, g) = Thor(b) − Thor(a), where b is dual vertex on the left and b is dual vertex on the right of (f, g), similar for xver • easy to see that the constructed assignements xhor, xver have minumun value 21 - 4 Dr. Tamara Mchedlidze · Algorithmen zur Visualisierung von Graphen Flussmethoden: orthogonales Graphenzeichnen Faster Flow Computation

3 6 2 5 4 1 3

• ? ? construct the duals Nhor and Nver of Nhor and Nver • ? ? topologial numbering Thor and Tver of Nhor and Nver • for edge (f, g) of Nhor set flow xhor(f, g) = Thor(b) − Thor(a), where b is dual vertex on the left and b is dual vertex on the right of (f, g), similar for xver • easy to see that the constructed assignements xhor, xver have minumun value 21 - 5 Dr. Tamara Mchedlidze · Algorithmen zur Visualisierung von Graphen Flussmethoden: orthogonales Graphenzeichnen Faster Flow Computation

2 3 1 1 3 2 1 1 6 1 2 1 1 5 1 4 1 1 1 2 3 2 1 • ? ? construct the duals Nhor and Nver of Nhor and Nver • ? ? topologial numbering Thor and Tver of Nhor and Nver • for edge (f, g) of Nhor set flow xhor(f, g) = Thor(b) − Thor(a), where b is dual vertex on the left and b is dual vertex on the right of (f, g), similar for xver • easy to see that the constructed assignements xhor, xver have minumun value 21 - 6 Dr. Tamara Mchedlidze · Algorithmen zur Visualisierung von Graphen Flussmethoden: orthogonales Graphenzeichnen Faster Flow Computation

2 3 1 1 3 2 1 1 6 1 2 1 1 5 1 4 1 1 1 2 3 2 1 • This approach finds minimum width, height, area, but does not guaratees minimum total edge length • O(n)

21 - 7 Dr. Tamara Mchedlidze · Algorithmen zur Visualisierung von Graphen Flussmethoden: orthogonales Graphenzeichnen Faster Flow Computation

2 3 1 1 3 2 1 But1 what we do6 if not all faces are rectangles? 1 2 1 1 5 1 4 1 1 1 2 3 2 1 • This approach finds minimum width, height, area, but does not guaratees minimum total edge length • Time complexity O(n)

21 - 8 Dr. Tamara Mchedlidze · Algorithmen zur Visualisierung von Graphen Flussmethoden: orthogonales Graphenzeichnen Refinement of (G, H) – Innner Face

f

22 - 1 Dr. Tamara Mchedlidze · Algorithmen zur Visualisierung von Graphen Flussmethoden: orthogonales Graphenzeichnen Refinement of (G, H) – Innner Face

e14

e15 f e8 e9 e13

e0 e10 e1 e11

e2 e12 e3 e7 e4 e5 Dummy nodes for bends: e6

22 - 2 Dr. Tamara Mchedlidze · Algorithmen zur Visualisierung von Graphen Flussmethoden: orthogonales Graphenzeichnen Refinement of (G, H) – Innner Face

e14 e corner(e) e15 next(e) f e8 e9 e13

e0 e10 e1 e11

e2 e12 e3 e7 e4 e5 Dummy nodes for bends: e6

22 - 3 Dr. Tamara Mchedlidze · Algorithmen zur Visualisierung von Graphen Flussmethoden: orthogonales Graphenzeichnen Refinement of (G, H) – Innner Face

e 1 14 1

−1 −1 e15 f e8 e9 e −1 13 1 −1 1 e0 e10 e1 e11 1 −1 e2 1 e12 1 e3 e 1 −1 7 e4 e5 Dummy nodes for bends: e  1 6 1 1 left bend  turn(e) = 0 no bend −1 right bend

22 - 4 Dr. Tamara Mchedlidze · Algorithmen zur Visualisierung von Graphen Flussmethoden: orthogonales Graphenzeichnen Refinement of (G, H) – Innner Face

e 1 14 1

−1 −1 e15 f e8 e9 e −1 13 1 −1 1 e0 e10 e1 e11 1 −1 e2 1 e12 1 e3 front(e0): edge following e0 such e 1 −1 7 that for the edges in between e4 P e5 turn(e) = 1 Dummy nodes for bends: e  1 6 1 1 left bend  turn(e) = 0 no bend −1 right bend

22 - 5 Dr. Tamara Mchedlidze · Algorithmen zur Visualisierung von Graphen Flussmethoden: orthogonales Graphenzeichnen Refinement of (G, H) – Innner Face

e 1 14 1

−1 −1 extend(e0) e15 f e8 e9 e −1 13 1 −1 1 e0 e10 project(e0) e1 e11 1 −1 e2 1 e12 1 e3 front(e0): edge following e0 such e 1 −1 7 that for the edges in between e4 P e5 turn(e) = 1 Dummy nodes for bends: e  1 6 1 1 left bend  turn(e) = 0 no bend −1 right bend

22 - 6 Dr. Tamara Mchedlidze · Algorithmen zur Visualisierung von Graphen Flussmethoden: orthogonales Graphenzeichnen Refinement of (G, H) – Innner Face

e 1 14 1

−1 −1 e15 f e8 e9 e −1 13 1 −1 1 e0 e10 e1 e11 1 −1 e2 1 e12 1 e3 e 1 −1 7 e4 e5 Dummy nodes for bends: e  1 6 1 1 left bend  turn(e) = 0 no bend −1 right bend

22 - 7 Dr. Tamara Mchedlidze · Algorithmen zur Visualisierung von Graphen Flussmethoden: orthogonales Graphenzeichnen Refinement of (G, H) – Innner Face

e 1 14 1

−1 −1 e15 f e8 e9 e −1 13 1 −1 1 e0 e10 e1 e11 1 −1 e2 1 e12 1 e3 e 1 −1 7 e4 e5 Dummy nodes for bends: e  1 6 1 1 left bend  turn(e) = 0 no bend −1 right bend

22 - 8 Dr. Tamara Mchedlidze · Algorithmen zur Visualisierung von Graphen Flussmethoden: orthogonales Graphenzeichnen Refinement of (G, H) – Innner Face

e 1 14 1

−1 −1 e15 f e8 e9 e −1 13 1 −1 1 e0 e10 e1 e11 1 −1 e2 1 e12 1 e3 e 1 −1 7 e4 e5 Dummy nodes for bends: e  1 6 1 1 left bend  turn(e) = 0 no bend −1 right bend

22 - 9 Dr. Tamara Mchedlidze · Algorithmen zur Visualisierung von Graphen Flussmethoden: orthogonales Graphenzeichnen Refinement of (G, H) – Innner Face

e 1 14 1

−1 −1 e15 f e8 e9 e −1 13 1 −1 1 e0 e10 e1 e11 1 −1 e2 1 e12 1 e3 e 1 −1 7 e4 e5 Dummy nodes for bends: e  1 6 1 1 left bend  turn(e) = 0 no bend −1 right bend

22 - 10 Dr. Tamara Mchedlidze · Algorithmen zur Visualisierung von Graphen Flussmethoden: orthogonales Graphenzeichnen Refinement of (G, H) – Innner Face

e 1 14 1

−1 −1 e15 f e8 e9 e −1 13 1 −1 1 e0 e10 e1 e11 1 −1 e2 1 e12 1 e3 e 1 −1 7 e4 e5 Dummy nodes for bends: e  1 6 1 1 left bend  turn(e) = 0 no bend −1 right bend

22 - 11 Dr. Tamara Mchedlidze · Algorithmen zur Visualisierung von Graphen Flussmethoden: orthogonales Graphenzeichnen Refinement of (G, H) – Innner Face

e 1 14 1

−1 −1 e15 f e8 e9 e −1 13 1 −1 1 e0 e10 e1 e11 1 −1 e2 1 e12 1 e3 e 1 −1 7 e4 e5 Dummy nodes for bends: e  1 6 1 1 left bend  turn(e) = 0 no bend −1 right bend

22 - 12 Dr. Tamara Mchedlidze · Algorithmen zur Visualisierung von Graphen Flussmethoden: orthogonales Graphenzeichnen Refinement of (G, H) – Innner Face

e 1 14 1

−1 −1 e15 f e8 e9 e −1 13 1 −1 1 e0 e10 e1 e11 1 −1 e2 1 e12 1 e3 e 1 −1 7 e4 e5 Dummy nodes for bends: e  1 6 1 1 left bend  turn(e) = 0 no bend −1 right bend

22 - 13 Dr. Tamara Mchedlidze · Algorithmen zur Visualisierung von Graphen Flussmethoden: orthogonales Graphenzeichnen Refinement of (G, H) – Outer Face

e14

e8 e9 e13 e15 e10 e11

e12

e0 e1 e2 f0 e3 e4 e7 e5

e6

23 - 1 Dr. Tamara Mchedlidze · Algorithmen zur Visualisierung von Graphen Flussmethoden: orthogonales Graphenzeichnen Refinement of (G, H) – Outer Face

• e14 front(e) may be −1 −1 undefined 1 1 e8 e9 e13 e15 e10 −1 1 e11 −1 −1 e12 −1 1 e0 e1 e2 1 f0 e3 −1 e4 1 e7 e5 −1  −1 −1 1 left bend e  6 turn(e) = 0 no bend −1 right bend

23 - 2 Dr. Tamara Mchedlidze · Algorithmen zur Visualisierung von Graphen Flussmethoden: orthogonales Graphenzeichnen Refinement of (G, H) – Outer Face

• e14 front(e) may be −1 −1 undefined 1 1 e8 e9 e13 e15 e10 −1 1 e11 −1 −1 e12 −1 1 e0 e1 e2 1 f0 e3 −1 e4 1 e7 e5 −1  −1 −1 1 left bend e  6 turn(e) = 0 no bend −1 right bend

23 - 3 Dr. Tamara Mchedlidze · Algorithmen zur Visualisierung von Graphen Flussmethoden: orthogonales Graphenzeichnen Refinement of (G, H) – Outer Face

• e14 front(e) may be −1 −1 undefined 1 1 • when P turn(e) < 1 e8 e9 e13 for the complete turn e15 e10 −1 1 around f0, project on R e11 −1 −1 e12 −1 1 e0 e1 e2 1 f0 e3 −1 e4 1 e7 e5 −1  −1 −1 1 left bend e  6 turn(e) = 0 no bend −1 right bend

23 - 4 Dr. Tamara Mchedlidze · Algorithmen zur Visualisierung von Graphen Flussmethoden: orthogonales Graphenzeichnen Refinement of (G, H) – Outer Face

• e14 front(e) may be −1 −1 undefined 1 1 • when P turn(e) < 1 e8 e9 e13 for the complete turn e15 e10 −1 1 around f0, project on R e11 −1 −1 e12 −1 1 e0 e1 e2 1 f0 e3 −1 e4 1 e7 e5 −1  −1 −1 1 left bend e  6 turn(e) = 0 no bend −1 right bend

23 - 5 Dr. Tamara Mchedlidze · Algorithmen zur Visualisierung von Graphen Flussmethoden: orthogonales Graphenzeichnen Refinement of (G, H) – Outer Face

• e14 front(e) may be −1 −1 undefined 1 1 • when P turn(e) < 1 e8 e9 e13 for the complete turn e15 e10 −1 1 around f0, project on R e11 −1 −1 e12 −1 1 e0 e1 e2 1 f0 e3 −1 e4 1 e7 e5 −1  −1 −1 1 left bend e  6 turn(e) = 0 no bend −1 right bend

23 - 6 Dr. Tamara Mchedlidze · Algorithmen zur Visualisierung von Graphen Flussmethoden: orthogonales Graphenzeichnen Refinement of (G, H) – Outer Face

• e14 front(e) may be −1 −1 undefined 1 1 • when P turn(e) < 1 e8 e9 e13 for the complete turn e15 e10 −1 1 around f0, project on R e11 −1 −1 e12 −1 1 e0 e1 e2 1 f0 e3 −1 e4 1 e7 e5 −1  −1 −1 1 left bend e  6 turn(e) = 0 no bend −1 right bend

23 - 7 Dr. Tamara Mchedlidze · Algorithmen zur Visualisierung von Graphen Flussmethoden: orthogonales Graphenzeichnen Refinement of (G, H) – Outer Face

• e14 front(e) may be −1 −1 undefined 1 1 • when P turn(e) < 1 e8 e9 e13 for the complete turn e15 e10 −1 1 around f0, project on R e11 −1 −1 e12 −1 1 e0 e1 e2 1 f0 e3 −1 e4 1 e7 e5 −1  −1 −1 1 left bend e  6 turn(e) = 0 no bend −1 right bend

23 - 8 Dr. Tamara Mchedlidze · Algorithmen zur Visualisierung von Graphen Flussmethoden: orthogonales Graphenzeichnen Refinement of (G, H) – Outer Face

• e14 front(e) may be −1 −1 undefined 1 1 • when P turn(e) < 1 e8 e9 e13 for the complete turn e15 e10 −1 1 around f0, project on R e11 −1 −1 e12 −1 1 e0 e1 e2 1 f0 e3 −1 e4 1 e7 e5 −1  −1 −1 1 left bend e  6 turn(e) = 0 no bend −1 right bend

23 - 9 Dr. Tamara Mchedlidze · Algorithmen zur Visualisierung von Graphen Flussmethoden: orthogonales Graphenzeichnen Refinement of (G, H) – Outer Face

• e14 front(e) may be −1 −1 undefined 1 1 • when P turn(e) < 1 e8 e9 e13 for the complete turn e15 e10 −1 1 around f0, project on R e11 −1 −1 e12 −1 1 e0 e1 e2 1 f0 e3 −1 e4 1 e7 e5 −1  −1 −1 1 left bend e  6 turn(e) = 0 no bend −1 right bend

23 - 10 Dr. Tamara Mchedlidze · Algorithmen zur Visualisierung von Graphen Flussmethoden: orthogonales Graphenzeichnen Refinement of (G, H) – Outer Face

• e14 front(e) may be −1 −1 undefined 1 1 • when P turn(e) < 1 e8 e9 e13 for the complete turn e15 e10 −1 1 around f0, project on R e11 −1 −1 e12 −1 1 e0 e1 e2 1 f0 e3 −1 e4 1 e7 e5 −1  −1 −1 1 left bend e  6 turn(e) = 0 no bend −1 right bend

23 - 11 Dr. Tamara Mchedlidze · Algorithmen zur Visualisierung von Graphen Flussmethoden: orthogonales Graphenzeichnen Refinement of (G, H) – Outer Face

• e14 front(e) may be −1 −1 undefined 1 1 • when P turn(e) < 1 e8 e9 e13 for the complete turn e15 e10 −1 1 around f0, project on R e11 −1 −1 e12 −1 1 e0 e1 e2 1 f0 e3 −1 e4 1 e7 e5 −1  −1 −1 1 left bend e  6 turn(e) = 0 no bend −1 right bend

23 - 12 Dr. Tamara Mchedlidze · Algorithmen zur Visualisierung von Graphen Flussmethoden: orthogonales Graphenzeichnen Refinement of (G, H) – Outer Face

• e14 front(e) may be −1 −1 undefined 1 1 • when P turn(e) < 1 e8 e9 e13 for the complete turn e15 e10 −1 1 around f0, project on R e11 −1 −1 e12 −1 1 e0 e1 e2 1 f0 e3 −1 e4 1 e7 e5 −1  −1 −1 1 left bend e  6 turn(e) = 0 no bend −1 right bend

23 - 13 Dr. Tamara Mchedlidze · Algorithmen zur Visualisierung von Graphen Flussmethoden: orthogonales Graphenzeichnen Refinement of (G, H) – Outer Face

• e14 front(e) may be undefined • when P turn(e) < 1 e8 e9 e13 for the complete turn e15 e10 around f0, project on R e11

e12 all faces are rectangles → apply flow network e0 e1 e2 f0 e3 e4 e7 e5

e6

23 - 14 Dr. Tamara Mchedlidze · Algorithmen zur Visualisierung von Graphen Flussmethoden: orthogonales Graphenzeichnen Refinement of (G, H) – Outer Face

Has minimum area?

23 - 15 Dr. Tamara Mchedlidze · Algorithmen zur Visualisierung von Graphen Flussmethoden: orthogonales Graphenzeichnen Refinement of (G, H) – Outer Face

Has minimum area? NO!

23 - 16 Dr. Tamara Mchedlidze · Algorithmen zur Visualisierung von Graphen Flussmethoden: orthogonales Graphenzeichnen Refinement of (G, H) – Outer Face

Has minimum area? NO!

Area Minimization with a given orthogonal representation is an NP-hard problem!

23 - 17 Dr. Tamara Mchedlidze · Algorithmen zur Visualisierung von Graphen Flussmethoden: orthogonales Graphenzeichnen Summary • An orthogonal representation with minimum number of bends can be found in O(n3/2) time • Given an orthogonal representation a layout with minimum area and total edge length is achievable for the case of rectangular faces • In case of non rectangular faces, reduce the problem to rectangular case. The resulting area is not minimum.

24 - 1 Dr. Tamara Mchedlidze · Algorithmen zur Visualisierung von Graphen Flussmethoden: orthogonales Graphenzeichnen Summary • An orthogonal representation with minimum number of bends can be found in O(n3/2) time • Given an orthogonal representation a layout with minimum area and total edge length is achievable for the case of rectangular faces • In case of non rectangular faces, reduce the problem to rectangular case. The resulting area is not minimum. • Area minimization with a given orthogonal representation is an NP-hard problem. [Patrignany CGTA 2001]

24 - 2 Dr. Tamara Mchedlidze · Algorithmen zur Visualisierung von Graphen Flussmethoden: orthogonales Graphenzeichnen Summary • An orthogonal representation with minimum number of bends can be found in O(n3/2) time • Given an orthogonal representation a layout with minimum area and total edge length is achievable for the case of rectangular faces • In case of non rectangular faces, reduce the problem to rectangular case. The resulting area is not minimum. • Area minimization with a given orthogonal representation is an NP-hard problem. [Patrignany CGTA 2001] • Solvable with an integer linear program (ILP) [Klau, Mutzel IPCO 1999]

24 - 3 Dr. Tamara Mchedlidze · Algorithmen zur Visualisierung von Graphen Flussmethoden: orthogonales Graphenzeichnen Summary • An orthogonal representation with minimum number of bends can be found in O(n3/2) time • Given an orthogonal representation a layout with minimum area and total edge length is achievable for the case of rectangular faces • In case of non rectangular faces, reduce the problem to rectangular case. The resulting area is not minimum. • Area minimization with a given orthogonal representation is an NP-hard problem. [Patrignany CGTA 2001] • Solvable with an integer linear program (ILP) [Klau, Mutzel IPCO 1999] • Various heuristics have been implemented and experimentally evaluated wrt running time and quality [Klau, Klein, Mutzel GD 2001]

24 - 4 Dr. Tamara Mchedlidze · Algorithmen zur Visualisierung von Graphen Flussmethoden: orthogonales Graphenzeichnen Summary • An orthogonal representation with minimum number of bends can be found in O(n3/2) time • Given an orthogonal representation a layout with minimum area and total edge length is achievable for the case of rectangular faces • In case of non rectangular faces, reduce the problem to rectangular case. The resulting area is not minimum. • Area minimization with a given orthogonal representation is an NP-hard problem. [Patrignany CGTA 2001] • Solvable with an integer linear program (ILP) [Klau, Mutzel IPCO 1999] • Various heuristics have been implemented and experimentally evaluated wrt running time and quality [Klau, Klein, Mutzel GD 2001] • for non-planar graphs the area minimization is hard to approximate [Bannister, Eppstein, Simons JGAA 2012] 24 - 5 Dr. Tamara Mchedlidze · Algorithmen zur Visualisierung von Graphen Flussmethoden: orthogonales Graphenzeichnen