ESA2003 1 On approximating a geometric prize-collecting traveling salesman problem with time windows...

37
ESA2003 1 On approximating a geometric prize- collecting traveling salesman problem with time windows Reuven Bar-Yehuda – Technion IIT Guy Even – Tel Aviv Univ . Shimon (Moni) Shahar –Tel Aviv Univ .

Transcript of ESA2003 1 On approximating a geometric prize-collecting traveling salesman problem with time windows...

Page 1: ESA2003 1 On approximating a geometric prize-collecting traveling salesman problem with time windows Reuven Bar-Yehuda – Technion IIT Guy Even – Tel Aviv.

ESA2003 1

On approximating a geometric prize-collecting traveling salesman problem

with time windows

Reuven Bar-Yehuda – Technion IIT

Guy Even – Tel Aviv Univ.

Shimon (Moni) Shahar –Tel Aviv Univ.

Page 2: ESA2003 1 On approximating a geometric prize-collecting traveling salesman problem with time windows Reuven Bar-Yehuda – Technion IIT Guy Even – Tel Aviv.

ESA2003 2

7:00-5:00

7:00-6:00

12:00-8:00

12:00-8:00

6:00-7:00

leave office at 5:00 get back at 20:00

10:00-11:00

16:00-17:00

17:00-18:000.5 hour rest

1 hour

1 hour

1 hour

2 hours

1.5 hours

2 hours

4 hours

2 hours

Motivation – postman distributing packages

Page 3: ESA2003 1 On approximating a geometric prize-collecting traveling salesman problem with time windows Reuven Bar-Yehuda – Technion IIT Guy Even – Tel Aviv.

ESA2003 3

Prize-collecting TSP with time windows

• A scheduling problem with locations.

• Definition: – Sites in a metric space (e.g. the plane).– A time-interval for each site (release-time, deadline).– Moving agent with speed in [0,1].– Goal: max #sites the agent visits on-time. – Extension: service-time per site.

Page 4: ESA2003 1 On approximating a geometric prize-collecting traveling salesman problem with time windows Reuven Bar-Yehuda – Technion IIT Guy Even – Tel Aviv.

ESA2003 4

Known results: scheduling with locations

• Feasibility is NPC for points on a line [Tsitsiklis92].• Polynomial algorithm for the case where all intervals

are [0,ti] (using dynamic programming) [Tsitsiklis92 Khanna02]

• Min makespan (completion time of last job): – 1.5-approx for points on a line with release times, processing

times, and no deadlines [KNI98].

– 2-approx for points on a line, no deadlines, multiple agents (vehicles) [KN01].

– PTAS for trees with O(1) leaves, single & multiple agents [AS02].

Page 5: ESA2003 1 On approximating a geometric prize-collecting traveling salesman problem with time windows Reuven Bar-Yehuda – Technion IIT Guy Even – Tel Aviv.

ESA2003 5

x

y

t

Page 6: ESA2003 1 On approximating a geometric prize-collecting traveling salesman problem with time windows Reuven Bar-Yehuda – Technion IIT Guy Even – Tel Aviv.

ESA2003 6

x

y

t

Page 7: ESA2003 1 On approximating a geometric prize-collecting traveling salesman problem with time windows Reuven Bar-Yehuda – Technion IIT Guy Even – Tel Aviv.

ESA2003 7

x

y

t

Page 8: ESA2003 1 On approximating a geometric prize-collecting traveling salesman problem with time windows Reuven Bar-Yehuda – Technion IIT Guy Even – Tel Aviv.

ESA2003 8

x

y

t

Page 9: ESA2003 1 On approximating a geometric prize-collecting traveling salesman problem with time windows Reuven Bar-Yehuda – Technion IIT Guy Even – Tel Aviv.

ESA2003 9

x

t

Page 10: ESA2003 1 On approximating a geometric prize-collecting traveling salesman problem with time windows Reuven Bar-Yehuda – Technion IIT Guy Even – Tel Aviv.

ESA2003 10

x

t

Page 11: ESA2003 1 On approximating a geometric prize-collecting traveling salesman problem with time windows Reuven Bar-Yehuda – Technion IIT Guy Even – Tel Aviv.

ESA2003 11

x

t

Page 12: ESA2003 1 On approximating a geometric prize-collecting traveling salesman problem with time windows Reuven Bar-Yehuda – Technion IIT Guy Even – Tel Aviv.

ESA2003 12

x

