on approximating a geometric prize-collecting traveling salesman problem with time windows reuven...

28
On approximating a geometric prize- collecting traveling salesman problem with time windows Reuven Bar-Yehuda Guy Even Shimon (Moni) Shahar

Upload: felicia-dawson

Post on 17-Dec-2015

216 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: On approximating a geometric prize-collecting traveling salesman problem with time windows Reuven Bar-Yehuda Guy Even Shimon (Moni) Shahar

On approximating a geometric prize-collecting traveling salesman problem

with time windows

Reuven Bar-Yehuda

Guy Even

Shimon (Moni) Shahar

Page 2: On approximating a geometric prize-collecting traveling salesman problem with time windows Reuven Bar-Yehuda Guy Even Shimon (Moni) Shahar

7:00-5:00

7:00-6:00

12:00-8:00

12:00-8:00

6:00-7:00

leave home 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 – nurse visiting patients

Page 3: On approximating a geometric prize-collecting traveling salesman problem with time windows Reuven Bar-Yehuda Guy Even Shimon (Moni) Shahar

Prize-collecting TSP with time windows

• 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. – Extra: service-time per site.

Page 4: On approximating a geometric prize-collecting traveling salesman problem with time windows Reuven Bar-Yehuda Guy Even Shimon (Moni) Shahar

Known results: scheduling with locations

• Feasibility is NPC even for points on a line [Tsitsiklis92].

• Polynomial algorithm for the case where all intervals are [0,t_i] (using dynamic programming) [Khanna]

• 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: On approximating a geometric prize-collecting traveling salesman problem with time windows Reuven Bar-Yehuda Guy Even Shimon (Moni) Shahar

Our results

• Logarithmic approximation for points on a line.

• Optimal algorithm for points in any metric space, for special case: no round-trips within time windows.

• Heuristic for any metric space. Achieves an approximation ratio that depends on a “density” measure.

Page 6: On approximating a geometric prize-collecting traveling salesman problem with time windows Reuven Bar-Yehuda Guy Even Shimon (Moni) Shahar

Points on a line• Speed in [0,1], so dist(A,B) = amount of

time required to travel from A to B.

• Construct the following 2D view of an instance:

X

t

speed = 1/slope

Slope in 900+[-450,+450]

Simplify tour: discrete speed

in {-1,0,1}.

Page 7: On approximating a geometric prize-collecting traveling salesman problem with time windows Reuven Bar-Yehuda Guy Even Shimon (Moni) Shahar

Point on a line (cont.)

• Now we rotate the view by 450, and obtain a weakly x-monotone tour {00,450,900}.

t-X

t+X

2-D generalization of the “max monotone

subsequence” problem

Page 8: On approximating a geometric prize-collecting traveling salesman problem with time windows Reuven Bar-Yehuda Guy Even Shimon (Moni) Shahar

An 8-approx for unit intervals• Construct a 1/2 -square

grid.

• Each interval intersects exactly 2 grid lines.

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. An instance (slanted

intervals in the plane).

Page 9: On approximating a geometric prize-collecting traveling salesman problem with time windows Reuven Bar-Yehuda Guy Even Shimon (Moni) Shahar

Analysis - definitions• horizontal slice is the region

defined by two consecutive horizontal lines.

• vertical slice is the region defined by two consecutive vertical lines.

• Ci dominates Cj if:

Right(Ci) Left(Cj) &&

Top (Ci) Bott(Cj)• Domination ensures that concatenation of sub-tours is feasible.

Ci

Cj

Page 10: On approximating a geometric prize-collecting traveling salesman problem with time windows Reuven Bar-Yehuda Guy Even Shimon (Moni) Shahar

Analysis (cont.)

THM: The longest path in the graph intersects no less than OPT/8 intervals.

•Each interval intersects 2 grid-segments

weight(path) : wrong by at most a factor of 2.

Segment counted twice

Page 11: On approximating a geometric prize-collecting traveling salesman problem with time windows Reuven Bar-Yehuda Guy Even Shimon (Moni) Shahar

Analysis (cont.)

“decompose” OPT into alternating horizontal and vertical blocks. (each block within a slice).

Sub-tours through red (blue) blocks can be concatenated.

If there is a grid-path that is 4-approx in each block, pick red or blue blocks. This gives an 8-approx.

Optimal path

Page 12: On approximating a geometric prize-collecting traveling salesman problem with time windows Reuven Bar-Yehuda Guy Even Shimon (Moni) Shahar

Analysis (cont.)

Select either left-top path or bottom-right path in the DAG.

Every interval in block must intersect the perimeter

OPT intersects at most 2 times more intervals than the better path.

Error in weight of path is at most by a factor of 2.

Overall: 8-approximation

OPT in a block

Page 13: On approximating a geometric prize-collecting traveling salesman problem with time windows Reuven Bar-Yehuda Guy Even Shimon (Moni) Shahar

Remarks

• For [1,2) intervals this is a 16-apx algorithm.

• This can be extended to a 16log(I)-approx. alg. for arbitrary intervals, where I = Imax/Imin.

• The size of the DAG is weakly polynomial. It becomes strongly poly if we consider only grid lines that intersect some interval.

