1.5-side boundary labeling chun-cheng linnational chiao tung university sheung-hung poonnational...

25
1.5-side Boundary Labeling Chun-Cheng Lin National Chiao Tung Uni versity Sheung-Hung Poo n National Tsing Hua Univ ersity Shigeo Takahashi The University of Tokyo Hsiang-Yu Wu The University of Tokyo Hsu-Chun Yen National Taiwan University

Post on 19-Dec-2015

217 views

Category:

Documents


0 download

TRANSCRIPT

1.5-side Boundary Labeling

Chun-Cheng Lin National Chiao Tung UniversitySheung-Hung Poon National Tsing Hua UniversityShigeo Takahashi The University of TokyoHsiang-Yu Wu The University of TokyoHsu-Chun Yen National Taiwan University

Boundary labeling (Bekos et al., GD 2004)

(Bekos & Symvonis, GD 2005)

Type-opo leaders Type-po leders Type-s leaders

Min (total leader length or total bend number)s.t. #(leader crossing) = 0

1-side, 2-side, 4-side

sitelabel

leader

Variants

Polygons labeling (Bekos et. al, APVIS 2006)

Multi-stack boundary labeling (Bekos et. al, FSTTCS 2006)

1.5-side Boundary Labelingtype-opo: direct leader vs. indirect leader

Annotation system for wordprocessing S/W

#1#2#3#4

#5

#6

indirectleader

#1

#2#3#4

#5

#6

direct leader

Problem Setting

(labelSize, labelPort, Objective)

Nonuniform label

#1

#2

Uniform label

#1#2

#3

Problem Setting

(labelSize, labelPort, Objective)

#1

#2

Fixed-position port (FP)Fixed-ratio port (FR) Sliding port

#1

#2

#1

#2

Problem Setting

(labelSize, labelPort, Objective)

Min (total bend num)(TBM for short)

Min (total leader length)(TLLM for short)

#1

#2

#3

#4

#4

#1

#2

#3#1

#2

#3

#3

#1#2

#(bends) = 6 #(bends) = 2longer length shorter length

Assumptions

All the parameters are integers

No two sites with the same x- or y- coordinate

Map height = label height sum

Legal leader

pj

pi

map label

Aleft

Aright

pi–1

j

i

pj+1

pj

pi

map label

Aleft

Arightpi–1

j

i

pj+1

#1

#2#3#4

#5

#6

Our Contributions

(LabelSize, LabelPort, Objective) time reference

(uniform, FR/sliding, TLLM) O(n log n) Thm 1

(uniform, FP, TLLM) O(n5) Thm 2

(uniform,FR/FP/sliding,

TBM) O(n5) Thm 2

(nonuniform,FR/FP/sliding,

TLLM) NP-complete* Thm 3

(nonuniform,FR/FP/sliding,

TBM) NP-complete* Thm 4

* Pseudo-polynomial time algorithms and fixed-parameter algorithms are designed for those intractable problems.

Solved all the problems of all the combinations of (LabelSize, LabelPort, Objective).

(LabelSize, LabelPort, Objective) time reference

(uniform, FR/sliding, TLLM) O(n log n) Thm 1

(uniform, FP, TLLM) O(n5) Thm 2

(uniform,FR/FP/sliding,

TBM) O(n5) Thm 2

(nonuniform,FR/FP/sliding,

TLLM) NP-complete* Thm 3

(nonuniform,FR/FP/sliding,

TBM) NP-complete* Thm 4

Lemma 1. All direct leaders are optimal for the above concerned case.

(LabelSize, LabelPort, Objective) time reference

(uniform, FR/sliding, TLLM) O(n log n) Thm 1

p

U

BpB

U

p

B

lhB

lvB

h

n

leader l

p

B

|U|

(LabelSize, LabelPort, Objective) time reference

(uniform, FR/sliding, TLLM) O(n log n) Thm 1

(uniform, FP, TLLM) O(n5) Thm 2

(uniform,FR/FP/sliding,

TBM) O(n5) Thm 2

(nonuniform,FR/FP/sliding,

TLLM) NP-complete* Thm 3

(nonuniform,FR/FP/sliding,

TBM) NP-complete* Thm 4

Theorem 2. The above case can be solved by dynamic programming in O(n5) time.

(LabelSize, LabelPort, Objective) time reference

(uniform, FP, TLLM) O(n5) Thm 2

pb

pa

(c+b-a)-th

c-th

