SLIDE 1 ALTERNATING PATHS AND CYCLES OF MINIMUM LENGTH William Evans Giuseppe Liotta Henk Meijer Stephen Wismath
University of British Columbia, Canada Universit´ a degli Studi di Perugia, Italy
- U. C. Roosevelt, the Netherlands
University of Lethbridge, Canada
SLIDE 2 Motivating problem Draw planar graph on given point set to minimize total edge length [Chan et al. GD13]
- vertex maps to point of the same color
- each vertex has distinct color
SLIDE 3 Motivating problem Draw planar graph on given point set to minimize total edge length [Chan et al. GD13]
- vertex maps to point of the same color
This is NP-hard [Bastert and Fekete 96]
- each vertex has distinct color
SLIDE 4 Our problem
- vertex maps to point of the same color
- each vertex has distinct color
Draw planar graph on given point set to minimize total edge length
SLIDE 5 Our problem
- vertex maps to point of the same color
- each vertex has distinct color
Draw planar graph on given point set to minimize total edge length alternating path/cycle
SLIDE 6
Our problem is NP-hard Draw planar alternating path/cycle on given point set to minimize total edge length Idea: Reduce from EXACT COVER
Use (modified) reduction to Euclidean TSP [Papadimitriou 77]
SLIDE 7
Our problem Draw planar alternating path/cycle on given colinear point set to minimize total edge length
SLIDE 8
Cycles: A lower bound
SLIDE 9
Cycles: A lower bound Minimum number of edges crossing this gap? (for any alternating cycle)
SLIDE 10
Cycles: A lower bound Minimum number of edges crossing this gap? (for any alternating cycle) 2
SLIDE 11
Cycles: A lower bound Minimum number of edges crossing this gap? (for any alternating cycle) 2
SLIDE 12
Cycles: A lower bound Minimum number of edges crossing this gap? (for any alternating cycle) 2 2
SLIDE 13
Cycles: A lower bound Minimum number of edges crossing this gap? (for any alternating cycle) 2 2
SLIDE 14
Cycles: A lower bound Minimum number of edges crossing this gap? (for any alternating cycle) 2 2 2
SLIDE 15
Cycles: A lower bound Minimum number of edges crossing this gap? (for any alternating cycle) 2 2 2
SLIDE 16
Cycles: A lower bound Minimum number of edges crossing this gap? (for any alternating cycle) 2 2 2 4
SLIDE 17
Cycles: A lower bound 2 2 2 4 ci = 2 max{|ri − bi|, 1} ri = red, bi = blue points before gapi 6 4 Lemma 1. Minimum number of edges crossing gapi is 6 8 10 8 6 4 2
SLIDE 18
Cycles: A lower bound 2 2 2 4 ci = 2 max{|ri − bi|, 1} ri = red, bi = blue points before gapi 6 4 Lemma 1. Minimum number of edges crossing gapi is Proof: Each cycle component to the left of gapi has the same number of red and blue points ±1. 6 8 10 8 6 4 2
SLIDE 19
Cycles: A lower bound 2 2 2 4 ci = 2 max{|ri − bi|, 1} ri = red, bi = blue points before gapi 6 4 Cycle length ≥
i ci|gapi|
Lemma 1. Minimum number of edges crossing gapi is 6 8 10 8 6 4 2
SLIDE 20 Cycles: Matching the lower bound with 2 bends Drawing Rules Invariants At gapi:
- 1. Number of red components = max{ri − bi, 0}.
- 2. Number of blue components = max{bi − ri, 0}.
- 3. If ri = bi, one red/blue component spans spine.
- 4. Two closest components to spine are not both above
- r below.
SLIDE 21
Cycles: Matching the lower bound with 2 bends Drawing Rules
SLIDE 22
Cycles: Matching the lower bound with 2 bends Drawing Rules
SLIDE 23
Cycles: Matching the lower bound with 2 bends Drawing Rules
SLIDE 24
Cycles: Matching the lower bound with 2 bends Drawing Rules
SLIDE 25
Cycles: Matching the lower bound with 2 bends Drawing Rules
SLIDE 26
Cycles: Matching the lower bound with 2 bends Drawing Rules
SLIDE 27
Cycles: Matching the lower bound with 2 bends Drawing Rules
SLIDE 28
Cycles: Matching the lower bound with 2 bends Drawing Rules
SLIDE 29
Cycles: Matching the lower bound with 2 bends Drawing Rules
SLIDE 30
Cycles: Matching the lower bound with 2 bends Drawing Rules
SLIDE 31
Cycles: Matching the lower bound with 2 bends Drawing Rules
SLIDE 32
Cycles: Matching the lower bound with 2 bends Drawing Rules
SLIDE 33
Cycles: Matching the lower bound with 2 bends Drawing Rules
SLIDE 34
Cycles: Matching the lower bound with 2 bends Drawing Rules
SLIDE 35
Cycles: Matching the lower bound with 2 bends Drawing Rules
SLIDE 36
Cycles: Matching the lower bound with 2 bends Drawing Rules
SLIDE 37
Cycles: Matching the lower bound with 2 bends Drawing Rules
SLIDE 38
Cycles: Matching the lower bound with 2 bends Drawing Rules
SLIDE 39
Cycles: Matching the lower bound with 2 bends Drawing Rules
SLIDE 40
Cycles: Matching the lower bound with 2 bends Drawing Rules
SLIDE 41
Cycles: Matching the lower bound with 2 bends Drawing Rules
SLIDE 42
Cycles: Matching the lower bound with 2 bends Drawing Rules
SLIDE 43
Cycles: Matching the lower bound with 2 bends Drawing Rules
SLIDE 44
Cycles: Matching the lower bound with 2 bends Drawing Rules
SLIDE 45
Cycles: Matching the lower bound with 2 bends Drawing Rules
SLIDE 46
Cycles: Matching the lower bound with 2 bends Drawing Rules
SLIDE 47
Cycles: Matching the lower bound with 2 bends Drawing Rules
SLIDE 48 Cycles: Matching the lower bound with 2 bends Drawing Rules Theorem 1. Exists O(n log n)-time algorithm to compute a shortest planar alternating cycle on colinear
- points. Each edge has ≤ 2 bends.
SLIDE 49
Paths: A lower bound 2 3 Lemma 2. Minimum number of edges crossing gapi is 5 7 9 7 6 4 2 Given path endpoints r and b. ci = 2 max{|ri−bi|, 1} if r, b same side 1+2 max{bi−ri, ri−bi−1} if r left of gapi 1+2 max{ri−bi, bi−ri−1} if b left of gapi 5 2 2 3 r b
SLIDE 50 Paths: A lower bound 2 3 Lemma 2. Minimum number of edges crossing gapi is Proof: Same. Component with red endpoint can have
- ne more red than blue points, but zero more blue than
red points. 5 7 9 7 6 4 2 Given path endpoints r and b. ci = 2 max{|ri−bi|, 1} if r, b same side 1+2 max{bi−ri, ri−bi−1} if r left of gapi 1+2 max{ri−bi, bi−ri−1} if b left of gapi 5 2 2 3 r b
SLIDE 51
Paths: A lower bound 2 3 r to b Path length ≥
i ci|gapi|
Lemma 2. Minimum number of edges crossing gapi is 5 7 9 7 6 4 2 Given path endpoints r and b. ci = 2 max{|ri−bi|, 1} if r, b same side 1+2 max{bi−ri, ri−bi−1} if r left of gapi 1+2 max{ri−bi, bi−ri−1} if b left of gapi 5 2 2 3 r b
SLIDE 52
Paths: Matching the lower bound with 2 bends Given path endpoints r and b. Use (almost) the same algorithm as for cycles to find a path whose length matches the lower bound.
SLIDE 53
Paths: Matching the lower bound with 2 bends Given path endpoints r and b. Calculate the r to b Path length lower bound for all r and b and pick the minimum. Use (almost) the same algorithm as for cycles to find a path whose length matches the lower bound. O(n2) time
SLIDE 54
Paths: Matching the lower bound with 2 bends Given path endpoints r and b. Calculate the r to b Path length lower bound for all r and b and pick the minimum. Use (almost) the same algorithm as for cycles to find a path whose length matches the lower bound. O(n2) time Theorem 2. Exists O(n2)-time algorithm to compute a shortest planar alternating path on colinear points. Each edge has ≤ 2 bends.
SLIDE 55
Extending to more than two colors ci = 2 max{|ri − gi|, |gi − bi|, |bi − ri|, 1} ri = red, gi = green, bi = blue points before gapi Lemma 3. Minimum number of edges crossing gapi is Similar algorithm achieves lower bound. (O(n) bends)
SLIDE 56
Extending to more than two colors ci = 2 max{|ri − gi|, |gi − bi|, |bi − ri|, 1} ri = red, gi = green, bi = blue points before gapi Lemma 3. Minimum number of edges crossing gapi is Similar algorithm achieves lower bound. (O(n) bends) Four colors Lower bound cannot be achieved.
SLIDE 57 Open Problems
- Shortest alternating path in o(n2) time.
- Shortest 3-color path/cycle with o(n)
bends.
- Shortest 4-color path/cycle.
- Shortest arbitrary (not alternating) 2-color
path/cycle.
SLIDE 58 Open Problems
- Shortest alternating path in o(n2) time.
- Shortest 3-color path/cycle with o(n)
bends.
- Shortest 4-color path/cycle.
- Shortest arbitrary (not alternating) 2-color
path/cycle.
Thank you