orthogonal drawings of series-parallel graphs joint work with xiao zhou by tohoku university takao...

Post on 11-Jan-2016

228 Views

Category:

Documents

0 Downloads

Preview:

Click to see full reader

TRANSCRIPT

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 point2. each edge is drawn as a sequence of alternate horizontal and

vertical line segments3. 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 point2. each edge is drawn as a sequence of alternate horizontal and

vertical line segments3. any two edges don’t cross except at their common ends

planar graph orthogonal 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 point2. each edge is drawn as a sequence of alternate horizontal and

vertical line segments3. any two edges don’t cross except at their common ends

planar graph orthogonal drawingscrossing

Orthogonal Drawings of Series-Parallel Graphs

with Minimum Bends

Xiao Zhou and Takao Nishizeki

by

Tohoku University

1. each vertex is mapped to a point2. each edge is drawn as a sequence of alternate horizontal and

vertical line segments3. any two edges don’t cross except at their common ends

planar graph orthogonal drawings

one bend no bend

another embedding

bend

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 bend no bend

Optimal orthogonal drawing

optimal

planar graph

bend via-hole, through-hole VLSI design

Example

4 bends

Orthogonal Drawings

drawing

bendbendbendbend

Example

4 bends

Orthogonal Drawings

drawing

bendbendbendbend

Optimal ? No

Example

embedding

Orthogonal Drawings

drawing

bendbendbendbend

flip

4 bends

Example

embedding

flip

4 bends

Orthogonal Drawings

drawing

bendbendbendbend

Example

embedding

flip

4 bends

Orthogonal Drawings

drawing

bendbendbendbend

Example

embedding

flip

4 bends

Orthogonal Drawings

drawing

bendbendbendbend

Example

embedding

4 bends

Orthogonal Drawings

drawing

bendbendbendbend

Example

drawing

embedding

0 bend

optimal

4 bends

Orthogonal Drawings

drawing

bendbendbendbend

Orthogonal Drawings

drawing

bendbendbendbend

4 bends

Example

drawing

embedding

0 bend

optimal

Given a planar graph

Wish to findan optimal orthogonal drawing

Find an optimal orthogonal drawing of a given planar graph.

Problem

wheredegree 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)=3

2

2 2

2

323

Known results

The problem:NP-complete for planar graphs of Δ≦4

A. Garg, R. Tamassia, 2001

D. Battista, et al. 1998If Δ≦3, O(n5logn) 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(n5logn) time D. Battista, et al. 1998

If Δ≦4, O(n4) timeIf Δ≦3, O(n3) time

D. Battista, et al. 1998

D. Battista, et al. 1998

For biconnected series-parallel graphs

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

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-connection 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-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 graphseries-connection

Series-Parallel Graphs

Example

SP graphparallel-connection

Series-Parallel Graphs

Example

SP graphSeries-connection

Series-Parallel Graphs

Example

SP graphParallel-connection

Series-Parallel Graphs

Example

Biconnected SP graphs

SP graphbiconnected

Biconnected graphs G:

G – v is connected for each vertex v.v v

Series-Parallel Graphs

Example

SP graphbiconnected

Biconnected graphs G:

G – v is connected for each vertex v.

not biconnected

v

Biconnected SP graphs

cut vertex

Series-Parallel Graphs

Example

SP graphsbiconnected

(Our Main Idea)Lemma 1

Every biconnected SP graph G of Δ≦3 has one of thefollowing three substructures: (a) a diamond C (b) two adjacent vertices u and v s.t. d(u)=d(v)=2 (c) a triangle K3.

(a)

u v

(b)

K3

(c)

2

3

2

3 2 22

3 3

(Our Main Idea)Lemma 1

Every biconnected SP graph G of Δ≦3 has one of thefollowing three substructures: (a) a diamond C (b) two adjacent vertices u and v s.t. d(u)=d(v)=2 (c) a triangle K3.

(a)

u v K3

(b) (c)

2

3

2

3 2 22

