Вы находитесь на странице: 1из 49

Graph Drawing Malte Skambath Introduction

Challenges Types of drawings

Graph Drawing
Computational Geometry

Force-directed approach
Spring Embedder Simulated Annealing

Crossing Minimization
Planarization Approach

Malte Skambath
zu Lubeck Universitat Institute for Theoretical Computer Science

Dual graph SPQR-tree

Orthogonal Bend Minimization


Orthogonal Drawing MinCostFlow-Problem

Summary

February 7, 2012

1 / 46

Outline

Graph Drawing Malte Skambath Introduction


Challenges Types of drawings

Introduction Force-directed approach Crossing Minimization Orthogonal Bend Minimization Summary

Force-directed approach
Spring Embedder Simulated Annealing

Crossing Minimization
Planarization Approach Dual graph SPQR-tree

Orthogonal Bend Minimization


Orthogonal Drawing MinCostFlow-Problem

Summary

2 / 46

Introduction
What is Graph Drawing?

Graph Drawing Malte Skambath Introduction


Challenges Types of drawings

Force-directed approach
Spring Embedder Simulated Annealing

How to draw nice graphs?

Crossing Minimization
Planarization Approach Dual graph SPQR-tree

Orthogonal Bend Minimization


Orthogonal Drawing MinCostFlow-Problem

Summary

3 / 46

Challenges
What is a nice graph?

Graph Drawing Malte Skambath Introduction


Challenges Types of drawings

Visualization of the graph should have nice look No precisely denition. Criteria on nice drawings
Symmetries Less crossing as possible Less bends as possible

Force-directed approach
Spring Embedder Simulated Annealing

Crossing Minimization
Planarization Approach Dual graph SPQR-tree

Drawing should represents special properties


Topological sorting

Orthogonal Bend Minimization


Orthogonal Drawing MinCostFlow-Problem

Summary

4 / 46

Types of drawings

Graph Drawing Malte Skambath Introduction


Challenges Types of drawings

Force-directed approach
Spring Embedder Simulated Annealing

Crossing Minimization
Planarization Approach Dual graph SPQR-tree

Orthogonal Bend Minimization


Orthogonal Drawing

(a)

(b)

(c)

(d)

MinCostFlow-Problem

Summary

Figure : Types of drawings: a polyline (a), straight-line (b) and (c) an orthogonal drawing of K3,3 ; (d) upward drawing

5 / 46

Motivation
Is it useful for me?

Graph Drawing Malte Skambath Introduction


Challenges Types of drawings

state-machines UML class diagrams electrical circuits / chip-design trafc-nets (e. g. bus map)
rtlenburger Str. rd-Wagner-Str.

Force-directed approach
Spring Embedder Simulated Annealing

Crossing Minimization
Planarization Approach Dual graph SPQR-tree

Graph

Node

Mozartstr.

Edge

PlanarGraph

Faces

Friedenstr. 1 Adolf40 str. Wickedestr. 39 Gustav- 30 Fackenburger RadbruchAllee 32 Beckergrube Platz 32 31 15 Ehren- Z 40 Breite Str./ friedhof LindenArcaden 12 Schulstr. 11 Meierstr. 3 Stadtche Tpferweg 30 12 Geschw.-S theater UnterGroe trave Gustav-Adolf-S Burgstr. RoeckZOB/ 30 31 39 Schssel3 Hauptbahnhof str. buden Heinrichstr. 39 40 8720 Koberg 15 31 HolstentorDrger- 4 LachswehrLauerho 21 e platz park 11 StadtKatharineum allee 11 4 werke 10 Falkendam m Schenk 8720 5 15 5 Fleischhauerer DrgerKohlm arkt str. An der werk 15 32 10 Falkenwiese Gneisenaustr. 1 2 6 7 9 16 (17) Wahm str. 2 Goeben3 Linien 15 u. 32 5 Percevalstr. Sandstr. str. WielandUm leitung wegen MarliMeesenNeubau str. Krhenring ring Hansering Blanckstr. Knigstr. Possehlbrcke str. 11 4 bis 2014/15 Fegefeuer Am 5 Kaufhof 4 Moltkestr. MoltkeLutherkirche H Bertram shof Hxtertorallee platz Wisbystr.

