Orthogonal Drawings of SeriesParallel Graph by Takao Nishizeki
Orthogonal Drawings of Series-Parallel Graph by Takao Nishizeki Joint work with Xiao Zhou Tohoku University
Orthogonal Drawings of Series-Parallel Graph with Minimum Bends 1. each vertex is mapped to a point by 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 Xiao Zhou and Takao Nishizeki Tohoku University planar orthogonal
Orthogonal Drawings of Series-Parallel Graph with Minimum Bends 1. each vertex is mapped to a point by 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 one bend Xiao Zhou and Takao Nishizeki bend Tohoku University planar orthogonal drawings
Orthogonal Drawings of Series-Parallel Graph with Minimum Bends 1. each vertex is mapped to a point by 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 Xiao Zhou and Takao Nishizeki Tohoku University planar orthogonal drawings crossi ng
another embedding Orthogonal Drawings of Series-Parallel Graph with Minimum Bends 1. each vertex is mapped to a point by 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 one bend no bend Xiao Zhou and Takao Nishizeki bend Tohoku University planar orthogonal drawings
Optimal 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. VLSI design bend via-hole, throughhole one bend no bend planar graph orthogonal drawings optimal
Exampl e Orthogonal Drawings drawin g bend 4 bends bend
Exampl e Orthogonal Drawings drawin g bend Optimal ? 4 bends No
Exampl e Orthogonal Drawings drawin g bend embeddi ng flip bend 4 bends bend
Exampl e Orthogonal Drawings drawin g bend embeddi ng flip bend 4 bends bend
Exampl e Orthogonal Drawings drawin g bend embeddi ng flip bend 4 bends bend
Exampl e Orthogonal Drawings drawin g bend embeddi ng flip bend 4 bends bend
Exampl e Orthogonal Drawings drawin g bend embeddi ng bend 4 bends bend
Exampl e Orthogonal Drawings drawin g bend embeddi ng drawin g bend 4 bends bend 0 bend optimal
Exampl Given a planar graph e Orthogonal Proble Drawings Findman optimal orthogonal drawing of ag given planar graph. bend embeddi ng drawin g bend 4 bends bend. Wish bend to find an optimal orthogonal drawing 0 bend optimal
Known results The problem: NP-complete for planar graphs of Δ≦ 4 A. Garg, R. Tamassia, 2001 2 where If Δ≧ 5, then no orthogonal drawing. degree of vertex v: # of edges 2 incident to v 2 3 Δ:max degree d(v)=2 2 2 Δ=3, n=7 d(v)= 3 3
Known results The problem: NP-complete for planar graphs of Δ≦ 4 A. Garg, R. Tamassia, If Δ≦ 3, O(n 5 logn) time 2001 D. Battista, et al. 1998 where n: # of vertices Δ=3, n=7
Known results The problem: NP-complete for planar graphs of Δ≦ 4 A. Garg, R. Tamassia, If Δ≦ 3, O(n 5 logn) time 2001 D. Battista, et al. 1998 For biconnected series-parallel graphs If Δ≦ 4, O(n 4) time D. Battista, et al. If Δ≦ 3, O(n 3) time D. 1998 Battista, et al. 1998
Our results For series-parallel graphs If Δ≦ 3, O(n) time our result much simpler and faster than the known algorithms
Series-Parallel Graphs A SP graph is recursively defined as (a) follows: a single edge is a SP graph. (b) if then are SP graphs, are SP graphs
Series-Parallel Graphs A SP graph is recursively defined as (a) follows: a single edge is a SP graph. (b) if then are SP graphs, are SP graphs
Series-Parallel Graphs A SP graph is recursively defined as (a) follows: is a SP graph. a single edge (b) if are SP graphs, then parallelconnection are SP graphs
Series-Parallel Graphs A SP graph is recursively defined as (a) follows: is a SP graph. a single edge (b) if are SP graphs, then parallelconnection are SP graphs seriesconnection
Series-Parallel Graphs A SP graph is recursively defined as (a) follows: a single edge is a SP graph. (b) if then are SP graphs, are SP graphs
Series-Parallel Graphs Examp le SP graph
Series-Parallel Graphs Examp le SP graph seriesconnection
Series-Parallel Graphs Examp le SP graph parallelconnection
Series-Parallel Graphs Examp le SP graph Seriesconnection
Series-Parallel Graphs Examp le SP graph Parallelconnection
Series-Parallel Graphs Examp le v v biconnecte SP graph d Biconnected SP graphs Biconnected graphs G: G – v is connected for each vertex v.
Series-Parallel Biconnected graphs G: Graphs Examp G – v is connected for each levertex v. biconnecte SP graph d Biconnected SP graphs cut vertex v not biconnected
Series-Parallel Graphs Examp le biconnecte SP graphs d
Lemma (Our Main 1 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) 2 a triangle K 3. 2 u K 3 3 3 2 v 2 3 3 2 (a (b ) (c ) )
Lemma (Our Main 1 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) 2 a triangle K 3. 2 u K 3 3 3 2 v 2 3 3 2 (a (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 Case (c): ∃ optimal drawing Similar as Case (b).
Algorithm(G) Let G be a biconnected SP graph of Δ≦ 3. Case (a): ∃ a diamond , contract Algorithm( find ), Return expand Recur G to a smaller one optimal
Algorithm(G) Let G be a biconnected SP graph of Δ≦ 3. Case (a): ∃ a diamond , contract Algorithm( find ), expand Example contract Return contract drawing contract optimal
Algorithm(G) Let G be a biconnected SP graph of Δ≦ 3. Case (a): ∃ a diamond , contract find ), Algorithm( e et l de ge ed Case (b): ∃ Return expand
deg=1 2 -legged SP e et l de ge ed Case (b): ∃ Find an opt & U-shape
Our Main Idea SP 2 -legged graph UUs t shap e e Definition of I- , L- and U-shaped drawings terminals are drawn on the outer face; the drawing except terminals doesn’t intersect the north side ILUsha shap
Our Main Idea SP 2 -legged graph Isha pes I- t Definition of I- , L- andsha U-shaped pe drawings terminals are drawn on the outer face; the drawing except terminals intersects neither the north side nor ILUthe south side shap
Our Main Idea SP 2 -legged graph s L- L- t shap Definition of I- , L- and U-shaped e e drawings terminals are drawn on the outer face; the drawing except terminals intersects neither the north side nor ILUthe east side shap
Lemma 2 Every 2 -legged SP graph without diamond has optimal I-, L- and U-shaped drawings optimal bend I-shape bend L-shape U-shape
parallel series connection decompose deg=1 2 -legged SP Δ ≦ 3 e et l de ge ed Case (b): ∃ Find an opt & U-shape
opt & U-shape e et l de ge ed Case (b): ∃ opt & L-shape opt & opt U-shape & L-shape Find an opt & U-shape
opt & U-shape opt & I-shape opt & U-shapeopt & I-shape e et l de ge ed Case (b): ∃ opt & U-shape Find an opt & U-shape
opt & U-shape opt & I-shape opt & U-shape e et l de ge ed Case (b): ∃ Return an optimal drawing extend Find an opt & U-shape
Algorithm(G) Return optima l drawin expand g Let G be a biconnected SP graph of Δ≦ 3. Case (a): ∃ a diamond , contraction Algorithm( Case (b): u v ∃ ), u Case (c): ∃ a complete graph K 3. v opt & Ushape bend
Theorem An 1 optimal orthogonal drawing of a biconnected SP graph G of Δ≦ 3 can be found in linear time.
Theorem Our algorithm works well even if G is not An 1 optimal orthogonal drawing of a biconnected. bend SP graph bend G of Δ≦ 3 can be found in linear time. 4 bends Optimal drawing 3 bends besttypes find = three one of drawings of 2 bends bend
Conclusions Theorem An 1 optimal orthogonal drawing of a SP graph G of Δ≦ 3 can be found in linear time.
Conclusions bend(G)≦ n/3 for biconnected SP graphs G of Δ≦ 3 Grid size ≦ 8 n/9 =width + height heig ht widt
Optimal orthogonal drawing planar graph Optimal orthogonal drawings ?
Optimal orthogonal drawing 1 -connected SP graph ∃aaone-bend orthogonaldrawing 2 -bend orthogonal ? bend one bend not optimal bend Is this optimal one bend not optimal
Optimal orthogonal drawing 1 -connected SP graph ∃a one-bend orthogonal drawing ? bend no bend one bend optimal not optimal
one bend ∃a one-bend orthogonal drawing Yes 0 -bend orthogonal drawing ? ? bend no bend optimal Is this optimal one bend not optimal
Optimal orthogonal drawing 1 -connected SP graph ∃a 0 -bend orthogonal drawing ? 0 bend orthogonal drawings optimal
Optimal orthogonal drawing 1 -connected SP graph ∃a 0 -bend orthogonal drawing ? 0 bend orthogonal drawings optimal
Optimal orthogonal drawing 1 -connected SP graph ∃a 0 -bend orthogonal drawing ? crossi ng no bend optimal No
one bend 1 -connected SP graph optimal bend two bends
Conclusions Theorem An 1 optimal orthogonal drawing of a biconnected SP graph G of Δ≦ 3 can be found in linear time. Our algorithm works well even if G is not biconnected. min # of bends 1 -connected SP graph min # = of bends
Conclusions Our algorithm works well even if G is not biconnected. bend(G)≦ (n+4)/3 for SP graphs G of Δ≦ 3 Best possible bend bend(G)= (n – 8)/3 + 4 = (n +4)/3 bend
For series-parallel graphs G with Δ=4 Is there an O(n)-time algorithm to find an optimal orthogonal drawing of G open ? s t s t s t no optimal U-shape optimal I-shape s t optimal L-shape
Optimal drawing
Our Main Idea SP 2 -legged 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 SP 2 -legged I- graph A SP graph G is 2 -legged sha if n(G)≧ 3 and d(s)=d(t)=1 for the terminals s pe and t. Is t sha pe 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 ILUthe south side shap
Our Main Idea SP 2 -legged graph A SP graph G is 2 -legged L-if n(G)≧ 3 and d(s)=d(t)=1 for the terminals s shap and t. es LL- t shap Definition of I, Land U-shaped e e drawings terminals are drawn on the outer face; the drawing except terminals intersects neither the north side nor ILUthe east side shap
Our Main Idea SP 2 -legged graph A SP graph G is 2 -legged if n(G)≧ 3 and d(s)=d(t)=1 for the terminals s and U-t. U- t not U-t s shape e e Definition of I- , L- and U-shaped drawings terminals are drawn on the outer face; the drawing except terminals doesn’t intersect the north side ILUsha shap
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-shape optimal L-shape U-shape
Definition of Diamond Graph A Diamond graph is recursively defined as (a) follows: a path with three vertices is a diamond graph. (b) if then are diamond graphs, is a diamond graph
Definition of Diamond Graph A Diamond graph is recursively defined as (a) follows: is a diamond graph. a path with three edges (b) if then are diamond graphs, is a diamond graph
Diamond Graph (a) (b) If then is a diamond graph. and are diamond graphs, is a diamond graph
Diamond Graph (a) (b) If then is a diamond graph. and are diamond graphs, is a diamond graph
Lemma 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 1 -bend Ushape d drawing (b) every no-bend drawing is either I-shaped or L-shaped. Isha Lpe shap ∃no-bend U-shaped drawing ? NO
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. diamond not a diamond graph Isha Lpe shap no-bend e IL- U-
Known results In the fixed embedding setting: For plane graph: O(n 2 logn) time n : # of vertices R. Tamassia, 1987 Min-cost flow problem
Known results In the fixed embedding setting: For plane graph: O(n 2 logn) time O(n 7/4 logn) time n : # of vertices R. Tamassia, 1987 A. Garg, R. Tamassia, 1997 improved
Known results In the fixed embedding setting: For plane graph: O(n 2 logn) time O(n 7/4 logn) time R. Tamassia, 1987 A. Garg, R. Tamassia, 1997 In the variable embedding setting: for planar graphs of NP-complete Δ≦ 4 A. Garg, R. Tamassia, 2001
Known results In the fixed embedding setting: For plane graph: O(n 2 logn) time O(n 7/4 logn) time R. Tamassia, 1987 A. Garg, R. Tamassia, 1997 In the variable embedding setting: for planar graphs of NP-complete Δ≦ 4 If Δ≦ 3, O(n 5 logn) time A. Garg, R. Tamassia, 2001 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
Proof bend(G)≦bend(G ) G G Given an optimal drawing of G
Proof bend(G)≧bend(G ) G G Case 1: bend( 0 )= Case 2: bend( 1 )= Case 3: bend( 2 )≧ omitted Given an optimal drawing of G
Lemma 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 ∃an optimal U (c)bend(G)=bend( a complete graph K 3. -shape G) u u drawing v v G No diamond G G
Lemma 2 optimal U-shaped For each SP graph G drawing If n ≧ 4, Δ≦ 3 and d(s)=d(t)=1, then ∃an optimal U-shape drawings t bend(G)=bend( G) u u v v G No diamond G ∃an optimal U -shape drawing G G
Lemma 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 bend(G)=bend(G (c) a complete graph K 3. ∃an optimal U )+1 -shape K 3 drawing G No diamond G G
Lemma 2 optimal U-shaped For each SP graph G drawing If n ≧ 4, Δ≦ 3 and d(s)=d(t)=1, then ∃an optimal U-shape drawings t s K 3 t bend(G)=bend(G )+1 G No diamond G ∃an optimal U -shape drawing G G
Optimal orthogonal drawing no 1 -connected planar n graph Optimal orthogonal drawings ?
parallelconnection series connection deg=1 Ushap 2 -leg SP e not Ushape e et l de ge ed Case (b): ∃ Ushap e Find an opt & U-shape
- Slides: 90