1 of 25

1.5-side Boundary Labeling

Chun-Cheng Lin

National Chiao Tung University

Sheung-Hung Poon

National Tsing Hua University

Shigeo Takahashi

The University of Tokyo

Hsiang-Yu Wu

The University of Tokyo

Hsu-Chun Yen

National Taiwan University

2 of 25

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

site

label

leader

3 of 25

Variants

  • Polygons labeling (Bekos et. al, APVIS 2006)

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

4 of 25

1.5-side Boundary Labeling

  • type-opo: direct leader vs. indirect leader

  • Annotation system for wordprocessing S/W

#1

#2

#3

#4

#5

#6

indirect

leader

#1

#2

#3

#4

#5

#6

direct leader

5 of 25

Problem Setting

  • (labelSize, labelPort, Objective)

Nonuniform label

#1

#2

Uniform label

#1

#2

#3

6 of 25

Problem Setting

  • (labelSize, labelPort, Objective)

#1

#2

Fixed-position port (FP)

Fixed-ratio port (FR)

Sliding port

#1

#2

#1

#2

α

α

7 of 25

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) = 2

longer length

shorter length

8 of 25

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

Aright

pi–1

j

i

pj+1

#1

#2

#3

#4

#5

#6

9 of 25

Our Contributions

Thm 4

NP-complete*

TBM)

FR/FP/sliding,

(nonuniform,

Thm 3

NP-complete*

TLLM)

FR/FP/sliding,

(nonuniform,

Thm 2

O(n5)

TBM)

FR/FP/sliding,

(uniform,

Thm 2

O(n5)

TLLM)

FP,

(uniform,

Thm 1

O(n log n)

TLLM)

FR/sliding,

(uniform,

reference

time

Objective)

LabelPort,

(LabelSize,

* 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).

10 of 25

Thm 4

NP-complete*

TBM)

FR/FP/sliding,

(nonuniform,

Thm 3

NP-complete*

TLLM)

FR/FP/sliding,

(nonuniform,

Thm 2

O(n5)

TBM)

FR/FP/sliding,

(uniform,

Thm 2

O(n5)

TLLM)

FP,

(uniform,

Thm 1

O(n log n)

TLLM)

FR/sliding,

(uniform,

reference

time

Objective)

LabelPort,

(LabelSize,

11 of 25

  • 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

B

p

B

U

p

B

lh

B

lv

B

leader l

p

B

|U|

12 of 25

Thm 4

NP-complete*

TBM)

FR/FP/sliding,

(nonuniform,

Thm 3

NP-complete*

TLLM)

FR/FP/sliding,

(nonuniform,

Thm 2

O(n5)

TBM)

FR/FP/sliding,

(uniform,

Thm 2

O(n5)

TLLM)

FP,

(uniform,

Thm 1

O(n log n)

TLLM)

FR/sliding,

(uniform,

reference

time

Objective)

LabelPort,

(LabelSize,

13 of 25

  • 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

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

14 of 25

  • 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

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

15 of 25

  • 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

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

16 of 25

  • 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

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

17 of 25

Thm 4

NP-complete*

TBM)

FR/FP/sliding,

(nonuniform,

Thm 3

NP-complete*

TLLM)

FR/FP/sliding,

(nonuniform,

Thm 2

O(n5)

TBM)

FR/FP/sliding,

(uniform,

Thm 2

O(n5)

TLLM)

FP,

(uniform,

Thm 1

O(n log n)

TLLM)

FR/sliding,

(uniform,

reference

time

Objective)

LabelPort,

(LabelSize,

18 of 25

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 schedule σ
    • Actual 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

J0

J1

J2

J3

J4

J0

J1

J2

J3

J4

19 of 25

  • 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

J0

J1

J2

J3

J4

20 of 25

Thm 4

NP-complete*

TBM)

FR/FP/sliding,

(nonuniform,

Thm 3

NP-complete*

TLLM)

FR/FP/sliding,

(nonuniform,

Thm 2

O(n5)

TBM)

FR/FP/sliding,

(uniform,

Thm 2

O(n5)

TLLM)

FP,

(uniform,

Thm 1

O(n log n)

TLLM)

FR/sliding,

(uniform,

reference

time

Objective)

LabelPort,

(LabelSize,

21 of 25

  • Theorem 4. Subset Sum ProblemL(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 Problem

Input: 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

22 of 25

Thm 4

NP-complete*

TBM)

FR/FP/sliding,

(nonuniform,

Thm 3

NP-complete*

TLLM)

FR/FP/sliding,

(nonuniform,

Thm 2

O(n5)

TBM)

FR/FP/sliding,

(uniform,

Thm 2

O(n5)

TLLM)

FP,

(uniform,

Thm 1

O(n log n)

TLLM)

FR/sliding,

(uniform,

reference

time

Objective)

LabelPort,

(LabelSize,

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

23 of 25

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

(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 ) =

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)

24 of 25

  • 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

type-k

type-1, …, type-(k-1)

(i –1) labels using

type-1, type-2, …, type-k

O(nk-1) positions

at most O(n)

25 of 25

Conclusion

Thm 4

NP-complete*

TBM)

FR/FP/sliding,

(nonuniform,

Thm 3

NP-complete*

TLLM)

FR/FP/sliding,

(nonuniform,

Thm 2

O(n5)

TBM)

FR/FP/sliding,

(uniform,

Thm 2

O(n5)

TLLM)

FP,

(uniform,

Thm 1

O(n log n)

TLLM)

FR/sliding,

(uniform,

reference

time

Objective)

LabelPort,

(LabelSize,

* 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).