(17) 9 ibis Hotel An der 7 12 Stadt3 freiheit 21


Adlerstr.

Drgestr.

10

Torneiweg Bun we Luisenstr. BurgtorHanse friedhof Reside

Orthogonal Bend Minimization


Orthogonal Drawing MinCostFlow-Problem

LBECK HBF

R1 R2

Summary

keine Bedienung

Welsbachstr.

Walkm hlenweg Bei der en Gasanstalt en Zeistr

Verwaltungszentrum Mhlentor Theodor-HeussSt

Stadthalle

15

Stresem annstr.

Kernzone 6000

Pensebusch Trk

6 / 46

Force-directed approach

Graph Drawing Malte Skambath Introduction


Challenges Types of drawings

Force-directed approach
Spring Embedder

Used for straight line drawings Model the graph-vertices and edges as physical objects with forces Distance of adjacent vertices (v , w ) should be nearly the same distance d (v , w ) No overlapping vertices

Simulated Annealing

Crossing Minimization
Planarization Approach Dual graph SPQR-tree

Orthogonal Bend Minimization


Orthogonal Drawing MinCostFlow-Problem

Summary

7 / 46

Force-directed approach
1. Generate random representation of G with random positions p(v ) for v V 2. Calculate forces between each pair of vertices vi , vj : f (vi , vj ) 3. Calculate resulting force f (v ) for each node v V : f (v ) w V \{v } f (v , w ) 4. Update positions p(v ) = p(v ) + f (v )

Graph Drawing Malte Skambath Introduction


Challenges Types of drawings

Force-directed approach
Spring Embedder Simulated Annealing

Crossing Minimization
Planarization Approach Dual graph SPQR-tree

Orthogonal Bend Minimization


Orthogonal Drawing MinCostFlow-Problem

Summary

8 / 46

Spring Embedder
Remember: we want a unit distance d (v , w ) if v , w are adjacent Model edges as springs with a unit length unit length no force attracting force (adjacent vertices): fa = ca log d cr repelling force (non-adjacent vertices): fr = 2 d stepwise simulatable fa (v , w ), (v , w ) E f (v ) = (p(w ) p(v )) fr (v , w ), (v , w ) E w V \{v } p(v ) := p(v ) + f (v )

Graph Drawing Malte Skambath Introduction


Challenges Types of drawings

Force-directed approach
Spring Embedder Simulated Annealing

Crossing Minimization
Planarization Approach Dual graph SPQR-tree

Orthogonal Bend Minimization


Orthogonal Drawing MinCostFlow-Problem

Summary

9 / 46

Spring Embedder
Sample

Graph Drawing Malte Skambath Introduction


Challenges Types of drawings

Force-directed approach
Spring Embedder Simulated Annealing

Crossing Minimization
Planarization Approach Dual graph SPQR-tree

Orthogonal Bend Minimization


Orthogonal Drawing MinCostFlow-Problem

Summary

10 / 46

Advantages & Disadvantages


easy implementable usefull for interactive implementation time-complexity: O (n|V |2 ) slow with huge graphs non-predictable result

Graph Drawing Malte Skambath Introduction


Challenges Types of drawings

Force-directed approach
Spring Embedder Simulated Annealing

Crossing Minimization
Planarization Approach Dual graph SPQR-tree

Orthogonal Bend Minimization


Orthogonal Drawing MinCostFlow-Problem

Summary

11 / 46

Simulated Annealing

Graph Drawing Malte Skambath Introduction


Challenges Types of drawings

Goal: optimize drawing to selected criterias No forces, but physical model Inspired by cool-down process in liquids Dene an energy-function E : R Low value E ( ) ts many criteria High temperature T high propabilty P nding a better conguration Low energy value E ( ) low propability P nding a better conguration

Force-directed approach
Spring Embedder Simulated Annealing

Crossing Minimization
Planarization Approach Dual graph SPQR-tree

Orthogonal Bend Minimization


Orthogonal Drawing MinCostFlow-Problem

Summary

12 / 46

Simulated Annealing
Algorithm 1: Simulated Annealing Graph Drawing input : A graph G = (V , E ), an initial temperature T output: A straight-line drawing of G begin Create initial drawing/conguration with random pos. for each vertex v V ; while do Choose a new conguration from the neighborhood of ; Let E and E be the energy values of and ; if E < E or with a probability of e(E E )/T then ; Decrease T

