SLIDE 1 Rectangular Representation of Weighted Outerplanar Graphs
Chair of Computer Science I Universit¨ at W¨ urzburg Supervisors Philipp Kindermann & Alexander Wolff
Bachelor Colloquium Lorenz Reinhart October 01, 2014
SLIDE 2
Motivation
Rectangular Cartograms: Representation of maps where every region is represented by a rectangle.
SLIDE 3
Motivation
Rectangular Cartograms: DE DK NL BE FR CH AT CZ PL Representation of maps where every region is represented by a rectangle.
SLIDE 4
Motivation
Rectangular Cartograms: DE DK NL BE FR CH AT CZ PL Representation of maps where every region is represented by a rectangle.
SLIDE 5 Motivation
Rectangular Cartograms: DE DK NL BE FR CH AT CZ PL Representation of maps where every region is represented by a rectangle.
NE
SLIDE 6 Motivation
Rectangular Cartograms: DE DK NL BE FR CH AT CZ PL Representation of maps where every region is represented by a rectangle.
NE
Problems: wrong representation of some maps graphs without geographic information
SLIDE 7
Targets
draw the rectangles with the desired size
SLIDE 8
Targets
draw the rectangles with the desired size every rectangular representation should be possible to draw
SLIDE 9
Targets
draw the rectangles with the desired size every rectangular representation should be possible to draw no need for a surrounding rectangle
SLIDE 10 Targets
draw the rectangles with the desired size every rectangular representation should be possible to draw no need for a surrounding rectangle extension to general graphs DE DK NL BE FR CH AT CZ PL IT ES apple banana pear
SLIDE 11 Targets
draw the rectangles with the desired size every rectangular representation should be possible to draw no need for a surrounding rectangle DE DK NL BE FR CH AT CZ PL IT ES apple banana pear
extension to general graphs?
SLIDE 12 Targets
draw the rectangles with the desired size every rectangular representation should be possible to draw no need for a surrounding rectangle DE DK NL BE FR CH AT CZ PL IT ES apple banana pear
extension to general graph classes!
SLIDE 13
Basic Graphs
Graph G = (V , E)
SLIDE 14
Basic Graphs
Graph G = (V , E)
SLIDE 15
Basic Graphs
Graph G = (V , E)
SLIDE 16
Basic Graphs
A Planar Graph G = (V , E) can be drawn in such a way that no edges cross each other
SLIDE 17
Basic Graphs
A Planar Graph G = (V , E) can be drawn in such a way that no edges cross each other Dual Graph G*=(V*,E*): a vertex corresponding to each face of G an edge joining two neighboring faces for each edge in G
SLIDE 18
Maximal Outerplanar Graphs
Outerplanar graph: all vertices belong to the unbounded face
SLIDE 19
Maximal Outerplanar Graphs
Outerplanar graph: all vertices belong to the unbounded face
SLIDE 20
Maximal Outerplanar Graphs
Outerplanar graph: all vertices belong to the unbounded face Maximal outerplanar Graph: cannot have any additional edges while preserving outerplanarity
SLIDE 21
Maximal Outerplanar Graphs
Outerplanar graph: all vertices belong to the unbounded face Maximal outerplanar Graph: cannot have any additional edges while preserving outerplanarity Every surface is surrounded by a triangle!
SLIDE 22
Rectangles
Rectangular representation v A vertex v is corresponding to a rectangle r(v) with size a(v) y x a(v) r(v)
SLIDE 23
Rectangles
Rectangular representation v A vertex v is corresponding to a rectangle r(v) with size a(v) y x lv rv ∆xv a(v) r(v)
SLIDE 24
Rectangles
Rectangular representation v A vertex v is corresponding to a rectangle r(v) with size a(v) y x tv bv lv rv ∆xv a(v) ∆yv r(v)
SLIDE 25
Rectangles
Rectangular representation v ∈ V r ∈ R r : V → R v v ∈ V a ∈ A a : V → A A vertex v is corresponding to a rectangle r(v) with size a(v) y x tv bv lv rv ∆xv a(v) ∆yv r(v)
SLIDE 26
Rectangles
Rectangular representation v u r(u) r(v) u, v ∈ V and uv ∈ E → r(u) and r(v) are adjacent
SLIDE 27
Faces and Corners
SLIDE 28
Faces and Corners
SLIDE 29
Faces and Corners
SLIDE 30
Faces and Corners
Not planar!
SLIDE 31
Faces and Corners
Not outerplanar!
SLIDE 32
Faces and Corners
There are only corners with at most three involved rectangles!
SLIDE 33
Placing the first two rectangles
u0 u1 u2 u3 u4 u5
SLIDE 34
Placing the first two rectangles
u0 u1 u2 u3 u4 u5 r(u0) r(u1)
SLIDE 35
Placing the first two rectangles
u0 u1 u2 u3 u4 u5 r(u0) r(u1) Draw the two rectangles neighboring each other with: the same height at the bottom and the same width bu0 = bu1 and ∆xu0 = ∆xu1
SLIDE 36
Placing the first two rectangles
u0 u1 u2 u3 u4 u5 r(u0) r(u1) If a(u0) = a(u1) we don’t get a new edge to place the next rectangle
SLIDE 37
Placing the first two rectangles
u0 u1 u2 u3 u4 u5 r(u0) r(u1) If a(u0) = a(u1) we don’t get a new edge to place the next rectangle → Reduce the width of one rectangle!
SLIDE 38
Treatment of an inner facet
u0 u1 u2 u3 u4 u5 u0 u1 u2 u3 u4 u5 r(u0) r(u1) r(u4) is adjacent to r(u0) and r(u1)
SLIDE 39
Treatment of an inner facet
u0 u1 u2 u3 u4 u5 u0 u1 u2 u3 u4 u5 r(u0) r(u1) r(u4) is adjacent to r(u0) and r(u1) r(u4) Place r(u4) on top of the rectangle with the lower top edge bu4 = tu0
SLIDE 40
Treatment of an inner facet
u0 u1 u2 u3 u4 u5 u0 u1 u2 u3 u4 u5 r(u0) r(u1) r(u4) is adjacent to r(u0) and r(u1) r(u4) bu4 = tu0 and ru4 = lu1 Place r(u4) on top of the rectangle with the lower top edge and to the left of the other one
SLIDE 41 Treatment of an inner facet
u0 u1 u2 u3 u4 u5 u0 u1 u2 u3 u4 u5 r(u0) r(u1) r(u4) is adjacent to r(u0) and r(u1) r(u4) Leave free space for the rectangles adjacent to r(u0) and r(u4)
∆xu4 = 0.5 · Free(u0)
SLIDE 42
Treatment of an inner facet
r(u4) u0 u1 u2 u3 u4 u5 u0 u1 u2 u3 u4 u5 r(u0) r(u1) What can we do if there is no free space?
SLIDE 43
Treatment of an inner facet
u0 u1 u2 u3 u4 u5 u0 u1 u2 u3 u4 u5 r(u0) r(u1) What can we do if there is no free space? r(u4) → Reduce the width of the new rectangle!
SLIDE 44
Treatment of an inner facet
u0 u1 u2 u3 u4 u5 u0 u1 u2 u3 u4 u5 r(u0) r(u1) r(u4) The new Rectangle r(u4) is adjacent to r(u0) and r(u1) Possibility to place the two rectangles neighboring r(u0) and r(u4) or r(u1) and r(u4)
SLIDE 45
Finishing the graph
u0 u1 u2 u3 u4 u5 u0 u1 u2 u3 u4 u5 r(u0) r(u1) r(u4) Choose one direction to work on first
SLIDE 46
Finishing the graph
r(u0) r(u1) r(u4) Choose one direction to work on first u0 u1 u2 u3 u4 u5 u0 u1 u2 u3 u4 u5 r(u5) Place r(u5) next to r(u0) and r(u4)
SLIDE 47
Finishing the graph
r(u0) r(u1) r(u4) Choose one direction to work on first u0 u1 u2 u3 u4 u5 u0 u1 u2 u3 u4 u5 r(u5) r(u3) Place r(u5) next to r(u0) and r(u4) Place r(u3) next to r(u1) and r(u4)
SLIDE 48
Finishing the graph
r(u0) r(u1) r(u4) Choose one direction to work on first u0 u1 u2 u3 u4 u5 u0 u1 u2 u3 u4 u5 r(u5) r(u3) r(u2) Place r(u5) next to r(u0) and r(u4) Place r(u3) next to r(u1) and r(u4) Place r(u2) next to r(u1) and r(u3)
SLIDE 49
Proof of correctness
The correctness is proved by induction on the number of rectangles placed so far.
SLIDE 50
Proof of correctness
The correctness is proved by induction on the number of rectangles placed so far. Graph Gk = (Vk, Ek) is a subgraph of the graph G = (V , E) to be drawn with
SLIDE 51
Proof of correctness
The correctness is proved by induction on the number of rectangles placed so far. Graph Gk = (Vk, Ek) is a subgraph of the graph G = (V , E) to be drawn with Vk ⊆ V and Ek = {(u, v) ∈ E | u, v ∈ Vk} and Gk has a rectangular representation with k placed rectangles.
SLIDE 52
Proof of correctness
The correctness is proved by induction on the number of rectangles placed so far. Invariant: There is a free corner for the next rectangle r(w) to be placed with w ∈ V \ Vk, in such a way that it is adjacent to its predecessors r(u) and r(v) with u, v ∈ Vk. Graph Gk = (Vk, Ek) is a subgraph of the graph G = (V , E) to be drawn with Vk ⊆ V and Ek = {(u, v) ∈ E | u, v ∈ Vk} and Gk has a rectangular representation with k placed rectangles.
SLIDE 53
Proof of correctness
The correctness is proved by induction on the number of rectangles placed so far. Graph Gk = (Vk, Ek) is a subgraph of the graph G = (V , E) to be drawn with Vk ⊆ V and Ek = {(u, v) ∈ E | u, v ∈ Vk} and Gk has a rectangular representation with k placed rectangles. Invariant: There is a free corner for the next rectangle r(w) to be placed with w ∈ V \ Vk, in such a way that it is adjacent to its predecessors r(u) and r(v) with u, v ∈ Vk.
SLIDE 54
Proof of correctness
u0 u1 u2 u3 u4 u5 r(u0) r(u1) G2
SLIDE 55
Proof of correctness
u0 u1 u2 u3 u4 u5 r(u0) r(u1) G2 The invariant is fulfilled because we have one corner where r(u4) can be placed adjacent to its predecessors r(u0) and r(u1)
SLIDE 56
Proof of correctness
u0 u1 u2 u3 u4 u5 r(u0) r(u1) G2 The invariant is fulfilled because we have one corner where r(u4) can be placed adjacent to its predecessors r(u0) and r(u1) r(u4)
SLIDE 57
Proof of correctness
r(u0) r(u1) The invariant is fulfilled because we have one corner where r(u4) can be placed adjacent to its predecessors r(u0) and r(u1) r(u4) u0 u1 u2 u3 u4 u5 G3
SLIDE 58
Proof of correctness
r(u0) r(u1) The invariant is fulfilled because we have one corner where r(u4) can be placed adjacent to its predecessors r(u0) and r(u1) r(u4) u0 u1 u2 u3 u4 u5 G3 There is a corner for r(u5) and r(u3) where they can be placed adjacent to their predecessors.
SLIDE 59
Outerplanar Graphs
Outerplanar graph: all vertices belong to the unbounded face u0 u1 u2 u3 u4 u5
SLIDE 60
Outerplanar Graphs
Outerplanar graph: all vertices belong to the unbounded face r(u0) r(u1) r(u4) r(u5) r(u3) r(u2) u0 u1 u2 u3 u4 u5
SLIDE 61
Outerplanar Graphs
Outerplanar graph: all vertices belong to the unbounded face but not all faces are triangles! r(u0) r(u1) r(u4) r(u5) r(u3) r(u2) u0 u1 u2 u3 u4 u5
SLIDE 62
Outerplanar Graphs
Outerplanar graph: all vertices belong to the unbounded face but not all faces are triangles! u0 u1 u2 u3 u4 u5 r(u1) and r(u4) are not adjacent anymore r(u0) r(u1) r(u4) r(u5) r(u3) r(u2)
SLIDE 63
Outerplanar Graphs
Outerplanar graph: all vertices belong to the unbounded face but not all faces are triangles! r(u1) and r(u4) are not adjacent anymore r(u0) r(u1) r(u4) r(u5) r(u3) r(u2) u0 u1 u2 u3 u4 u5 There are vertices that are connected with only one edge
SLIDE 64
Outerplanar Graphs
Outerplanar graph: all vertices belong to the unbounded face but not all faces are triangles! r(u1) and r(u4) are not adjacent anymore u0 u1 u2 u3 u4 u5 There are vertices that are connected with only one edge r(u0) r(u1) r(u4) r(u5) r(u3) r(u2)
SLIDE 65
Dummy-nodes
u0 u1 u2 u3 u4 u5
SLIDE 66
Dummy-nodes
u0 u1 u2 u3 u4 u5 Insert an inner dummy-node v ∈ Vi for every not triangular inner face and connect it to the surrounding vertices with vu ∈ Ei. v
SLIDE 67
Dummy-nodes
u0 u1 u2 u3 u4 u5 Insert an inner dummy-node v ∈ Vi for every not triangular inner face and connect it to the surrounding vertices with vu ∈ Ei. v Insert an outer dummy-node w ∈ Va for every separating vertex in the graph and add the edges wu ∈ Ea. w
SLIDE 68
Dummy-nodes
u0 u1 u2 u3 u4 u5 Insert an inner dummy-node v ∈ Vi for every not triangular inner face and connect it to the surrounding vertices with vu ∈ Ei. v Insert an outer dummy-node w ∈ Va for every separating vertex in the graph and add the edges wu ∈ Ea. w G ′ = (V ′, E ′) = (V ∪ Vi ∪ Va, E ∪ Ei ∪ Ea)
SLIDE 69
Placing the first two rectangles
Start with an edge in E = E ′ \ {Ea ∪ Ei} u0 u1 u2 u3 u4 u5 v w
SLIDE 70
Placing the first two rectangles
Start with an edge in E = E ′ \ {Ea ∪ Ei} u0 u1 u2 u3 u4 u5 v w r(u0) r(u1)
SLIDE 71
Placing the first two rectangles
Start with an edge in E = E ′ \ {Ea ∪ Ei} u0 u1 u2 u3 u4 u5 v w r(u0) r(u1) Differentiate between three cases: Inner dummy-node v ∈ Vi Outer dummy-node v ∈ Va Normal vertex v ∈ V = V ′ \ {Vi ∪ Va}
SLIDE 72
An inner dummy-node
u0 u1 u2 u3 u4 u5 v w r(u0) r(u1) Place the free space corresponding to the node v
SLIDE 73
An inner dummy-node
r(u0) r(u1) Place the free space corresponding to the node v Place r(v) on top of the rectangle with the lower top edge u0 u1 u2 u3 u4 u5 v w r(v)
SLIDE 74
An inner dummy-node
r(u0) r(u1) Place the free space corresponding to the node v Place r(v) on top of the rectangle with the lower top edge The top edge of r(v) must be below the top edge of r(u1) with tv = 1/2 · (tu0 + tu1) u0 u1 u2 u3 u4 u5 v w r(v)
SLIDE 75
An inner dummy-node
r(u0) r(u1) u0 u1 u2 u3 u4 u5 v w Place the free space corresponding to the node v Place r(v) on top of the rectangle with the lower top edge The top edge of r(v) must be below the top edge of r(u1) with tv = 1/2 · (tu0 + tu1) Walk clockwise around the inner dummy-node r(v)
SLIDE 76
An inner dummy-node
r(u0) r(u1) Place all following vertices on top of r(v) except the last one r(u3) u0 u1 u2 u3 u4 u5 v w r(v)
SLIDE 77
An inner dummy-node
r(u0) r(u1) Place all following vertices on top of r(v) except the last one The last but one rectangle, in this case r(u3), must fill the remaining free space on top of r(v) r(u3) u0 u1 u2 u3 u4 u5 v w r(v)
SLIDE 78
An inner dummy-node
r(u0) r(u1) Place all following vertices on top of r(v) except the last one The last but one rectangle, in this case r(u3), must fill the remaining free space on top of r(v) r(u3) r(v) The last rectangle must connect its predecessor with the first rectangle r(u4) u0 u1 u2 u3 u4 u5 v w
SLIDE 79
An inner dummy-node
r(u0) r(u1) r(u3) r(v) If r(u4) is too small to connect both rectangles reduce the width to increase its height r(u4) u0 u1 u2 u3 u4 u5 v w
SLIDE 80
An inner dummy-node
r(u0) r(u1) r(u3) r(v) r(u4) If r(u4) is too small to connect both rectangles reduce the width to increase its height u0 u1 u2 u3 u4 u5 v w All rectangles adjacent to r(v) have been placed correctly → Finally visit all adjacent faces in G ′
SLIDE 81
An outer dummy-node
u0 u1 u2 u3 u4 u5 v w r(u0) r(u1) r(u3) r(v) r(u4) Insert the outer dummy-node into the rectangular representation with size a(w) = 1
SLIDE 82
An outer dummy-node
r(u0) r(u1) r(u3) r(v) r(u4) Insert the outer dummy-node into the rectangular representation with size a(w) = 1 r(w) u0 u1 u2 u3 u4 u5 v w
SLIDE 83
An outer dummy-node
r(u0) r(u1) r(u3) r(v) r(u4) Insert the outer dummy-node into the rectangular representation with size a(w) = 1 r(w) Add the rectangle r(u2) adjacent to the dummy-node and the separating vertex r(u2) u0 u1 u2 u3 u4 u5 v w
SLIDE 84
An outer dummy-node
r(u0) r(u1) r(u3) r(v) r(u4) Insert the outer dummy-node into the rectangular representation with size a(w) = 1 r(w) Add the rectangle r(u2) adjacent to the dummy-node and the separating vertex r(u2) u0 u1 u2 u3 u4 u5 v w r(u5)
SLIDE 85
Proof of correctness for outerplanar graphs
The correctness is proved similarly to the maximal outerplanar graphs by induction on the number of placed rectangles
SLIDE 86
Proof of correctness for outerplanar graphs
The correctness is proved similarly to the maximal outerplanar graphs by induction on the number of placed rectangles Distinguish between normal node, inner and outer dummy-node: → Process all faces adjacent to a dummy-node in one step!
SLIDE 87
Proof of correctness for outerplanar graphs
The correctness is proved similarly to the maximal outerplanar graphs by induction on the number of placed rectangles Distinguish between normal node, inner and outer dummy-node: → Process all faces adjacent to a dummy-node in one step! u0 u1 u2 r(u1) r(u0) w r(w) u3 r(u2) u4 u12 u23 u34 u40 u01 r(u12) r(u3) r(u4) r(u23) r(u34) r(u40)
SLIDE 88
Proof of correctness for outerplanar graphs
u0 u1 u2 r(u1) r(u0) w r(w) u3 r(u2) u4 u12 u23 u34 u40 u01 r(u12) r(u3) r(u4) r(u23) r(u34) r(u40) Invariant: There is a free corner for the next rectangle r(w) to be placed with w ∈ V \ Vk, in such a way that it is adjacent to its predecessors r(u) and r(v) with u, v ∈ Vk.
SLIDE 89
K-outerplanar graphs
A graph is k-outerplanar if removing all vertices on the outer face in its embedding results in a (k − 1)-outerplanar graph
SLIDE 90
K-outerplanar graphs
A graph is k-outerplanar if removing all vertices on the outer face in its embedding results in a (k − 1)-outerplanar graph u0 u1 u2 u3 u4 u5 G
SLIDE 91
K-outerplanar graphs
A graph is k-outerplanar if removing all vertices on the outer face in its embedding results in a (k − 1)-outerplanar graph G is a 2-outerplanar graph: removing all vertices on the unbounded face results in a 1-outerplanar graph u1 u4 u5 G
SLIDE 92
K-outerplanar graphs
A graph is k-outerplanar if removing all vertices on the outer face in its embedding results in a (k − 1)-outerplanar graph u0 u1 u2 u3 u4 u5 G G is a 2-outerplanar graph: removing all vertices on the unbounded face results in a 1-outerplanar graph
SLIDE 93
K-outerplanar graphs
A graph is k-outerplanar if removing all vertices on the outer face in its embedding results in a (k − 1)-outerplanar graph u0 u1 u2 u3 u4 u5 G G is a 2-outerplanar graph: removing all vertices on the unbounded face results in a 1-outerplanar graph r(u5) r(u1) r(u2) r(u3) r(u4)
SLIDE 94
K-outerplanar graphs
A graph is k-outerplanar if removing all vertices on the outer face in its embedding results in a (k − 1)-outerplanar graph u0 u1 u2 u3 u4 u5 G G is a 2-outerplanar graph: removing all vertices on the unbounded face results in a 1-outerplanar graph r(u5) r(u1) r(u2) r(u3) r(u4) It is not possible to draw r(u0) adjacent to all rectangles surrounding r(u5)!
SLIDE 95
K-outerplanar graphs
A graph is k-outerplanar if removing all vertices on the outer face in its embedding results in a (k − 1)-outerplanar graph u0 u1 u2 u3 u4 u5 G G is a 2-outerplanar graph: removing all vertices on the unbounded face results in a 1-outerplanar graph r(u5) r(u1) r(u2) r(u3) r(u4) It is not possible to draw r(u0) adjacent to all rectangles surrounding r(u5)! There are 2-outerplanar graphs, which can not be drawn!
SLIDE 96
Recapitulation
Draw the rectangles with the desired size
SLIDE 97
Recapitulation
Draw the rectangles with the desired size No need for a surrounding rectangle
SLIDE 98
Recapitulation
Draw the rectangles with the desired size No need for a surrounding rectangle Extension to general graph classes
SLIDE 99
Recapitulation
Draw the rectangles with the desired size No need for a surrounding rectangle Extension to general graph classes Every rectangular representation is possible to draw
SLIDE 100
Recapitulation
Draw the rectangles with the desired size No need for a surrounding rectangle Extension to general graph classes Every rectangular representation is possible to draw
SLIDE 101
Recapitulation
Draw the rectangles with the desired size No need for a surrounding rectangle Extension to general graph classes Every rectangular representation is possible to draw Future work: Improve the aspect ratio of the rectangles with a better distribution of the free space on top of the rectangles
SLIDE 102
Recapitulation
Draw the rectangles with the desired size No need for a surrounding rectangle Extension to general graph classes Every rectangular representation is possible to draw Future work: Improve the aspect ratio of the rectangles with a better distribution of the free space on top of the rectangles Consider other graph classes, e.g. series-parallel graphs
SLIDE 103
Recapitulation
Draw the rectangles with the desired size No need for a surrounding rectangle Extension to general graph classes Every rectangular representation is possible to draw Future work: Improve the aspect ratio of the rectangles with a better distribution of the free space on top of the rectangles Consider other graph classes, e.g. series-parallel graphs Thank you for your attention! Questions?