Title: Orthogonal Drawings of SeriesParallel Graphs
1Orthogonal Drawings of Series-Parallel Graphs
by
Takao Nishizeki
Joint work with Xiao Zhou
Tohoku University
2Orthogonal Drawings of Series-Parallel Graphs
with Minimum Bends
by
Xiao Zhou and Takao Nishizeki
Tohoku University
planar graph
3Orthogonal Drawings of Series-Parallel Graphs
with Minimum Bends
by
Xiao Zhou and Takao Nishizeki
Tohoku University
planar graph
orthogonal drawings
4Orthogonal Drawings of Series-Parallel Graphs
with Minimum Bends
- each vertex is mapped to a point
- each edge is drawn as a sequence of alternate
horizontal and vertical line segments - any two edges dont cross except at their common
ends
by
Xiao Zhou and Takao Nishizeki
Tohoku University
crossing
planar graph
orthogonal drawings
5Orthogonal Drawings of Series-Parallel Graphs
with Minimum Bends
another embedding
- each vertex is mapped to a point
- each edge is drawn as a sequence of alternate
horizontal and vertical line segments - any two edges dont cross except at their common
ends
by
one bend
no bend
Xiao Zhou and Takao Nishizeki
Tohoku University
bend
planar graph
orthogonal drawings
6Optimal orthogonal drawing
An orthogonal drawing of a planar graph G is
optimal if it has the minimum of bends among
all possible orthogonal drawings of G.
one bend
no bend
bend
planar graph
orthogonal drawings
optimal
7Example
4 bends
8Example
4 bends
Optimal ?
No
9Example
4 bends
flip
10Example
4 bends
flip
11Example
4 bends
flip
12Example
4 bends
flip
13Example
4 bends
14Example
4 bends
0 bend
optimal
15Example
Given a planar graph
4 bends
Wish to find an optimal orthogonal drawing
0 bend
optimal
16Optimal orthogonal drawing
An orthogonal drawing of a planar graph G is
optimal if it has the minimum of bends among
all possible orthogonal drawings of G.
17Known results
The problem
NP-complete for planar graphs of ??4
A. Garg, R. Tamassia, 2001
d(v)2
2
2
d(v)3
2
2
3
2
3
18Known results
The problem
NP-complete for planar graphs of ??4
A. Garg, R. Tamassia, 2001
D. Battista, et al. 1998
where n of vertices
?3, n7
19Known results
The problem
NP-complete for planar graphs of ??4
A. Garg, R. Tamassia, 2001
If ??3,
O(n5logn) time
D. Battista, et al. 1998
For biconnected series-parallel graphs
20Connected graphs ?
For biconnected series-parallel graphs
21Connected graphs
Non-connected graphs
For biconnected series-parallel graphs
22Connected graphs
Non-connected graphs
Biconnected graphs
23Known results
The problem
NP-complete for planar graphs of ??4
A. Garg, R. Tamassia, 2001
If ??3,
O(n5logn) time
D. Battista, et al. 1998
For biconnected series-parallel graphs
24Our results
For series-parallel (multiple) graphs
O(n) time
our result
If ??3,
25Our results
For series-parallel graphs
O(n) time
our result
If ??3,
26Series-Parallel Graphs
A SP graph is recursively defined as follows
(a)
is a SP graph.
a single edge
(b)
are SP graphs,
if
are SP graphs
then
27Series-Parallel Graphs
A SP graph is recursively defined as follows
(a)
is a SP graph.
a single edge
(b)
are SP graphs,
if
are SP graphs
then
28Series-Parallel Graphs
A SP graph is recursively defined as follows
(a)
is a SP graph.
a single edge
(b)
are SP graphs,
if
are SP graphs
then
29Series-Parallel Graphs
A SP graph is recursively defined as follows
(a)
is a SP graph.
a single edge
(b)
are SP graphs,
if
are SP graphs
then
parallel-connection
30Series-Parallel Graphs
A SP graph is recursively defined as follows
(a)
is a SP graph.
a single edge
(b)
are SP graphs,
if
are SP graphs
then
series-connection
parallel-connection
31Series-Parallel Graphs
A SP graph is recursively defined as follows
(a)
is a SP graph.
a single edge
(b)
are SP graphs,
if
are SP graphs
then
parallel-connection
series-connection
32Series-Parallel Graphs
A SP graph is recursively defined as follows
(a)
is a SP graph.
a single edge
(b)
are SP graphs,
if
are SP graphs
then
33Series-Parallel Graphs
Example
SP graph
34Series-Parallel Graphs
Example
SP graph
series-connection
35Series-Parallel Graphs
Example
SP graph
parallel-connection
36Series-Parallel Graphs
Example
SP graph
Series-connection
37Series-Parallel Graphs
Example
SP graph
Parallel-connection
38Series-Parallel Graphs
Biconnected graphs G G v is connected for
each vertex v.
Example
v
v
SP graph
biconnected
Biconnected SP graphs
39Series-Parallel Graphs
Biconnected graphs G G v is connected for
each vertex v.
Example
v
SP graph
biconnected
not biconnected
Biconnected SP graphs
40Series-Parallel Graphs
Example
41Series-Parallel Graphs
A SP graph is recursively defined as follows
(a)
is a SP graph.
a single edge
(b)
are SP graphs,
if
are SP graphs
then
42Lemma 1
(Our Main Idea)
Every biconnected SP graph G of ??3 has one of
the following three substructures (a) a
diamond C (b) two adjacent vertices u and v
s.t. d(u)d(v)2 (c) a triangle K3.
43Lemma 1
(Our Main Idea)
Every biconnected SP graph G of ??3 has one of
the following three substructures (a) a
diamond C (b) two adjacent vertices u and v
s.t. d(u)d(v)2 (c) a triangle K3.
u v
K3
(a)
(b)
(c)
44Algorithm(G)
Let G be a biconnected SP graph of ??3. Case (a)
? a diamond ,
Recursively find an optimal drawing.
45Algorithm(G)
Let G be a biconnected SP graph of ??3. Case (a)
? a diamond ,
Return
expand
Algorithm( ),
expand
optimal
optimal
46Algorithm(G)
Let G be a biconnected SP graph of ??3. Case (a)
? a diamond ,
Return
expand
Algorithm( ),
expand
Example
optimal
optimal
drawing
47Algorithm(G)
Let G be a biconnected SP graph of ??3. If n(G)lt
6, Then find an optimal drawing of G Else If ? a
diamond , Then
Algorithm( ),
Return
optimal
optimal
48Algorithm(G)
Let G be a biconnected SP graph of ??3. If n(G)lt
6, Then find an optimal drawing of G Else If ? a
diamond , Then
Algorithm( ),
Example
Find an optimal drawing of SP graphs without
diamonds
49Algorithm(G)
Let G be a biconnected SP graph of ??3. If n(G)lt
6, Then find an optimal drawing of G Else If ? a
diamond , Then
Algorithm( ),
Example
Find an optimal drawing of SP graphs without
diamonds
50Algorithm(G)
Let G be a biconnected SP graph of ??3. Case (a)
? a diamond ,
Return
expand
Algorithm( ),
Case (b) ?
51deg1 deg1
2-legged SP
Case (b) ?
Find an opt U-shape
52Our Main Idea
Definition of I- , L- and U-shaped drawings
- terminals are drawn on the outer face
- the drawing except terminals doesnt intersect
the north side
I-shape
L-shape
U-shape
53Our Main Idea
Definition of I- , L- and U-shaped drawings
- terminals are drawn on the outer face
- the drawing except terminals intersects neither
the north side nor the south side
L-shape
U-shape
I-shape
54Our Main Idea
Definition of I- , L- and U-shaped drawings
- terminals are drawn on the outer face
- the drawing except terminals intersects neither
the north side nor the east side
I-shape
L-shape
U-shape
55Lemma 2
Every 2-legged SP graph without diamond has
optimal I-, L- and U-shaped drawings
56Lemma 2
Every 2-legged SP graph without diamond has
optimal I-, L- and U-shaped drawings
57parallel connection
series connection
decompose
deg1 deg1
2-legged SP
? ? 3
Case (b) ?
Find an opt U-shape
58opt U-shape
opt L-shape
opt L-shape
opt L-shape
opt U-shape
Case (b) ?
Find an opt U-shape
59opt U-shape
opt I-shape
opt U-shape
opt U-shape
opt U-shape
opt I-shape
Case (b) ?
Find an opt U-shape
60opt U-shape
opt I-shape
Return an optimal drawing
opt U-shape
opt U-shape
opt I-shape
Case (b) ?
extend
Find an opt U-shape
61Example
Else If? Then
62series connection
Example
U-shape
Recursively find L-shaped drawings
63parallel connection
Example
I-shape
U-shape
recursively
L-shape
I-shape
U-shape
64Example
65Algorithm(G)
Return optimal drawing
Let G be a biconnected SP graph of ??3. Case (a)
? a diamond ,
expand
Algorithm( ),
Case (b) ?
opt U-shape
Case (c)? a complete graph K3.
bend
66Algorithm(G)
Let G be a biconnected SP graph of ??3. If n(G)lt
6, Then find an optimal drawing of G Else If ? a
diamond , Then
Algorithm( ),
Else If? two adjacent vertices u,v s.t.
d(u)d(v)2 Then
Find an optimal drawing of SP graphs without
diamonds
Else? a complete graph K3.
67Algorithm(G)
Let G be a biconnected SP graph of ??3. If n(G)lt
6, Then find an optimal drawing of G Else If ? a
diamond , Then
Algorithm( ),
Else If? two adjacent vertices u,v s.t.
d(u)d(v)2 Then
Else? a complete graph K3.
68Conclusions
Theorem 1
An optimal orthogonal drawing of a biconnected SP
graph G of ??3 can be found in linear time.
bend
69Theorem 1
An optimal orthogonal drawing of a biconnected SP
graph G of ??3 can be found in linear time.
704 bends
3 bends
2 bends
71Conclusions
Theorem 1
An optimal orthogonal drawing of a SP graph G of
??3 can be found in linear time.
72Conclusions
bend(G)? n/3
for biconnected SP graphs G of ??3
Grid size ? 8n/9
73Thank You
74Optimal orthogonal drawing
planar graph
Optimal orthogonal drawings ?
75Optimal orthogonal drawing
1-connected SP graph
a 2-bend orthogonal drawing
?a one-bend orthogonal drawing ?
Is this optimal ?
76Optimal orthogonal drawing
1-connected SP graph
?a one-bend orthogonal drawing ?
bend
optimal
not optimal
77one bend
Yes
?a one-bend orthogonal drawing ?
?a 0-bend orthogonal drawing ?
bend
one bend
no bend
Is this optimal ?
optimal
not optimal
78Optimal orthogonal drawing
1-connected SP graph
?a 0-bend orthogonal drawing ?
0 bend
orthogonal drawings
optimal
79Optimal orthogonal drawing
1-connected SP graph
?a 0-bend orthogonal drawing ?
0 bend
0 bend
orthogonal drawings
optimal
optimal
80Optimal orthogonal drawing
1-connected SP graph
No
?a 0-bend orthogonal drawing ?
crossing
crossing
no bend
no bend
optimal
optimal
81one bend optimal
1-connected SP graph
bend
bend
bend
two bends
82Conclusions
Theorem 1
An optimal orthogonal drawing of a biconnected SP
graph G of ??3 can be found in linear time.
1-connected SP graph
83Conclusions
bend(G)? n/3
for biconnected SP graphs G of ??3
Grid size ? 8n/9
84Conclusions
Our algorithm works well even if G is not
biconnected.
Best possible
bend(G) (n 8)/3 4 (n 4)/3
85For series-parallel graphs G with ?4
Is there an O(n)-time algorithm to find an
optimal orthogonal drawing of G ?
open
no optimal U-shape
optimal I-shape
optimal L-shape
86(No Transcript)
87Our Main Idea
2-legged SP graph
A SP graph G is 2-legged if n(G)?3 and
d(s)d(t)1 for the terminals s and t.
88Our Main Idea
2-legged SP graph
A SP graph G is 2-legged if n(G)?3 and
d(s)d(t)1 for the terminals s and t.
s
t
Definition of I- , L- and U-shaped drawings
- terminals are drawn on the outer face
- the drawing except terminals intersects neither
the north side nor the south side
L-shape
U-shape
I-shape
89Our Main Idea
2-legged SP graph
A SP graph G is 2-legged if n(G)?3 and
d(s)d(t)1 for the terminals s and t.
Definition of I- , L- and U-shaped drawings
- terminals are drawn on the outer face
- the drawing except terminals intersects neither
the north side nor the east side
I-shape
L-shape
U-shape
90Our Main Idea
2-legged SP graph
A SP graph G is 2-legged if n(G)?3 and
d(s)d(t)1 for the terminals s and t.
t
t
s
Definition of I- , L- and U-shaped drawings
- terminals are drawn on the outer face
- the drawing except terminals doesnt intersect
the north side
I-shape
L-shape
U-shape
91Lemma 2
The following (a) and (b) hold for a 2-legged SP
graph G of ??3 unless G has a diamond (a) G
has three optimal I-, L- and
U-shaped drawings (b) such drawings can be
found in linear time.
optimal U-shaped drawings
optimal I-shaped drawings
92Lemma 2
The following (a) and (b) hold for a 2-legged SP
graph G of ??3 unless G has a diamond (a) G
has three optimal I-, L- and
U-shaped drawings (b) such drawings can be
found in linear time.
93Definition of Diamond Graph
A Diamond graph is recursively defined as follows
(a)
is a diamond graph.
a path with three vertices
(b)
are diamond graphs,
if
is a diamond graph
then
94Definition of Diamond Graph
A Diamond graph is recursively defined as follows
(a)
is a diamond graph.
a path with three edges
(b)
are diamond graphs,
if
is a diamond graph
then
95Diamond Graph
(a)
is a diamond graph.
(b)
If and
are diamond graphs,
then
is a diamond graph
96Diamond Graph
(a)
is a diamond graph.
(b)
If and
are diamond graphs,
then
is a diamond graph
97Lemma 1
If G is a diamond graph, then (a) G has both
a no-bend I-shaped drawing
and a no-bend L-shaped drawing (b)
every no-bend drawing is either I-shaped or
L-shaped.
?no-bend U-shaped drawing ?
NO
98Lemma 1
If G is a diamond graph, then (a) G has both
a no-bend I-shaped drawing
and a no-bend L-shaped drawing (b)
every no-bend drawing is either I-shaped or
L-shaped.
no-bend I-shaped drawings
99Lemma 1
If G is a diamond graph, then (a) G has both
a no-bend I-shaped drawing
and a no-bend L-shaped drawing (b)
every no-bend drawing is either I-shaped or
L-shaped.
Such drawings can be found in linear time.
L-shaped
I-shaped
no-bend I-shaped drawings
100Lemma 2
The following (a) and (b) hold for a 2-legged SP
graph G of ??3 unless G is a diamond graph (a)
G has three optimal I-, L- and
U-shaped drawings (b) such drawings can be
found in linear time.
diamond graph
not a diamond graph
no-bend drawing
101Lemma 2
The following (a) and (b) hold for a 2-legged SP
graph G of ??3 unless G is a diamond graph (a)
G has three optimal I-, L- and
U-shaped drawings (b) such drawings can be
found in linear time.
102Lemma 2
The following (a) and (b) hold for a 2-legged SP
graph G of ??3 unless G is a diamond graph (a)
G has three optimal I-, L- and
U-shaped drawings (b) such drawings can be
found in linear time.
103Lemma 2
The following (a) and (b) hold for a 2-legged SP
graph G of ??3 unless G is a diamond graph (a)
G has three optimal I-, L- and
U-shaped drawings (b) such drawings can be
found in linear time.
104Known results
In the fixed embedding setting
n of vertices
For plane graph
Min-cost flow problem
105Known results
In the fixed embedding setting
n of vertices
For plane graph
improved
106Known results
In the fixed embedding setting
For plane graph
In the variable embedding setting
NP-complete for planar graphs of ??4
A. Garg, R. Tamassia, 2001
107Known results
In the fixed embedding setting
For plane graph
O(n2logn) time
R. Tamassia, 1987
O(n7/4 logn) time
A. Garg, R. Tamassia, 1997
In the variable embedding setting
NP-complete for planar graphs of ??4
A. Garg, R. Tamassia, 2001
If ??3,
O(n5logn) time
D. Battista, et al. 1998
108Lemma 3
Every biconnected SP graph G of ??3 has one of
the following three substructures (a) a
diamond C (b) two adjacent vertices u and v
s.t. d(u)d(v)2 (c) a complete graph K3.
(a) G
109Lemma 1
(Our Main Idea)
Every biconnected SP graph G of ??3 has one of
the following three substructures (a) a
diamond (b) two adjacent vertices u and v
s.t. d(u)d(v)2 (c) a complete graph K3.
110Proof
G
111Proof
bend(G)?bend(G )
G
112Given an optimal drawing of G
Proof
bend(G)?bend(G )
G
Case 1 bend( ) 0
Case 2 bend( ) 1
omitted
Case 3 bend( ) ? 2
113Lemma 1
(Our Main Idea)
Every biconnected SP graph G of ??3 has one of
the following three substructures (a) a
diamond (b) two adjacent vertices u and v
s.t. d(u)d(v)2 (c) a complete graph K3.
?an optimal U-shape drawing
u v
G
No diamonds
114Lemma 2
For each SP graph G If n ? 4, ??3 and
d(s)d(t)1, then ?an optimal U-shape drawing
bend(G)bend(G )
?an optimal U-shape drawing
u v
G
No diamonds
115Our Main Idea
2-legged SP graph
A SP graph G is 2-legged if n(G)?3 and
d(s)d(t)1 for the terminals s and t.
U-shape
s
t
U-shape
Definition of I- , L- and U-shaped drawings
- terminals are drawn on the outer face
- the drawing except terminals doesnt intersect
the north side
I-shape
L-shape
U-shape
116Lemma 1
(Our Main Idea)
Every biconnected SP graph G of ??3 has one of
the following three substructures (a) a
diamond (b) two adjacent vertices u and v
s.t. d(u)d(v)2 (c) a complete graph K3.
?an optimal U-shape drawing
K3
G
No diamonds
117Lemma 2
For each SP graph G If n ? 4, ??3 and
d(s)d(t)1, then ?an optimal U-shape drawing
?an optimal U-shape drawing
K3
G
No diamonds
118Optimal orthogonal drawing
1-connected planar graph
non
Optimal orthogonal drawings ?
119parallel connection
series connection
deg1 deg1
2-leg SP
Case (b) ?
Find an opt U-shape