Graph Drawing Malte Skambath Introduction


Challenges Types of drawings

Force-directed approach
Spring Embedder Simulated Annealing

Crossing Minimization
Planarization Approach Dual graph SPQR-tree

Orthogonal Bend Minimization


Orthogonal Drawing MinCostFlow-Problem

Summary

13 / 46

Energy function
should depend on the criteria low time complexity Example (by R. Davidson and D. Harel.): f = 1
i =j

Graph Drawing Malte Skambath Introduction


Challenges Types of drawings

Force-directed approach
Spring Embedder Simulated Annealing

1 d (ni , nj ) dbord (n)

distribution border dist. edge length edge crossings edge-distance

Crossing Minimization
Planarization Approach Dual graph SPQR-tree

+ 2
nV

Orthogonal Bend Minimization


Orthogonal Drawing MinCostFlow-Problem

+ 3
eE

d (e)

Summary

+ 4 crossings + 5
eE ,nV

d (n, e)

14 / 46

Neighborhood & energy function

Graph Drawing Malte Skambath Introduction


Challenges Types of drawings

How can we dene the neighborhood? change the position of a single node in

Force-directed approach
Spring Embedder Simulated Annealing

Crossing Minimization
Planarization Approach Dual graph SPQR-tree

Orthogonal Bend Minimization


Orthogonal Drawing MinCostFlow-Problem

Summary

15 / 46

Simulated annealing
example

Graph Drawing Malte Skambath Introduction


Challenges Types of drawings

Force-directed approach
Spring Embedder Simulated Annealing

Crossing Minimization
Planarization Approach Dual graph SPQR-tree

Orthogonal Bend Minimization


Orthogonal Drawing MinCostFlow-Problem

Summary

R. Davidson, D. Harel Drawing Graphs Nicely Using Simulated Annealing, 1996

16 / 46

Crossing Minimization
Goal: reduce number of crossings in a drawing of a non-planar graph G We know: planar graphs can be drawn without crossings Approximate Graph as a planar graph Idea: convert non-planar graphs into planar graphs and replace non-removable crossings as virtual vertices Planarizataion approach: create a planar embedding of the new graph

Graph Drawing Malte Skambath Introduction


Challenges Types of drawings

Force-directed approach
Spring Embedder Simulated Annealing

Crossing Minimization
Planarization Approach Dual graph SPQR-tree

Orthogonal Bend Minimization


Orthogonal Drawing MinCostFlow-Problem

Summary

17 / 46

Planarization Approach

Graph Drawing Malte Skambath Introduction


Challenges Types of drawings

1. Find maximum planar subgraph and embedding, without crossing 2. Create embedding of the graph 3. Insert the non-planar edges with a minimum number of crossing, use crossings as virtual vertices

Force-directed approach
Spring Embedder Simulated Annealing

Crossing Minimization
Planarization Approach Dual graph SPQR-tree

Orthogonal Bend Minimization


Orthogonal Drawing MinCostFlow-Problem

Summary

18 / 46

Planarization Approach

Graph Drawing Malte Skambath Introduction


Challenges Types of drawings

1. Find maximum planar subgraph and embedding, without crossing 2. Create embedding of the graph 3. Insert the non-planar edges with a minimum number of crossing, use crossings as virtual vertices Problem Finding a maximum-planar subgraph is N P -hard . trade off nd a maximal planar subgraph

Force-directed approach
Spring Embedder Simulated Annealing

Crossing Minimization
Planarization Approach Dual graph SPQR-tree

Orthogonal Bend Minimization


Orthogonal Drawing MinCostFlow-Problem

Summary

18 / 46

Maximal planar subgraph

Graph Drawing Malte Skambath Introduction


Challenges Types of drawings

Algorithm 2: Maximal planar subgraph input : a graph G = (V , E ) output: a maximal planar subgraph G = (V , E ) of G begin E = ; while there is an edge e E \ E that G = (V , E {e}) is planar do E E { e }; return G ;

Force-directed approach
Spring Embedder Simulated Annealing

Crossing Minimization
Planarization Approach Dual graph SPQR-tree

Orthogonal Bend Minimization