t

Page 13: ESA2003 1 On approximating a geometric prize-collecting traveling salesman problem with time windows Reuven Bar-Yehuda – Technion IIT Guy Even – Tel Aviv.

ESA2003 13

speed = 1/slope Slope in [450, 1350] Chop intervals outside of visibility cone

Page 14: ESA2003 1 On approximating a geometric prize-collecting traveling salesman problem with time windows Reuven Bar-Yehuda – Technion IIT Guy Even – Tel Aviv.

ESA2003 14

Now we rotate the view by 450 ….

Page 15: ESA2003 1 On approximating a geometric prize-collecting traveling salesman problem with time windows Reuven Bar-Yehuda – Technion IIT Guy Even – Tel Aviv.

ESA2003 15

After we rotate the view by 450,

Slope of tour [0, 90]

Page 16: ESA2003 1 On approximating a geometric prize-collecting traveling salesman problem with time windows Reuven Bar-Yehuda – Technion IIT Guy Even – Tel Aviv.

ESA2003 16

Longest monotone path

Page 17: ESA2003 1 On approximating a geometric prize-collecting traveling salesman problem with time windows Reuven Bar-Yehuda – Technion IIT Guy Even – Tel Aviv.

ESA2003 17

Special case: zero length

Longest monotone subsequence

Page 18: ESA2003 1 On approximating a geometric prize-collecting traveling salesman problem with time windows Reuven Bar-Yehuda – Technion IIT Guy Even – Tel Aviv.

ESA2003 18

Approach:

Longest path on a DAG

Page 19: ESA2003 1 On approximating a geometric prize-collecting traveling salesman problem with time windows Reuven Bar-Yehuda – Technion IIT Guy Even – Tel Aviv.

ESA2003 19

Approach:

Longest path on a DAG

Page 20: ESA2003 1 On approximating a geometric prize-collecting traveling salesman problem with time windows Reuven Bar-Yehuda – Technion IIT Guy Even – Tel Aviv.

ESA2003 20

Approach:

Longest path on a DAG

Page 21: ESA2003 1 On approximating a geometric prize-collecting traveling salesman problem with time windows Reuven Bar-Yehuda – Technion IIT Guy Even – Tel Aviv.

ESA2003 21

Approach:

Longest path on a DAG

Page 22: ESA2003 1 On approximating a geometric prize-collecting traveling salesman problem with time windows Reuven Bar-Yehuda – Technion IIT Guy Even – Tel Aviv.

ESA2003 22

x

y

t Approach works for any dimension:

Longest path on a DAG

Page 23: ESA2003 1 On approximating a geometric prize-collecting traveling salesman problem with time windows Reuven Bar-Yehuda – Technion IIT Guy Even – Tel Aviv.

ESA2003 23

x

y

t Longest path on a DAG

Page 24: ESA2003 1 On approximating a geometric prize-collecting traveling salesman problem with time windows Reuven Bar-Yehuda – Technion IIT Guy Even – Tel Aviv.

ESA2003 24

Polynomial time algorithms:

If all interval times have zero lengthIf Max length ≤ k * Min Length

Grid path: Opt in time Poly(n,2k)

General: 2-approx in time Poly(n,2k)

General: O(log k /loglogn) - approxNo assumptions: O(log(n)) - approximation

Page 25: ESA2003 1 On approximating a geometric prize-collecting traveling salesman problem with time windows Reuven Bar-Yehuda – Technion IIT Guy Even – Tel Aviv.

ESA2003 25

• Construct a DAG.

V={(x,y): (x,y) R2}1

1

1

1

1

1

1

1 1

1

1

2

1

• Direct the grid up & right.

