Orthogonal Drawings of Series-Parallel Graphs Joint work with Xiao Zhou by Tohoku University Takao Nishizeki
Orthogonal Drawings of Series-Parallel Graphs with Minimum Bends Xiao Zhou and Takao Nishizeki by Tohoku University 1.each vertex is mapped to a point 2.each edge is drawn as a sequence of alternate horizontal and vertical line segments 3.any two edges don’t cross except at their common ends planar graph orthogonal drawings
Orthogonal Drawings of Series-Parallel Graphs with Minimum Bends Xiao Zhou and Takao Nishizeki by Tohoku University 1.each vertex is mapped to a point 2.each edge is drawn as a sequence of alternate horizontal and vertical line segments 3.any two edges don’t cross except at their common ends planar graphorthogonal drawings bend one bend
Orthogonal Drawings of Series-Parallel Graphs with Minimum Bends Xiao Zhou and Takao Nishizeki by Tohoku University 1.each vertex is mapped to a point 2.each edge is drawn as a sequence of alternate horizontal and vertical line segments 3.any two edges don’t cross except at their common ends planar graphorthogonal drawings crossing
Orthogonal Drawings of Series-Parallel Graphs with Minimum Bends Xiao Zhou and Takao Nishizeki by Tohoku University 1.each vertex is mapped to a point 2.each edge is drawn as a sequence of alternate horizontal and vertical line segments 3.any two edges don’t cross except at their common ends planar graphorthogonal drawings one bendno bend another embedding bend
An orthogonal drawing of a planar graph G is optimal if it has the minimum # of bends among all possible orthogonal drawings of G. orthogonal drawings one bendno bend Optimal orthogonal drawing optimal planar graph bend via-hole, through-hole VLSI design
Example 4 bends Orthogonal Drawings drawing bend
Example 4 bends Orthogonal Drawings drawing bend Optimal ? No
Example embedding Orthogonal Drawings drawing bend flip 4 bends
Example embedding flip 4 bends Orthogonal Drawings drawing bend
Example embedding flip 4 bends Orthogonal Drawings drawing bend
Example embedding flip 4 bends Orthogonal Drawings drawing bend
Example embedding 4 bends Orthogonal Drawings drawing bend
Example drawing embedding 0 bend optimal 4 bends Orthogonal Drawings drawing bend
Orthogonal Drawings drawing bend 4 bends Example drawing embedding 0 bend optimal Given a planar graph Wish to find an optimal orthogonal drawing Find an optimal orthogonal drawing of a given planar graph. Problem
An orthogonal drawing of a planar graph G is optimal if it has the minimum # of bends among all possible orthogonal drawings of G. Optimal orthogonal drawing Find an optimal orthogonal drawing of a given planar graph. Problem
where degree of vertex v: # of edges incident to v Δ : max degree Δ =3, n=7 Known results The problem: NP-complete for planar graphs of Δ ≦ 4 A. Garg, R. Tamassia, 2001 If Δ ≧ 5, then no orthogonal drawing. d(v)=2 d(v)=
Known results The problem: NP-complete for planar graphs of Δ ≦ 4 A. Garg, R. Tamassia, 2001 D. Battista, et al If Δ ≦ 3, O( n 5 log n ) time where n: # of vertices Δ =3, n=7
Known results The problem: NP-complete for planar graphs of Δ ≦ 4 A. Garg, R. Tamassia, 2001 If Δ ≦ 3, O( n 5 log n ) time D. Battista, et al If Δ ≦ 4, O( n 4 ) time If Δ ≦ 3, O( n 3 ) time D. Battista, et al For biconnected series-parallel graphs
If Δ ≦ 4, O( n 4 ) time If Δ ≦ 3, O( n 3 ) time D. Battista, et al For biconnected series-parallel graphs Connected graphs ?
If Δ ≦ 4, O( n 4 ) time If Δ ≦ 3, O( n 3 ) time D. Battista, et al For biconnected series-parallel graphs Connected graphsNon-connected graphs
Connected graphsNon-connected graphs Biconnected graphs
Known results The problem: NP-complete for planar graphs of Δ ≦ 4 A. Garg, R. Tamassia, 2001 If Δ ≦ 3, O( n 5 log n ) time D. Battista, et al If Δ ≦ 4, O( n 4 ) time If Δ ≦ 3, O( n 3 ) time D. Battista, et al For biconnected series-parallel graphs
Our results If Δ ≦ 3, O( n ) time our result For series-parallel (multiple) graphs Non-connectedConnected
Our results If Δ ≦ 3, O( n ) time our result much simpler and faster than the known algorithms For series-parallel graphs
Series-Parallel Graphs (a) if are SP graphs, is a SP graph. then are SP graphs A SP graph is recursively defined as follows: (b) a single edge
Series-Parallel Graphs (a) if are SP graphs, is a SP graph. then are SP graphs A SP graph is recursively defined as follows: (b) a single edge
Series-Parallel Graphs (a) if are SP graphs, is a SP graph. then are SP graphs A SP graph is recursively defined as follows: (b) a single edge
parallel-connection Series-Parallel Graphs (a) if are SP graphs, is a SP graph. then are SP graphs A SP graph is recursively defined as follows: (b) a single edge
series-connectionparallel-connection Series-Parallel Graphs (a) if are SP graphs, is a SP graph. then are SP graphs A SP graph is recursively defined as follows: (b) a single edge
parallel-connectionseries-connection Series-Parallel Graphs (a) if are SP graphs, is a SP graph. then are SP graphs A SP graph is recursively defined as follows: (b) a single edge
Series-Parallel Graphs (a) if are SP graphs, is a SP graph. then are SP graphs A SP graph is recursively defined as follows: (b) a single edge
Series-Parallel Graphs Example SP graph
Series-Parallel Graphs Example SP graph series-connection
Series-Parallel Graphs Example SP graph parallel-connection
Series-Parallel Graphs Example SP graph Series-connection
Series-Parallel Graphs Example SP graph Parallel-connection
Series-Parallel Graphs Example Biconnected SP graphs SP graph biconnected Biconnected graphs G : G – v is connected for each vertex v. vv
Series-Parallel Graphs Example SP graph biconnected Biconnected graphs G : G – v is connected for each vertex v. not biconnected v Biconnected SP graphs cut vertex
Series-Parallel Graphs Example SP graphs biconnected
Series-Parallel Graphs (a) if are SP graphs, is a SP graph. then are SP graphs A SP graph is recursively defined as follows: (b) a single edge
(Our Main Idea) Lemma 1 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 K 3. (a) u v (b) K3K3 (c)
(Our Main Idea) Lemma 1 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 K 3. (a) u v K3K3 (b)(c)
Algorithm( G ) Let G be a biconnected SP graph of Δ ≦ 3. Case (a): ∃ a diamond, Recursively find an optimal drawing. Case (b): ∃ Decompose to smaller subgraphs in series or parallel, and iteratively find an optimal drawing Case (c): ∃ Similar as Case (b).
Let G be a biconnected SP graph of Δ ≦ 3. Case (a): ∃ a diamond, Algorithm( G ) Algorithm( ), Recur G to a smaller one find optimal contract Return expand
Let G be a biconnected SP graph of Δ ≦ 3. Case (a): ∃ a diamond, Algorithm( G ) Algorithm( ), find optimal contract Return expand contract Example contract drawing
Algorithm( G ) Let G be a biconnected SP graph of Δ ≦ 3. If n ( G )< 6, Then find an optimal drawing of G Else If ∃ a diamond, Then Algorithm( ), Recur G to a smaller one find optimal contract Return
Algorithm( G ) Let G be a biconnected SP graph of Δ ≦ 3. If n ( G )< 6, Then find an optimal drawing of G Else If ∃ a diamond, Then Algorithm( ), Example Find an optimal drawing of SP graphs without diamonds
Algorithm( G ) Let G be a biconnected SP graph of Δ ≦ 3. If n ( G )< 6, Then find an optimal drawing of G Else If ∃ a diamond, Then Algorithm( ), Example Find an optimal drawing of SP graphs without diamonds
delete edge Let G be a biconnected SP graph of Δ ≦ 3. Case (a): ∃ a diamond, Algorithm( G ) Algorithm( ), find contract Return expand Case (b): ∃
deg=1 2-legged SP Find an opt & U-shape delete edge Case (b): ∃
terminals are drawn on the outer face; the drawing except terminals doesn’t intersect the north side Our Main Idea Definition of I-, L- and U-shaped drawings I-shapeL-shapeU-shape 2-legged SP graph s t U-shape
Our Main Idea 2-legged SP graph s t Definition of I-, L- and U-shaped drawings L-shapeU-shape terminals are drawn on the outer face; the drawing except terminals intersects neither the north side nor the south side I-shape
terminals are drawn on the outer face; the drawing except terminals intersects neither the north side nor the east side Our Main Idea Definition of I-, L- and U-shaped drawings I-shapeL-shapeU-shape 2-legged SP graph s t L-shape
Lemma 2 Every 2-legged SP graph without diamond has optimal I-, L- and U-shaped drawings optimal I-shapeL-shape optimal U-shape optimal
Lemma 2 Every 2-legged SP graph without diamond has optimal I-, L- and U-shaped drawings I-shape optimal bend L-shape optimal bend U-shape optimal bend
Δ ≦ 3 deg=1 2-legged SP Find an opt & U-shape parallel connection series connection delete edge Case (b): ∃ decompose
opt & L-shape opt & U-shape opt & L-shape Find an opt & U-shape delete edge Case (b): ∃
opt & U-shape opt & I-shape opt & U-shape opt & I-shape opt & U-shape Find an opt & U-shape delete edge Case (b): ∃
opt & U-shape opt & I-shape opt & U-shape opt & I-shape Find an opt & U-shape delete edge Return an optimal drawing extend Case (b): ∃
Example How to find an optimal U-shaped drawing ? Else If ∃ Then
Example Recursively find L-shaped drawings series connection U-shape
Example parallel connection recursively L-shapeI-shapeU-shape I-shapeU-shape
Example
Algorithm( ), Algorithm( G ) u v Case (c): ∃ a complete graph K 3. opt & U-shape Return optimal drawing bend expand Let G be a biconnected SP graph of Δ ≦ 3. Case (a): ∃ a diamond, contraction Case (b): ∃
Algorithm( G ) Let G be a biconnected SP graph of Δ ≦ 3. If n ( G )< 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 u v Else ∃ a complete graph K 3. Find an optimal drawing of SP graphs without diamonds
Algorithm( G ) Let G be a biconnected SP graph of Δ ≦ 3. If n ( G )< 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 u v Else ∃ a complete graph K 3.
An optimal orthogonal drawing of a biconnected SP graph G of Δ ≦ 3 can be found in linear time. multiple edges Our algorithm works well even if G has multiple edges Theorem 1 Conclusions bend
An optimal orthogonal drawing of a biconnected SP graph G of Δ ≦ 3 can be found in linear time. Theorem 1
An optimal orthogonal drawing of a biconnected SP graph G of Δ ≦ 3 can be found in linear time. Theorem 1 Our algorithm works well even if G is not biconnected. find three types of drawings best one of Optimal drawing = bend 4 bends 2 bends 3 bends
An optimal orthogonal drawing of a SP graph G of Δ ≦ 3 can be found in linear time. Theorem 1 Conclusions
bend( G ) ≦ n /3 for biconnected SP graphs G of Δ ≦ 3 Grid size ≦ 8 n /9 =width + height width height
Optimal orthogonal drawings ? Optimal orthogonal drawing planar graph
a 2-bend orthogonal drawing Optimal orthogonal drawing 1-connected SP graph not optimal one bend bend not optimal one bend bend Is this optimal ? ∃ a one-bend orthogonal drawing ?
Optimal orthogonal drawing one bend no bend optimalnot optimal bend ∃ a one-bend orthogonal drawing ? 1-connected SP graph
Yes one bend no bend optimalnot optimal bend ∃ a one-bend orthogonal drawing ? Is this optimal ? ∃ a 0-bend orthogonal drawing ?
orthogonal drawings Optimal orthogonal drawing 0 bend optimal ∃ a 0-bend orthogonal drawing ? 1-connected SP graph
0 bend Optimal orthogonal drawing optimal 0 bend optimal ∃ a 0-bend orthogonal drawing ? orthogonal drawings 1-connected SP graph
Optimal orthogonal drawing No optimal no bend optimal no bend crossing ∃ a 0-bend orthogonal drawing ? 1-connected SP graph
one bend optimal bend two bends bend 1-connected SP graph
An optimal orthogonal drawing of a biconnected SP graph G of Δ ≦ 3 can be found in linear time. Theorem 1 Conclusions Our algorithm works well even if G is not biconnected. min # of bends min # of bends = 1-connected SP graph
Conclusions bend( G ) ≦ n /3 for biconnected SP graphs G of Δ ≦ 3 Grid size ≦ 8 n /9 =width + height width height
Conclusions bend( G ) ≦ ( n +4)/3for SP graphs G of Δ ≦ 3 Our algorithm works well even if G is not biconnected. Best possible bend( G )= ( n – 8)/3 + 4 = ( n +4)/3 bend
Is there an O( n )-time algorithm to find an optimal orthogonal drawing of G ? For series-parallel graphs G with Δ =4 open s t s t s t s t s t s t optimal I-shape optimal L-shape no optimal U-shape
Optimal drawing
Our 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
Our 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 L-shapeU-shape terminals are drawn on the outer face; the drawing except terminals intersects neither the north side nor the south side I-shape
terminals are drawn on the outer face; the drawing except terminals intersects neither the north side nor the east side Our 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 I-shapeL-shapeU-shape s L-shape t
terminals are drawn on the outer face; the drawing except terminals doesn’t intersect the north side Our 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 I-shapeL-shapeU-shape t not U-shapeU-shape
Lemma 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
Lemma 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 I-shapeL-shape optimal U-shape optimal
Definition of Diamond Graph (a) if are diamond graphs, is a diamond graph. then is a diamond graph A Diamond graph is recursively defined as follows: (b) a path with three vertices
Definition of Diamond Graph (a) if are diamond graphs, is a diamond graph. then is a diamond graph A Diamond graph is recursively defined as follows: (b) a path with three edges
Diamond Graph (a) is a diamond graph. If and are diamond graphs, (b) then is a diamond graph
Diamond Graph (a) is a diamond graph. If and are diamond graphs, (b) then is a diamond graph
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. Lemma 1 I-shape L-shape ∃ no-bend U-shaped drawing ? NO 1-bend U-shaped drawing
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. Lemma 1 no-bend I-shaped drawings
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. I-shaped L-shaped Lemma 1 no-bend I-shaped drawings Such drawings can be found in linear time.
Lemma 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. I-shape L-shape diamond graph no-bend drawing I-shape L-shape not a diamond graph U-shape
Lemma 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. Proof: by an induction on # of vertices. Parallel-connection Series-connection Suppose that the lemma holds true for and
Lemma 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. optimal U-shaped drawings optimal I-shaped drawings
Lemma 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. Proof: by an induction on # of vertices. Parallel-connection Series-connection Suppose that the lemma holds true for and
Known results In the fixed embedding setting: Min-cost flow problem n : # of vertices For plane graph: O( n 2 log n ) time R. Tamassia, 1987
Known results In the fixed embedding setting: improved n : # of vertices For plane graph: O( n 2 log n ) time R. Tamassia, 1987 O( n 7/4 log n ) time A. Garg, R. Tamassia, 1997
Known results In the fixed embedding setting: For plane graph: O( n 2 log n ) time R. Tamassia, 1987 O( n 7/4 log n ) time A. Garg, R. Tamassia, 1997 In the variable embedding setting: NP-complete for planar graphs of Δ ≦ 4 A. Garg, R. Tamassia, 2001
Known results In the fixed embedding setting: For plane graph: O( n 2 log n ) time R. Tamassia, 1987 O( n 7/4 log n ) 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( n 5 log n ) time D. Battista, et al. 1998
Lemma 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 K 3. (a) G
G Lemma 1 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 K 3. G G G bend( G )=bend( G )bend( G )=bend( G )=0 (Our Main Idea)
Proof bend( G )=bend( G ) G G
Proof G G bend( G ) ≦ bend( G ) Given an optimal drawing of G
Proof G G bend( G ) ≧ bend( G ) Given an optimal drawing of G Case 1: bend( ) = 0 Case 2: bend( ) = 1 Case 3: bend( ) ≧ 2 omitted
Lemma 1 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 K 3. u v G G G bend( G )=bend( G ) (Our Main Idea) No diamonds ∃ an optimal U- shape drawing
G Lemma 2 For each SP graph G If n ≧ 4, Δ ≦ 3 and d(s)=d(t)=1, then ∃ an optimal U-shape drawing u v G G bend( G )=bend( G ) No diamonds ∃ an optimal U- shape drawing s t optimal U-shaped drawing s t G
terminals are drawn on the outer face; the drawing except terminals doesn’t intersect the north side Our 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 I-shapeL-shapeU-shape
Lemma 1 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 K 3. K3K3 G G bend( G )=bend( G )+1 (Our Main Idea) No diamonds G ∃ an optimal U- shape drawing
Lemma 2 K3K3 G G G bend( G )=bend( G )+1 No diamonds G ∃ an optimal U- shape drawing For each SP graph G If n ≧ 4, Δ ≦ 3 and d(s)=d(t)=1, then ∃ an optimal U-shape drawing s t optimal U-shaped drawing s t
Optimal orthogonal drawings ? Optimal orthogonal drawing 1-connected planar graphnon
deg=1 2-leg SP Find an opt & U-shape U-shape not U-shapeU-shape parallel connection series connection delete edge Case (b): ∃