Orthogonal Drawing MinCostFlow-Problem

Summary

19 / 46

Graph Drawing Malte Skambath Introduction


Challenges Types of drawings

Denition A dual graph DG = (F , E ) of a planar graph G = (V , E ) is a (multi-)graph where F represents the faces in a planar embedding of G. Each pair f1 , f2 F of adjacent faces is splitted by an edge in G. E (F ) E (G)

Force-directed approach
Spring Embedder Simulated Annealing

Crossing Minimization
Planarization Approach Dual graph SPQR-tree

Orthogonal Bend Minimization


Orthogonal Drawing MinCostFlow-Problem

Summary

20 / 46

Insert non-planar edge with min. crossings


Insert non-planar edge e = (v , w ) E 1. Find shortest path p in the dual-graph DG 2. Insert e over path p generate new virtual nodes and split faces

Graph Drawing Malte Skambath Introduction


Challenges Types of drawings

Force-directed approach
Spring Embedder Simulated Annealing

Crossing Minimization
Planarization Approach Dual graph SPQR-tree

Orthogonal Bend Minimization


Orthogonal Drawing MinCostFlow-Problem

Summary

21 / 46

Insert non-planar edge with min. crossings

Graph Drawing Malte Skambath Introduction


Challenges Types of drawings

Force-directed approach
Spring Embedder Simulated Annealing

Crossing Minimization
Planarization Approach Dual graph SPQR-tree

Orthogonal Bend Minimization


Orthogonal Drawing MinCostFlow-Problem

Summary

22 / 46

Insert non-planar edge with min. crossings

Graph Drawing Malte Skambath Introduction


Challenges Types of drawings

Force-directed approach
Spring Embedder Simulated Annealing

Crossing Minimization
Planarization Approach Dual graph SPQR-tree

Orthogonal Bend Minimization


Orthogonal Drawing MinCostFlow-Problem

Summary

23 / 46

Shortest Path in the Dual Graph

Graph Drawing Malte Skambath Introduction


Challenges Types of drawings

Force-directed approach
Spring Embedder Simulated Annealing

Crossing Minimization
Planarization Approach Dual graph SPQR-tree

Orthogonal Bend Minimization

k+1

k+1

Orthogonal Drawing MinCostFlow-Problem

Summary

24 / 46

Improve with parallel substructures

Graph Drawing Malte Skambath Introduction


Challenges Types of drawings

Problem: for some edges the graph can easily be modied to reduce number of crossings if the 2 vertices of the edge are in different blocks of a parallel substructure switch the order to decrease number of crossings

Force-directed approach
Spring Embedder Simulated Annealing

Crossing Minimization
Planarization Approach Dual graph SPQR-tree

Orthogonal Bend Minimization


Orthogonal Drawing MinCostFlow-Problem

Summary

25 / 46

SPQR-tree

Graph Drawing Malte Skambath Introduction


Challenges Types of drawings

Force-directed approach
Spring Embedder

s e t
(a) trivial case (b) parallel case (c) series case (d) rigid case

Simulated Annealing

e e

Crossing Minimization
Planarization Approach Dual graph SPQR-tree

Orthogonal Bend Minimization


Orthogonal Drawing MinCostFlow-Problem

Summary

Figure : the four different types of nodes in a SPQR-tree

26 / 46

SPQR-tree
b a d c e g n f h l k m i o j p

Graph Drawing Malte Skambath Introduction


Challenges Types of drawings

Force-directed approach
Spring Embedder Simulated Annealing

Crossing Minimization
Planarization Approach Dual graph SPQR-tree

Orthogonal Bend Minimization


Orthogonal Drawing MinCostFlow-Problem

Summary

27 / 46

SPQR-tree
a

Graph Drawing Malte Skambath Introduction


Challenges Types of drawings

a c d f h k

b e g n i l j m
f d e h h h h h k l m m h j h d

d e e e

c e

Force-directed approach
Spring Embedder Simulated Annealing

e e n n j j j i j j n n n

Crossing Minimization
Planarization Approach Dual graph SPQR-tree

Orthogonal Bend Minimization


Orthogonal Drawing MinCostFlow-Problem

Summary

o p

28 / 46

SPQR-trees
a d d d f h h h h h k l m m j h i h j j j j j e e e n n n o p e n e c e e g n b