• Assign edge weights (#intersecting intervals).

• Find a longest path on the obtained DAG. k-apx

Grid path: |intervalgrid| k

Page 26: ESA2003 1 On approximating a geometric prize-collecting traveling salesman problem with time windows Reuven Bar-Yehuda – Technion IIT Guy Even – Tel Aviv.

ESA2003 26

Grid path: |intervalgrid| k• Construct a DAG

• V = {(x,y),b1…bk:

(x,y) R2 and bi {0,1}}

• Directed “right” edges

(x,y)0b2…bk (x+1,y)b2…bk0

(x,y)0b2…bk (x+1,y)b2…bk1

• Directed “up” edges(x,y)1b2…bk (x,y+1)b2…bk0(x,y)1b2…bk (x,y+1)b2…bk1

• Assign edge weights and

find longest path in the DAG

(2,2)1

10 0

(2,3)

0

(2,2)1001 (2,3)0010

Page 27: ESA2003 1 On approximating a geometric prize-collecting traveling salesman problem with time windows Reuven Bar-Yehuda – Technion IIT Guy Even – Tel Aviv.

ESA2003 27

A 2-approx for length [1,2)• Construct a 2/4 square

grid.

• Each interval intersects

at most 8 grid lines.

• Find optimal grid path (k=8).

• Time complexity:

Poly(n)

• Claim: (optimal) path P: grid paths P1 P2, s.t

P1 and P2 cover all intervals intersected by P

Page 28: ESA2003 1 On approximating a geometric prize-collecting traveling salesman problem with time windows Reuven Bar-Yehuda – Technion IIT Guy Even – Tel Aviv.

ESA2003 28

(optimal) path P: grid paths P1, P2, s.t P1 and P2 cover all intervals intersected by P

P: an optimal path

P1: Upper grid path

P

P1

P2P2: Lower grid path

Page 29: ESA2003 1 On approximating a geometric prize-collecting traveling salesman problem with time windows Reuven Bar-Yehuda – Technion IIT Guy Even – Tel Aviv.

ESA2003 29

A 2-approx for length [1,2)

2log(Imax/Imin)- apxfor the general case

Page 30: ESA2003 1 On approximating a geometric prize-collecting traveling salesman problem with time windows Reuven Bar-Yehuda – Technion IIT Guy Even – Tel Aviv.

ESA2003 30

A 2-approx for length [1,k)

2log(Imax/Imin)/logk- apxfor the general case

k=O(logn) time is Poly(n)

Page 31: ESA2003 1 On approximating a geometric prize-collecting traveling salesman problem with time windows Reuven Bar-Yehuda – Technion IIT Guy Even – Tel Aviv.

ESA2003 31

Recursive bisection

Claim: separating vertical line (at most half the intervals lie strictly on each side).

Page 32: ESA2003 1 On approximating a geometric prize-collecting traveling salesman problem with time windows Reuven Bar-Yehuda – Technion IIT Guy Even – Tel Aviv.

ESA2003 32

Recursive bisection (cont.)• bisect recursively log(n) “combs”

Level 1 Level 2Level 22nd comb

•A comb defines subset of intervals that intersect exactly one comb-tooth.• comb Ci such that: Ci OPT contains at least OPT/log n

intervals.

Page 33: ESA2003 1 On approximating a geometric prize-collecting traveling salesman problem with time windows Reuven Bar-Yehuda – Technion IIT Guy Even – Tel Aviv.

ESA2003 33

O(log(n)) Approximation

• Partition the intervals into log n combs.

• For each comb 2-apx.2log(n)- approximation.

Page 34: ESA2003 1 On approximating a geometric prize-collecting traveling salesman problem with time windows Reuven Bar-Yehuda – Technion IIT Guy Even – Tel Aviv.

ESA2003 34

Approximation for comb• Form a grid.

• Construct a DAG.

• V =

set of horz segments

• Set of edges:

(i, j) (i+1, k)

If j k. Edge weights is the number

Of new intersected intervals

i i+1

jk

weight((i, j), (i+1, k))=4

Page 35: ESA2003 1 On approximating a geometric prize-collecting traveling salesman problem with time windows Reuven Bar-Yehuda – Technion IIT Guy Even – Tel Aviv.

ESA2003 35

Approx ratio = 2

• Decompose OPT into alternating sub-tours: – horizontal sub-tours inside a slice

– vertical sub-tours between two comb teeth

– Each “covered segment” must cross P1 or P2

P2

P1

Page 36: ESA2003 1 On approximating a geometric prize-collecting traveling salesman problem with time windows Reuven Bar-Yehuda – Technion IIT Guy Even – Tel Aviv.

ESA2003 36

Zigzags: source of hardness

• special case: no zigzags between intervals

Dynamic programming finds optimal tour

(even if distances are asymmetric).

• Extension: density = bound on number of zigzag between intervals.

apx ratio=density (same dynamic programming)

Page 37: ESA2003 1 On approximating a geometric prize-collecting traveling salesman problem with time windows Reuven Bar-Yehuda – Technion IIT Guy Even – Tel Aviv.

ESA2003 37

Further research

• Improve approximation ratio in 1-D.

• Nothing known for 2-D.