ptas for 2-dimensional euclidean tsp - rutgers

52
PTAS for 2-Dimensional Euclidean TSP Vijay Kothari Rutgers University, Camden February 6, 2010 Vijay Kothari (Rutgers University, Camden) PTAS for 2-Dimensional Euclidean TSP February 6, 2010 1 / 41

Upload: others

Post on 03-Feb-2022

1 views

Category:

Documents


0 download

TRANSCRIPT

PTAS for 2-Dimensional Euclidean TSP

Vijay Kothari

Rutgers University, Camden

February 6, 2010

Vijay Kothari (Rutgers University, Camden) PTAS for 2-Dimensional Euclidean TSP February 6, 2010 1 / 41

Introduction and Overview

TSP Statement:

Input:Set S = {(x1, y1), . . . (xn, yn)} of points in planeDistance function d defined on points in S

Output:Least cost traveling salesman tour.

Vijay Kothari (Rutgers University, Camden) PTAS for 2-Dimensional Euclidean TSP February 6, 2010 2 / 41

Introduction and Overview

TSP Statement:

Input:Set S = {(x1, y1), . . . (xn, yn)} of points in planeDistance function d defined on points in S

Output:Least cost traveling salesman tour.

Vijay Kothari (Rutgers University, Camden) PTAS for 2-Dimensional Euclidean TSP February 6, 2010 2 / 41

Introduction and Overview

How hard is the TSP?

The TSP, metric TSP, and Euclidean TSP are all NP-hard.If P6=NP there does not exist a PTAS for the metric TSP.There exists a PTAS for Euclidean TSP.

Vijay Kothari (Rutgers University, Camden) PTAS for 2-Dimensional Euclidean TSP February 6, 2010 3 / 41

Introduction and Overview

Euclidean TSP

The PTAS involves 3 steps:Perturbation: Transform the given instance of the problem into a“nice" instance.Shifted Dissection: Randomly shift and dissect a bounding boxof the “nice” instance.Dynamic Program: Employ dynamic programing on the shifteddissection.

Vijay Kothari (Rutgers University, Camden) PTAS for 2-Dimensional Euclidean TSP February 6, 2010 4 / 41

Perturbation

Nice Instances

A Euclidean TSP instance is considered nice if:1 All points have nonnegative integer coordinates2 The minimum nonzero distance between points is at least 23 The maximum distance between points is O(n)4 All points (xi , yi) satisfy xi , yi ∈ [0,O(n)]

Vijay Kothari (Rutgers University, Camden) PTAS for 2-Dimensional Euclidean TSP February 6, 2010 5 / 41

Perturbation

Perturbation Lemma

Lemma (Perturbation Lemma)

A PTAS for nice Euclidean TSP instances admits a PTAS for allEuclidean TSP instances

Vijay Kothari (Rutgers University, Camden) PTAS for 2-Dimensional Euclidean TSP February 6, 2010 6 / 41

Perturbation

Proof of Perturbation Lemma

OPT : cost of an optimal tour.ε′ : a positive constant.ε : a positive constant we will fix later.We will show how to obtain a tour of cost at most (1 + ε′)OPT ifthere exists a PTAS for nice instances.

Vijay Kothari (Rutgers University, Camden) PTAS for 2-Dimensional Euclidean TSP February 6, 2010 7 / 41

Perturbation

Proof of Perturbation Lemma

L = max{maxi{xi} −min

i{xi},max

i{yi} −min

i{yi}}.

Construct a bounding box with sides of length L. Note L ≤ OPT .

Vijay Kothari (Rutgers University, Camden) PTAS for 2-Dimensional Euclidean TSP February 6, 2010 8 / 41

Perturbation

Proof of Perturbation Lemma

L = max{maxi{xi} −min

i{xi},max

i{yi} −min

i{yi}}.

Construct a bounding box with sides of length L. Note L ≤ OPT .

Vijay Kothari (Rutgers University, Camden) PTAS for 2-Dimensional Euclidean TSP February 6, 2010 8 / 41

Perturbation

Proof of Perturbation Lemma

Place grid of granularity εL2n on bounding box.

Move each point of TSP instance to nearest intersection of thegrid.An optimal tour for the original instance of the problem has cost atmost (1 + ε)OPT on the perturbed instance.

Vijay Kothari (Rutgers University, Camden) PTAS for 2-Dimensional Euclidean TSP February 6, 2010 9 / 41