Graph Drawing Malte Skambath Introduction


Challenges Types of drawings

R P S P R S P S S P R P S

Force-directed approach
Spring Embedder Simulated Annealing

Crossing Minimization
Planarization Approach Dual graph SPQR-tree

Orthogonal Bend Minimization


Orthogonal Drawing MinCostFlow-Problem

Summary

29 / 46

SPQR-trees
a d f h k l b c e g n i j m R S P S o p R P S P S P R P S

Graph Drawing Malte Skambath Introduction


Challenges Types of drawings

Force-directed approach
Spring Embedder Simulated Annealing

Crossing Minimization
Planarization Approach Dual graph SPQR-tree

Orthogonal Bend Minimization


Orthogonal Drawing MinCostFlow-Problem

Summary

30 / 46

SPQR-trees
g e d b c a f i h l j k m n R o P p S P R S P S S P R P S

Graph Drawing Malte Skambath Introduction


Challenges Types of drawings

Force-directed approach
Spring Embedder Simulated Annealing

Crossing Minimization
Planarization Approach Dual graph SPQR-tree

Orthogonal Bend Minimization


Orthogonal Drawing MinCostFlow-Problem

Summary

31 / 46

Orthogonal Drawing
(E ) for each edge e E is a set of orthogonal lines (v ) for each vertex v V is a point in R2 Denition We call an orthogonal planar drawing of G if 1. v , w V : (v ) = (w V ) w = v (invective) 2. e = (v , w ) E : (v ), (w ) are endpoints of (e) 3. e1 , e2 E : e1 = e2 (e1 ), (e2 ) only intersect at a point (v ) of a common vertex v (if exists)

Graph Drawing Malte Skambath Introduction


Challenges Types of drawings

Force-directed approach
Spring Embedder Simulated Annealing

Crossing Minimization
Planarization Approach Dual graph SPQR-tree

Orthogonal Bend Minimization


Orthogonal Drawing MinCostFlow-Problem

Summary

32 / 46

Orthogonal Drawing

Graph Drawing Malte Skambath Introduction


Challenges Types of drawings

Force-directed approach
Spring Embedder Simulated Annealing

Crossing Minimization
Planarization Approach Dual graph SPQR-tree

Orthogonal Bend Minimization


Orthogonal Drawing

two different planar orthogonal representations , of the same Graph G, but with a different number of edges and the same faces

MinCostFlow-Problem

Summary

33 / 46

Bend Minimization as MinCostFlow-Problem

Graph Drawing Malte Skambath Introduction


Challenges Types of drawings

Force-directed approach
Spring Embedder Simulated Annealing

Crossing Minimization
Planarization Approach

If we have a planar representation of a planar Graph, keeping the the same faces we can minimize the number of bends with solving a minimum cost ow problem.

Dual graph SPQR-tree

Orthogonal Bend Minimization


Orthogonal Drawing MinCostFlow-Problem

Summary

34 / 46

Bend Minimization as MinCostFlow-Problem


Denition A min-cost ow network N = (D , u , l , b, c ) consists of directed (multi-)graph D = (W , A) capacities u : A N0 {}, l : A Z node demands b : W Z costs c : A N0 . f : A N0 is a ow on N if l (a ) f (a ) u (a ) b(v ) = (v ,w )A f (v , w ) v W (b (v ) = 0) f is a min-cost-ow if

Graph Drawing Malte Skambath Introduction


Challenges Types of drawings

Force-directed approach
Spring Embedder Simulated Annealing

Crossing Minimization
Planarization Approach Dual graph SPQR-tree

Orthogonal Bend Minimization


Orthogonal Drawing MinCostFlow-Problem

Summary

(w ,v )A f (w , v )

aA c (a)f (a)

is minimal.
35 / 46

Dene the ow network for the problem


node demands & capacities

Graph Drawing Malte Skambath Introduction


Challenges Types of drawings

Force-directed approach

v4

v5

Spring Embedder

(v5 , v3 ) = 2 (v3 , v5 ) = 2; (v5 , v3 ) = 1;

Simulated Annealing

Crossing Minimization
Planarization Approach Dual graph SPQR-tree

v1

v2

v3 (v3 , v5 ) = 1

Orthogonal Bend Minimization