map label

)}1 , ,1() , ,1() ,1,() ,( {min

)},1 , ,1()1 ,1 ,() ,1,() ,( {min

), ,(min{

},,,0{,

},,,0{,

0

jcbjaSicjaiaSciaaSjcp

icbiaSjciajaScjaaSjcp

icp

iaijabji

iaijabji

ab

iia

S(a, b, c) =

// all direct leaders

// downward indirect leader

// upward indirect leader

// the solution of the problem with pa, pa+1, …, pb connected to label positions c to c+(b-a)+1

# = (b+a)+1

Theorem 2. The above case can be solved by dynamic programming in O(n5) time.

(LabelSize, LabelPort, Objective) time reference

(uniform, FP, TLLM) O(n5) Thm 2

)}1 , ,1() , ,1() ,1,() ,( {min

)},1 , ,1()1 ,1 ,() ,1,() ,( {min

), ,(min{

},,,0{,

},,,0{,

0

jcbjaSicjaiaSciaaSjcp

icbiaSjciajaScjaaSjcp

icp

iaijabji

iaijabji

ab

iia

S(a, b, c) =

// all direct leaders

// downward indirect leader

// upward indirect leader

// the solution of the problem with pa, pa+1, …, pb connected to label positions c to c+(b-a)+1

pb

pa

(c+b-a)-th

c-th

map label

Theorem 2. The above case can be solved by dynamic programming in O(n5) time.

(LabelSize, LabelPort, Objective) time reference

(uniform, FP, TLLM) O(n5) Thm 2

pb

pa+i+1

pa+i-1

pa+j

pa+j-1

pa

pa+i

(c+b-a)-th

(c+i)-th

(c+j-1)-th

c-th

(c+j+1)-th

(c+i+1)-th

map label

S(a+i+1, b, c+i+1)

S(a+j, a+i-1, c+j+1)

S(a, a+j-1, c)

(c+j)-th

)}1 , ,1() , ,1() ,1,() ,( {min

)},1 , ,1()1 ,1 ,() ,1,() ,( {min

), ,(min{

},,,0{,

},,,0{,

0

jcbjaSicjaiaSciaaSjcp

icbiaSjciajaScjaaSjcp

icp

iaijabji

iaijabji

ab

iia

S(a, b, c) =

// all direct leaders

// downward indirect leader

// upward indirect leader

// the solution of the problem with pa, pa+1, …, pb connected to label positions c to c+(b-a)+1

Theorem 2. The above case can be solved by dynamic programming in O(n5) time.

(LabelSize, LabelPort, Objective) time reference

(uniform, FP, TLLM) O(n5) Thm 2

pb

pa+j+1

pa+j

pa+i+1

pa+i-1

pa

pa+i

(c+b-a)-th

(c+i)-th

(c+j-1)-th

c-th

(c+i-1)-th

(c+j+1)-th

map label

S(a+j+1, b, c+j+1)

S(a, a+i-1, c)

(c+j)-th

S(a+i+1, a+j, c+i)

pb

pa+i+1

pa+i-1

pa+j

pa+j-1

pa

pa+i

(c+b-a)-th

(c+i)-th

(c+j-1)-th

c-th

(c+j+1)-th

(c+i+1)-th

map label

S(a+i+1, b, c+i+1)

S(a+j, a+i-1, c+j+1)

S(a, a+j-1, c)

(c+j)-th

)}1 , ,1() , ,1() ,1,() ,( {min

)},1 , ,1()1 ,1 ,() ,1,() ,( {min

), ,(min{

},,,0{,

},,,0{,

0

jcbjaSicjaiaSciaaSjcp

icbiaSjciajaScjaaSjcp

icp

iaijabji

iaijabji

ab

iia

S(a, b, c) =

// all direct leaders

// downward indirect leader

// upward indirect leader

// the solution of the problem with pa, pa+1, …, pb connected to label positions c to c+(b-a)+1

(LabelSize, LabelPort, Objective) time reference

(uniform, FR/sliding, TLLM) O(n log n) Thm 1

(uniform, FP, TLLM) O(n5) Thm 2

(uniform,FR/FP/sliding,

TBM) O(n5) Thm 2

(nonuniform,FR/FP/sliding,

TLLM) NP-complete* Thm 3

(nonuniform,FR/FP/sliding,

TBM) NP-complete* Thm 4

Total Discrepancy Problem is NP-complete job Ji {J0, J1, …, J2n}

Execution time length li , where I0 < I1 < … < l2n

Preferred midtime M = (l0 + l1 + … + l2n) /2

For a planned scheduleActual midtime of Ji = mi()

Min ( |m0() – M| + |m1() – M| + … + |m2n() – M| + |m2n+1() – M’|)

Properties for the optimal schedule opt

No gaps between two jobs

m0(opt) = M

| {Ji : mi < M } | = | {Ji : mi > M } |

opt = An, An-1, …, A1, J0, B1, B2, …, Bn where {Ai, Bi} = {J2i-1, J2i}

0 M

J0J1 J2J3 J4

J0 J1 J2 J3 J4

Theorem 3. Total Discrepancy Problem L(nonuniform, FR/FP/sliding, TLLM).

(LabelSize, LabelPort, Objective) time reference

(nonuniform,FR/FP/sliding,

TLLM) NP-complete* Thm 3

0 M

J0J1 J2J3 J4

(LabelSize, LabelPort, Objective) time reference

(uniform, FR/sliding, TLLM) O(n log n) Thm 1

(uniform, FP, TLLM) O(n5) Thm 2

(uniform,FR/FP/sliding,

TBM) O(n5) Thm 2

(nonuniform,FR/FP/sliding,

TLLM) NP-complete* Thm 3

(nonuniform,FR/FP/sliding,

TBM) NP-complete* Thm 4

Theorem 4. Subset Sum Problem L(nonuniform, FR/FP/sliding, TBM).

(LabelSize, LabelPort, Objective) time reference

(nonuniform,FR/FP/sliding,

TBM) NP-complete* Thm 4

pn+1

pn+2

hmin

Subset Sum ProblemInput: A = {a1, …, an} and a num B = (a1 + … + an)/2

Question: find a subset A’ A such that sum(elements in A’) = B

< hmin< hmin

h/2

(LabelSize, LabelPort, Objective) time reference

(uniform, FR/sliding, TLLM) O(n log n) Thm 1

(uniform, FP, TLLM) O(n5) Thm 2

(uniform,FR/FP/sliding,

TBM) O(n5) Thm 2

(nonuniform,FR/FP/sliding,

TLLM) NP-complete* Thm 3

(nonuniform,FR/FP/sliding,

TBM) NP-complete* Thm 4

* Pseudo-polynomial time algorithms and fixed-parameter algorithms are designed for those intractable problems.

Theorem 5 (pseudo-polynomial algorithm).The above two cases can be solved in O(n4h) time, where h is the map height.

)} , ,1() , ,1() ,1,() ,( {min

)}, , ,1())( ,1 ,() ,1,() ,( {min

), ,(min{

0

1

0

1

0},,,0{,

0

1

0

1

0},,,0{,

1

00

j

lla

i

lla

j

llaiaijabji

i

llaia

j

lla

j

llaiaijabji

i

jja

ab

iia

htbjaShtjaiaStiaaShtp

htbiaShhtiajaStjaaShtp

htp

(LabelSize, LabelPort, Objective) time reference

(nonuniform,FR/FP/sliding,

TLLM) NP-complete* Thm 3

(nonuniform,FR/FP/sliding,

TBM) NP-complete* Thm 4

S(a, b, t ) =

)}1 , ,1() , ,1() ,1,() ,( {min

)},1 , ,1()1 ,1 ,() ,1,() ,( {min

), ,(min{

},,,0{,

},,,0{,

0

jcbjaSicjaiaSciaaSjcp

icbiaSjciajaScjaaSjcp

icp

iaijabji

iaijabji

ab

iia

S(a, b, c) =

// all direct leaders

// downward indirect leader

// upward indirect leader

// the solution of the problem with pa, pa+1, …, pb connected to label positions c to c+(b-a)+1

// the solution of the problem with pa, pa+1, …, pb connected to y-coordinate t

(uniform label case)

Theorem 6 (fixed-parameter algorithm).The above two cases using k different label heights can be solved in O(nk+4) time.

Theorem 5. The above two cases can be solved in O(n4h) time.

Lemma 2. num( positions of each label using k different label heights ) = O(nk).

pf.Induction on k

Assume num(…(k-1) …) = O(nk-1)

Consider each label, which is the i-th label from the bottom

(LabelSize, LabelPort, Objective) time reference

(nonuniform,FR/FP/sliding,

TLLM) NP-complete* Thm 3

(nonuniform,FR/FP/sliding,

TBM) NP-complete* Thm 4

h = nk h = nk

type-k

type-1, …, type-(k-1)(i –1) labels usingtype-1, type-2, …, type-k

O(nk-1) positions

at most O(n)

Conclusion

(LabelSize, LabelPort, Objective) time reference

(uniform, FR/sliding, TLLM) O(n log n) Thm 1

(uniform, FP, TLLM) O(n5) Thm 2

(uniform,FR/FP/sliding,

TBM) O(n5) Thm 2

(nonuniform,FR/FP/sliding,

TLLM) NP-complete* Thm 3

(nonuniform,FR/FP/sliding,

TBM) NP-complete* Thm 4

* Pseudo-polynomial algorithms and fixed-parameter algorithms are designed for those intractable problems.

Solved all the problems of all the combinations of (LabelSize, LabelPort, Objective).