Perturbation

Proof of Perturbation Lemma

Place grid of granularity εL2n on bounding box.

Move each point of TSP instance to nearest intersection of thegrid.An optimal tour for the original instance of the problem has cost atmost (1 + ε)OPT on the perturbed instance.

Vijay Kothari (Rutgers University, Camden) PTAS for 2-Dimensional Euclidean TSP February 6, 2010 9 / 41

Perturbation

Proof of Perturbation Lemma

Place grid of granularity εL2n on bounding box.

Move each point of TSP instance to nearest intersection of thegrid.An optimal tour for the original instance of the problem has cost atmost (1 + ε)OPT on the perturbed instance.

Vijay Kothari (Rutgers University, Camden) PTAS for 2-Dimensional Euclidean TSP February 6, 2010 9 / 41

Perturbation

Proof of Perturbation Lemma

Place grid of granularity εL2n on bounding box.

Move each point of TSP instance to nearest intersection of thegrid.An optimal tour for the original instance of the problem has cost atmost (1 + ε)OPT on the perturbed instance.

Vijay Kothari (Rutgers University, Camden) PTAS for 2-Dimensional Euclidean TSP February 6, 2010 9 / 41

Perturbation

Proof of Perturbation Lemma

Scale distances by a factor of 4nεL so that the new granularity is

4nεL ·

εL2n = 2, the minimum nonzero distance between points is 2,

and the maximum distance between points is O(n).Translate the bounding box so that the lower left-hand cornercoincides with the origin.The resulting instance is nice.

Vijay Kothari (Rutgers University, Camden) PTAS for 2-Dimensional Euclidean TSP February 6, 2010 10 / 41

Perturbation

Proof of Perturbation Lemma

OPT : cost of optimal tour in original problem instance.OPT ′: cost of optimal tour in nice instanceC′: cost of tour obtained by PTAS in nice instance for parameter εC: cost of tour obtained by PTAS in original instance.

Vijay Kothari (Rutgers University, Camden) PTAS for 2-Dimensional Euclidean TSP February 6, 2010 11 / 41

Perturbation

Proof of Perturbation Lemma

C ≤ εL4n

C′ + εL ≤ (1 + ε)εL4n

OPT ′ + εL ≤ (1 + ε)(OPT + εL) + εL

C ≤ (1 + 3ε+ ε2)OPT

Vijay Kothari (Rutgers University, Camden) PTAS for 2-Dimensional Euclidean TSP February 6, 2010 12 / 41

Perturbation

Proof of Perturbation Lemma

If we set ε = ε′

4 then:

C ≤ (1 + 3ε+ ε2)OPT ≤ (1 + 4ε)OPT = (1 + ε′)OPT

This completes the proof of the lemma.

Vijay Kothari (Rutgers University, Camden) PTAS for 2-Dimensional Euclidean TSP February 6, 2010 13 / 41

Shifted Dissection

Shifted Dissection

We now have a nice instance of the TSP.The next step is to obtain a new bounding box, translate it usingrandomization, and dissect it.

Vijay Kothari (Rutgers University, Camden) PTAS for 2-Dimensional Euclidean TSP February 6, 2010 14 / 41

Shifted Dissection

The New Bounding Box

L′ : length of the smallest bounding box enclosing all points.L : smallest power of 2 that is at least twice as large as L′.L ∈ O(n).

Vijay Kothari (Rutgers University, Camden) PTAS for 2-Dimensional Euclidean TSP February 6, 2010 15 / 41

Shifted Dissection

The New Bounding Box

Place a bounding box of length L at the origin.Each point now lies in [0,L/2]× [0,L/2].

Vijay Kothari (Rutgers University, Camden) PTAS for 2-Dimensional Euclidean TSP February 6, 2010 16 / 41

Shifted Dissection

The New Bounding Box

Place a bounding box of length L at the origin.Each point now lies in [0,L/2]× [0,L/2].

Vijay Kothari (Rutgers University, Camden) PTAS for 2-Dimensional Euclidean TSP February 6, 2010 16 / 41

Shifted Dissection

The Shift

Choose integers a and b from (−L/2,0].Shift bounding box so lower left-hand corner is located at [a,b].

Vijay Kothari (Rutgers University, Camden) PTAS for 2-Dimensional Euclidean TSP February 6, 2010 17 / 41