Orthogonal Drawing MinCostFlow-Problem

dene labels (v , w ), (v , w ) for each edge (v , w ) in G: : (v , w ) E #of L-bends in ((v , w )) : (v , wi ) E betw. ((v , wi ))and((v , wi +1 ))

Summary

36 / 46

Dene the ow network for the problem


node demands & capacities

Graph Drawing Malte Skambath Introduction


Challenges Types of drawings

Remember: We want to minimize the total number of bends on edges in the drawing (G). The total number is (v ,w )E (v , w ) + (w , v ). So the goal is: minimize (v ,w )E (v , w ) + (w , v ) 1 1 2 1 1 1 2 1 1 1

Force-directed approach
Spring Embedder Simulated Annealing

Crossing Minimization
Planarization Approach Dual graph SPQR-tree

Orthogonal Bend Minimization


Orthogonal Drawing MinCostFlow-Problem

Summary

37 / 46

Graph Drawing Malte Skambath Introduction

Theorem The sum of angles(at vertices or bends) around an inner/outer face f F is: (deg(f ) + #bends 2) This implies: ((v , w ) + (w , v ) (v , w )) = 2 deg(f ) 4
(v ,w )E (f )

Challenges Types of drawings

Force-directed approach
Spring Embedder Simulated Annealing

Crossing Minimization
Planarization Approach Dual graph SPQR-tree

Orthogonal Bend Minimization


Orthogonal Drawing MinCostFlow-Problem

Summary

38 / 46

Graph Drawing Malte Skambath Introduction


Challenges

((v , w ) + (w , v ) (v , w )) = 2 deg(f ) 4
(v ,w )E (f )

Types of drawings

Force-directed approach
Spring Embedder Simulated Annealing

1 1 1 1 1 2 1

Crossing Minimization
Planarization Approach Dual graph SPQR-tree

Orthogonal Bend Minimization


Orthogonal Drawing MinCostFlow-Problem

Summary

Let the face-to-face edges (producers of bends on an edge) get edges in the ow networks with costs 1

39 / 46

Dene the ow network for the problem


The directed (multi-) Graph DG

Graph Drawing Malte Skambath Introduction

DG = (W , A) with W = V F consists DF as the face-induced subgraph of F by (G)

Challenges Types of drawings

Force-directed approach
Spring Embedder Simulated Annealing

Crossing Minimization
Planarization Approach Dual graph SPQR-tree

Orthogonal Bend Minimization


Orthogonal Drawing MinCostFlow-Problem

demands in the ow-network N : 2 deg(x ) 4 , x F (inner / outer face) b(x ) = : 4 ,x V capacities: e A : u (e) = ; e AF : l (e) = 0; e AF : l (e) = 1 costs: eF AF : c (eF ) = 1; e AF : c (e) = 0

Summary

40 / 46

Assign ow
Given a ow f : E N f (v , fv ,w ): angle() at node v in face fv ,w left of (v , w ) f (f1 , f2 )e : #LeftBends ( ) on the edge (f1 , f2 )e between the faces f1 and f2 A ow f is a valid model for a valid drawing if: for all nodes v : b(v ) = for all faces f :
( (v , w ) + (w , v ) (v , w )) = 2 deg(f ) 4
(v ,w )E (f )

Graph Drawing Malte Skambath Introduction


Challenges Types of drawings

Force-directed approach
Spring Embedder Simulated Annealing

Crossing Minimization
Planarization Approach Dual graph SPQR-tree

(v ,w )E

f (v , w ) = 4

Orthogonal Bend Minimization


Orthogonal Drawing MinCostFlow-Problem

Summary

inow outow

A valid ow implies a valid graph representation A cost-minimal ow implies a bend-minimal graph representation
41 / 46

Assign ow
Given a ow f : E N f (v , fv ,w ): angle() at node v in face fv ,w left of (v , w ) f (f1 , f2 )e : #LeftBends ( ) on the edge (f1 , f2 )e between the faces f1 and f2 A ow f is a valid model for a valid drawing if: for all nodes v : b(v ) = for all faces f :
( (v , w ) + (w , v ) (v , w )) = 2 deg(f ) 4
(v ,w )E (f )

Graph Drawing Malte Skambath Introduction


Challenges Types of drawings

Force-directed approach
Spring Embedder Simulated Annealing

Crossing Minimization
Planarization Approach Dual graph SPQR-tree

(v ,w )E

f (v , w ) = 4

Orthogonal Bend Minimization


Orthogonal Drawing MinCostFlow-Problem

Summary

inow outow

A valid ow implies a valid graph representation A cost-minimal ow implies a bend-minimal graph representation
41 / 46

Assign ow
Given a ow f : E N f (v , fv ,w ): angle() at node v in face fv ,w left of (v , w ) f (f1 , f2 )e : #LeftBends ( ) on the edge (f1 , f2 )e between the faces f1 and f2 A ow f is a valid model for a valid drawing if: for all nodes v : b(v ) = for all faces f :
( (v , w ) + (w , v ) (v , w )) = 2 deg(f ) 4
(v ,w )E (f )

Graph Drawing Malte Skambath Introduction


Challenges Types of drawings

Force-directed approach
Spring Embedder Simulated Annealing

Crossing Minimization
Planarization Approach Dual graph SPQR-tree

(v ,w )E

f (v , w ) = 4

Orthogonal Bend Minimization


Orthogonal Drawing MinCostFlow-Problem

Summary

inow outow

A valid ow implies a valid graph representation A cost-minimal ow implies a bend-minimal graph representation
41 / 46

Existence of a valid ow: Inow=Outow


!

Graph Drawing Malte Skambath Introduction


Challenges

to proof:

v W

b(v ) = 0 b(v ) + b (f )
f F

Types of drawings

Force-directed approach
Spring Embedder Simulated Annealing

b (v ) =
v W v V

Crossing Minimization

= |V |4 +

(2 deg f + 4) 2 deg fo 4
f F \{fo }

Planarization Approach Dual graph SPQR-tree

= |V |4 + (|F| 2)4 2
f F

(deg f )

Orthogonal Bend Minimization


Orthogonal Drawing MinCostFlow-Problem

= |V |4 + (|F| 2)4 4|E | = 4(|V | + |F| |E | 2) = 0

Summary

42 / 46

Bend Minimization
example

Graph Drawing Malte Skambath Introduction


Challenges Types of drawings

Force-directed approach
Spring Embedder Simulated Annealing

-14 3 -4 3 2 1 2 -2 3 3 -4 2 3 2

-14 1 -2 2 3

Crossing Minimization
Planarization Approach Dual graph SPQR-tree

Orthogonal Bend Minimization


Orthogonal Drawing MinCostFlow-Problem

Summary

43 / 46

Summary
graph drawing is a wide area with many problems most problems are N P hard problems depend on the type of drawings and the slected criterias good approximation is possible for many problems combination of algorithms may be possible there exists many tools for graph drawing
1. 2. 3. 4. yEd GraphViz Gephi Tulip

Graph Drawing Malte Skambath Introduction


Challenges Types of drawings

Force-directed approach
Spring Embedder Simulated Annealing

Crossing Minimization
Planarization Approach Dual graph SPQR-tree

Orthogonal Bend Minimization


Orthogonal Drawing MinCostFlow-Problem

Summary

44 / 46

GraphViz
example

Graph Drawing Malte Skambath Introduction


Challenges

circo-layout:

twopi-layout:

graph G{ 2 node[label=""]; 3 a1 -- a2; a1 -4 a1 -- a4; 5 a1 -- a5; a1 -6 a2 -- a3; a2 -7 a2 -- a5; a2 -8 a3 -- a4; a3 -9 a3 -- a6; 10 a4 -- a5; a4 -11 a5 -- a6; 12}
1

Types of drawings

a3; a6; a4; a6; a5; a6;

Force-directed approach
Spring Embedder Simulated Annealing

Crossing Minimization
Planarization Approach Dual graph SPQR-tree

Orthogonal Bend Minimization


Orthogonal Drawing MinCostFlow-Problem

Summary

45 / 46

yEd

Graph Drawing Malte Skambath Introduction


Challenges Types of drawings

Force-directed approach
Spring Embedder Simulated Annealing

Crossing Minimization
Planarization Approach Dual graph SPQR-tree

Orthogonal Bend Minimization


Orthogonal Drawing MinCostFlow-Problem

Summary

46 / 46

Вам также может понравиться