3 3

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 drawingCase (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 optimal

contractReturn

expand

expand

Let G be a biconnected SP graph of Δ≦3.Case (a): ∃ a diamond ,  

Algorithm(G)

Algorithm( ), find

optimal optimal

contractReturn

expand

expandcontract contract

Examplecontract

drawing

delete edge

Let G be a biconnected SP graph of Δ≦3.Case (a): ∃ a diamond ,  

Algorithm(G)

Algorithm( ), find

contractReturn

expand

Case (b): ∃

deg=1 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-shape L-shape U-shape

2-legged SP graph

s tU-shape U-shape

Our Main Idea

2-legged SP graph

s t

Definition of I- , L- and U-shaped drawings

L-shape U-shape

terminals are drawn on the outer face;the drawing except terminals intersects neither the north side nor the south side I-shape

I-shape

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-shape L-shape U-shape

2-legged SP graph

s tL-shapeL-shape

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 deg=1

2-legged SP

Find an opt & U-shape

parallel connectionseries connection

delete edge

Case (b): ∃

decompose

opt & L-shape opt & L-shapeopt & U-shapeopt & U-shapeopt & L-shape

Find an opt & U-shape

delete edge

Case (b): ∃

opt & U-shapeopt & I-shapeopt & U-shape

opt & U-shape

opt &I-shape

opt & U-shape

Find an opt & U-shape

delete edge

Case (b): ∃

opt & U-shapeopt & I-shapeopt & U-shape

opt & U-shape

opt & I-shape

Find an opt & U-shape

delete edge

Return an optimal drawing

extend

Case (b): ∃

Algorithm( ),

Algorithm(G)

u vu v

Case (c):∃ a complete graph K3. opt & U-shape

Return optimal drawing

bend

expand

Let G be a biconnected SP graph of Δ≦3.Case (a): ∃ a diamond ,  

contraction

Case (b): ∃

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 1Our algorithm works well even if G is not biconnected.

find three types of drawings

best one of

Optimal drawing

=

bendbend

bend bendbend

bend bendbendbend

4 bends

2 bends

3 bends

An optimal orthogonal drawing of a SP graph G of Δ≦3 can be found in linear time.

Theorem 1Conclusions

Conclusions

bend(G) ≦ n/3 for biconnected SP graphs G of Δ≦3

Grid size ≦ 8n/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 bendno bendoptimal not optimal

bend

∃a one-bend orthogonal drawing ?

1-connected SP graph

Yes

one bend

one bendno bendoptimal not optimal

bendbend

∃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 crossing

∃a 0-bend orthogonal drawing ?

1-connected SP graph

one bendoptimal

bendbend

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 1Conclusions

Our algorithm works well even if G is not biconnected.

min # of bends

min # of bends=

1-connected SP graph

Conclusions

bend(G) ≦ (n+4)/3 for 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

bend bend

bend

bendbendbend

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 toptimal I-shapeoptimal 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-shape U-shape

terminals are drawn on the outer face;the drawing except terminals intersects neither the north side nor the south side I-shape

I-shape

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-shape L-shape U-shape

s

L-shape

tL-shapeL-shape

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.

st

Definition of I- , L- and U-shaped drawings

I-shape L-shape U-shape

U-shape tnot U-shapeU-shape

Lemma 2

The following (a) and (b) hold for a 2-legged SP graph Gof Δ 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 Gof Δ 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 L-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

Lemma 2

The following (a) and (b) hold for a 2-legged SP graph Gof Δ≦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-shapeL-shape

not a diamond graph

U-shape

Known results

In the fixed embedding setting:

Min-cost flow problem

n : # of verticesn : # of verticesFor plane graph:

O(n2logn) time R. Tamassia, 1987

Known results

In the fixed embedding setting:

improved

n : # of verticesn : # of verticesFor plane graph:

O(n2logn) time R. Tamassia, 1987O(n7/4 logn) time A. Garg, R. Tamassia, 1997

Known results

In the fixed embedding setting:For plane graph:

O(n2logn) time R. Tamassia, 1987O(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

Known results

In the fixed embedding setting:For plane graph:

O(n2logn) time R. Tamassia, 1987O(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

Lemma 3

Every biconnected SP graph G of Δ≦3 has one of thefollowing 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

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 thefollowing three substructures: (a) a diamond (b) two adjacent vertices u and v s.t. d(u)=d(v)=2 (c) a complete graph K3.

u v

G

u v

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

u v

G

bend(G)=bend(G )

No diamonds

∃an optimal U-shape drawing

s t

optimal U-shaped drawing

s t

G

Lemma 1

Every biconnected SP graph G of Δ≦3 has one of thefollowing three substructures: (a) a diamond (b) two adjacent vertices u and v s.t. d(u)=d(v)=2 (c) a complete graph K3.

K3

G G

bend(G)=bend(G )+1

(Our Main Idea)

No diamonds G

∃an optimal U-shape drawing

Lemma 2

K3

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 deg=1

2-leg SP

Find an opt & U-shape

U-shape not U-shapeU-shape

parallel connectionseries connection

delete edge

Case (b): ∃

top related