Shifted Dissection

The Shift

Choose integers a and b from (−L/2,0].Shift bounding box so lower left-hand corner is located at [a,b].

Vijay Kothari (Rutgers University, Camden) PTAS for 2-Dimensional Euclidean TSP February 6, 2010 17 / 41

Shifted Dissection

The Dissection

The dissection is performed by recursively partitioning eachsquare of side length at least one into smaller squares.The level of a square is its depth in the 4-ary tree. The boundingbox has level 0, the children of the bounding box have level 0, andso on. The last level is O(log n) since L ∈ O(n).

Vijay Kothari (Rutgers University, Camden) PTAS for 2-Dimensional Euclidean TSP February 6, 2010 18 / 41

Shifted Dissection

The Quadtree

The quadtree is similar to the dissection, but we stop partitioningwhen a square contains at most one node.The quadtree has depth O(log n) and O(n log n) nodes.

Vijay Kothari (Rutgers University, Camden) PTAS for 2-Dimensional Euclidean TSP February 6, 2010 19 / 41

Dynamic Program

Portals

In the DP we only consider tours that enter and exit squares onprespecified points called portals.On the perimeter of each square we place 4m portals: one portalon each corner and m - 1 equally spaced portals between cornerson each side.We enforce that the portal parameter m is a power of 2.

Vijay Kothari (Rutgers University, Camden) PTAS for 2-Dimensional Euclidean TSP February 6, 2010 20 / 41

Dynamic Program

Definitions

p-tour: is a tour that optionally includes portals.portal-respecting tour: a p-tour that only enters and exits squaresthrough portals.r-light tour: a p-tour that crosses each side of each square in thedissection at most r times.partial p-tour for a square: the part of the p-tour that lies inside thesquare.

Vijay Kothari (Rutgers University, Camden) PTAS for 2-Dimensional Euclidean TSP February 6, 2010 21 / 41

Dynamic Program

DP Objective and Multipath Problem

The dynamic program solves the (m,r)-multipath problem.In the multipath problem we are given :

I a particular square in the quadtreeI a multiset of portals on this square containing at most r portals per

sideI a matching of portals into entry and exit pairs

The goal is to find a minimum cost tour that visits every point inthe square, connects every entry point to its corresponding exitpoint, and uses each of the designated portals exactly once.

Vijay Kothari (Rutgers University, Camden) PTAS for 2-Dimensional Euclidean TSP February 6, 2010 22 / 41

Dynamic Program

Dynamic Program

The cheapest r-light portal respecting p-tour is then given by theentry in the level 0 square that does not use any of the portals onthe boundary of its square.The total number of entries in the lookup table is at most:O(n log n) · (4m + 1)4r · (4r)! = O(mO(r)n log n)

Vijay Kothari (Rutgers University, Camden) PTAS for 2-Dimensional Euclidean TSP February 6, 2010 23 / 41

Dynamic Program

Dynamic Program

For any dynamic program entry associated with a leaf of thequadtree we can generate a solution for that entry in O(r) time.

Vijay Kothari (Rutgers University, Camden) PTAS for 2-Dimensional Euclidean TSP February 6, 2010 24 / 41

Dynamic Program

Dynamic Program

Other entries are characterized by a square S containing 4smaller squares s1, s2, s3,and s4.For these entries, we may use at most r portals along each of theinternal edges. This contributes O((m + 2)4r ).There are 2r pairings of the portals on external edges into entryand exit pairs so that there are O((2r)4r ) ways to place theinternal portals between entry and exit pairs of external portals.There are O((4r)!) ways to order the portals on the path.

Vijay Kothari (Rutgers University, Camden) PTAS for 2-Dimensional Euclidean TSP February 6, 2010 25 / 41

Dynamic Program

Dynamic Program

The net running time for a particular instance is then:O((m + 2)4r ) ·O((2r)4r ) ·O((4r)!) = O(mO(r))

Since the number of entries is O(n log n), the net running time forconstructing the entry table is O(mO(r)n log n)

Vijay Kothari (Rutgers University, Camden) PTAS for 2-Dimensional Euclidean TSP February 6, 2010 26 / 41

Analysis

Overview of Analysis

Now, we must show the following:It’s not too expensive to convert an optimal tour into a portalrespecting tour.It’s not too expensive to convert a portal respecting tour into anr-light portal respecting tour.