Page 14: On approximating a geometric prize-collecting traveling salesman problem with time windows Reuven Bar-Yehuda Guy Even Shimon (Moni) Shahar

An O(log n) approximation

• If I = Imax/Imin is is super-poly, then O(log I)> O(log n).

• We need a different approach to divide the intervals into “disjoint-sets”.

• We use an interval tree for this partition.

Page 15: On approximating a geometric prize-collecting traveling salesman problem with time windows Reuven Bar-Yehuda Guy Even Shimon (Moni) Shahar

Recursive bisection

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

Page 16: On approximating a geometric prize-collecting traveling salesman problem with time windows Reuven Bar-Yehuda Guy Even Shimon (Moni) Shahar

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 17: On approximating a geometric prize-collecting traveling salesman problem with time windows Reuven Bar-Yehuda Guy Even Shimon (Moni) Shahar

O(log(n)) Approximation

• Partition the intervals into (log n) combs.

• For each comb, 12-approximate an optimal tour.

O(log(n)) approximation.

Page 18: On approximating a geometric prize-collecting traveling salesman problem with time windows Reuven Bar-Yehuda Guy Even Shimon (Moni) Shahar

Approximation for comb

• Form a grid.

• Construct a DAG.

• Find the longest path.

• An interval crosses exactly 1 vertical line.

• An interval can cross many horz lines (but a grid-path crosses at most 2).

Page 19: On approximating a geometric prize-collecting traveling salesman problem with time windows Reuven Bar-Yehuda Guy Even Shimon (Moni) Shahar

Approx ratio = 12

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

– vertical sub-tours between two comb teeth

– Note the slices are non-uniform, but the proof still holds.

Page 20: On approximating a geometric prize-collecting traveling salesman problem with time windows Reuven Bar-Yehuda Guy Even Shimon (Moni) Shahar

No round-trips within time windows

DEF:

• for all pairs (vi,vj):

dist(vi,vj) + dist(vj,vi) > interval (vi).

• Service time:dist(vi,vj) + dist(vj,vi) + serv(vj) > interval(vi).

IDEA: can’t zig-zag between sites.

Page 21: On approximating a geometric prize-collecting traveling salesman problem with time windows Reuven Bar-Yehuda Guy Even Shimon (Moni) Shahar

Dynamic program for no round-trips within time windows

Intuition: examine two tours A,B such that:• Both visit k sites• Both end at site vi.• tour A ends at time tA.• tour B ends at time tB.• tA < tB

A+best-aug(A) B+best-aug(B) • Proof: aug(B) is also aug(A). Prize-collecting is

additive because aug(B) cannot visit sites visited by A.

Page 22: On approximating a geometric prize-collecting traveling salesman problem with time windows Reuven Bar-Yehuda Guy Even Shimon (Moni) Shahar

Dynamic program for no round-trips within time windows (cont.)

The algorithm works in layers, where in each layer, it keeps a list of states. A state in layer i is a pair (v,t) which signifies: a path that ends in v at time t after visiting i sites.

• Layer 0: (origin, t=0)

Page 23: On approximating a geometric prize-collecting traveling salesman problem with time windows Reuven Bar-Yehuda Guy Even Shimon (Moni) Shahar

Dynamic program for no round-trips within time windows (cont.)

• Layer i+1 (induction step): For each state (vi,t) in Layer i go from (vi ,t) to all vj.

• Consider the state (vj,t+dist(vi,C)

• After deadline? Don’t add to layer i+1.• On time? is it earlier than previous states that

end in vj ? If so replace.

• Before release time? Use release time instead of arrival time.

Page 24: On approximating a geometric prize-collecting traveling salesman problem with time windows Reuven Bar-Yehuda Guy Even Shimon (Moni) Shahar

Analysis of the dynamic program

• Correctness: lexicographic order all optimal tours by considering vector of service times.

observation: algorithm computes an optimal tour that is minimal in this order.

Running time: • each layer has at most one interesting point per interval.

• each point produces at most n candidates for next layers.

• number of layers is at most n.

The running time is O(n3).

Page 25: On approximating a geometric prize-collecting traveling salesman problem with time windows Reuven Bar-Yehuda Guy Even Shimon (Moni) Shahar

Generalized no-round trip

• The density of an instance is:

() = maxuv {I(u) / (Luv + Lvu) }– Density bounds number of zig-zags. – The approximation ratio of the dynamic program is:

() +1.– This follows from the fact that between every two visits

of the same site, at least 1/ () of its length passed.

• Non-unit profits: the problem is knapsack hard, and an approximation scheme of (1+) is possible.

Page 26: On approximating a geometric prize-collecting traveling salesman problem with time windows Reuven Bar-Yehuda Guy Even Shimon (Moni) Shahar

Remarks

• This algorithm works also for asymmetric distances.

• It shows that difficulty is due to “close” intervals.

Page 27: On approximating a geometric prize-collecting traveling salesman problem with time windows Reuven Bar-Yehuda Guy Even Shimon (Moni) Shahar

Further research

• Improve approximation ratio in 1-D.

• Nothing known for 2-D.

Page 28: On approximating a geometric prize-collecting traveling salesman problem with time windows Reuven Bar-Yehuda Guy Even Shimon (Moni) Shahar

The end