Vijay Kothari (Rutgers University, Camden) PTAS for 2-Dimensional Euclidean TSP February 6, 2010 27 / 41

Analysis

Crossing Lemma

We bound the number of segment crossings on vertical and horizontallines of our dissection.

` : vertical or horizontal line in the dissection.t(`) : number of times that the optimal tour crosses line `.T : total number of times that the optimal solution crosses avertical or horizontal line of the dissection.T =

∑`

t(`).

Vijay Kothari (Rutgers University, Camden) PTAS for 2-Dimensional Euclidean TSP February 6, 2010 28 / 41

Analysis

Crossing Lemma

Lemma (Crossing Lemma)

For optimal solutions to nice Euclidean instances, T < 3OPT.

Proof.Consider an edge S of length s connecting two nodes (x0, y0) and(x1, y1) in the optimal tour. Note s ≥ 2. Let τ(S) denote the number oflines S crosses. We have:

τ(S) ≤ |x1 − x0|+ |y1 − y0|+ 2 < 2s + 2 ≤ 3s

So, T =∑`

t(`) =∑

S

τ(S) <∑

S

3s = 3OPT .

Vijay Kothari (Rutgers University, Camden) PTAS for 2-Dimensional Euclidean TSP February 6, 2010 29 / 41

Analysis

Portal Respecting Lemma

Lemma (Portal Respecting Lemma)

A solution that has a total of T crossings and a cost of OPT can betransformed into a portal respecting solution of cost OPT + T log L

m thatmaintains T crossings.

Vijay Kothari (Rutgers University, Camden) PTAS for 2-Dimensional Euclidean TSP February 6, 2010 30 / 41

Analysis

Proof of Portal Respecting Lemma

Any time an edge in the tour crosses the side of a square, but notat a portal, we will bend the edge so that it crosses the nearestportal on the maximal level square it touches.It will then only cross sides of squares that are lower in thequadtree at portals as well.

The probability that a given crossing occurs on line i is pi ≤ 2i

L

If the maximal level square is i, the cost of the tour is incrementedby ci =

L2i m .

Vijay Kothari (Rutgers University, Camden) PTAS for 2-Dimensional Euclidean TSP February 6, 2010 31 / 41

Analysis

Proof of Portal Respecting Lemma

The expected cost of moving crossings to nearest portals is then:

∑`

τ(`)∑i:i≥1

pici =∑`

τ(`)∑i:i≥1

(2i

L)( L

2im)

=∑`

τ(`)

mlog L =

T log Lm

Note that this is useful since T ≤ 3OPT by the Crossing Lemma.

Vijay Kothari (Rutgers University, Camden) PTAS for 2-Dimensional Euclidean TSP February 6, 2010 32 / 41

Analysis

Patching Lemma

Lemma (Patching Lemma)

Given a line segment S of length s, if a closed path C crosses S atleast thrice, we can add line segments on S of total length notexceeding 6s to the tour to get a new closed path C′ that crosses S atmost twice and contains the previous tour.

Vijay Kothari (Rutgers University, Camden) PTAS for 2-Dimensional Euclidean TSP February 6, 2010 33 / 41

Analysis

Proof of Patching Lemma

Suppose C crossesvertical line segment S atotal of k ≥ 3 times.

Vijay Kothari (Rutgers University, Camden) PTAS for 2-Dimensional Euclidean TSP February 6, 2010 34 / 41

Analysis

Proof of Patching Lemma

Break the tour at the kpoints at which Ccrosses S.Add two copies of eachpoint corresponding to acrossing: onecorresponding to the leftside of S and the othercorresponding to theright.

Vijay Kothari (Rutgers University, Camden) PTAS for 2-Dimensional Euclidean TSP February 6, 2010 34 / 41

Analysis

Proof of Patching Lemma

Find a minimum costsalesman tour τL on Land a minimum costsalesman tour τR on R.

Vijay Kothari (Rutgers University, Camden) PTAS for 2-Dimensional Euclidean TSP February 6, 2010 34 / 41

Analysis

Proof of Patching Lemma

If k is odd, match thefirst k − 1 points of eachside, separately, andconnect the last pair ofpoints.If k is even, match thefirst k − 2 points on eachside, separately, andconnect the last twopairs of points.

Vijay Kothari (Rutgers University, Camden) PTAS for 2-Dimensional Euclidean TSP February 6, 2010 34 / 41

Analysis

Proof of Patching Lemma

The resulting graph isEulerian, is connected,contains all points of theprevious tour, andcrosses S at most twice.Each of the two addedtours has cost at most2s, and each matchinghas cost at most s, for atotal added cost of 6s.

Vijay Kothari (Rutgers University, Camden) PTAS for 2-Dimensional Euclidean TSP February 6, 2010 34 / 41

Analysis

Patching an Optimal Solution

The basic idea is to show that we can transform an optimalsolution into an r -light portal-respecting salesman tour withoutpaying too much.We repeatedly apply the Patching Lemma to the optimal solutionto obtain an r -light tour.Then, we apply the Portal Respecting Lemma to the resulting tourobtain an r -light portal-respecting salesman tour.

Vijay Kothari (Rutgers University, Camden) PTAS for 2-Dimensional Euclidean TSP February 6, 2010 35 / 41

Analysis

Structure Theorem

Theorem (Structure Theorem)

If integers a and b are picked uniformly at random from the interval(-L/2, 0], then with probably at least 1/2, the (a,b)-shifted dissectionhas an r-light portal-respecting p-tour of cost at most (1 + ε)OPT form = O(1

ε logL) and r = O(1ε ). Moreover, this r -light portal-respecting

p-tour can be found by the dynamic program in O(n logO(1/ε) n) time.

Vijay Kothari (Rutgers University, Camden) PTAS for 2-Dimensional Euclidean TSP February 6, 2010 36 / 41

Analysis

Proof of Structure Theorem

Consider a line `. Let i` be the maximal level (level closest to root)of `. That is, let i` be the level containing a square that has a sidecoinciding with line `, but if j < i` then ` does not coincide with theside of any square on level j .To patch an optimal solution of cost OPT we apply the PatchingLemma in a bottom up fashion. For each line ` and itscorresponding i` value we apply the Patching Lemma to all sidesof squares contained in ` from level j = log L down to j = i`.

Vijay Kothari (Rutgers University, Camden) PTAS for 2-Dimensional Euclidean TSP February 6, 2010 37 / 41

Analysis

Proof of Structure Theorem

Fix a particular line `. Suppose we apply the Patching lemma ktimes to sides of squares contained in ` that have more than rcrossings. Then, (r + 1)k − 2k ≤ τ(`).Let nj denote the number of times the Patching Lemma is applied

at level j . We have∑j≥1

nj ≤τ(`)

(r − 1).

The probability that a vertical line ` has maximal level i is pi =2i

L .

The cost of applying the Patching Lemma at level j is cj =6L2j .

Vijay Kothari (Rutgers University, Camden) PTAS for 2-Dimensional Euclidean TSP February 6, 2010 38 / 41

Analysis

Proof of Structure Theorem

The expected cost of applying the Patching Lemma in the bottom upfashion for a particular line ` is then :

∑i:i≥1

pi∑j:j≥i

njcj ≤∑i:i≥1

2i

L

∑j:j≥i

nj6L2j ≤ 6

∑j:j≥1

nj

2j

∑i:i≤j

2i

< 12∑j:j≥1

nj ≤ 12τ(`)

(r − 1)

Thus, the increase in cost is at most 12 T(r−1) ≤ 36 OPT

(r−1) by the CrossingLemma.

Vijay Kothari (Rutgers University, Camden) PTAS for 2-Dimensional Euclidean TSP February 6, 2010 39 / 41

Analysis

Proof of Structure Theorem

Next, we apply the Portal Respecting Lemma to make the tourm-respecting.This adds an expected cost of at most 3OPT log L

m to the tour.

Vijay Kothari (Rutgers University, Camden) PTAS for 2-Dimensional Euclidean TSP February 6, 2010 40 / 41

Analysis

Proof of Structure Theorem

The expected added cost in making the tour r -light andm-respecting is at most 36 OPT

(r−1) + 3OPT log Lm .

If m = r log L the expected added cost is at most 39 OPT(r−1) .

If m = r log L and r = 78ε + 1 the expected added cost is at most

ε2OPT .Markov’s Inequality tells us that the cost will be at most εOPT withprobability at least 1

2 .

Vijay Kothari (Rutgers University, Camden) PTAS for 2-Dimensional Euclidean TSP February 6, 2010 41 / 41