Polynomially solvable cases of NP-hard problems

Preview:

DESCRIPTION

Polynomially solvable cases of NP-hard problems. Based on joint works with R.Burkard , D.Foster , B.Klinz , R.Rudolf , M.Sviridenko , J.Van der Veen , G. Woeginger. Vladimir Deineko. Discrete Optimization & OR 2013. Outline. Travelling Salesman Problem (TSP) - PowerPoint PPT Presentation

Citation preview

Polynomially solvable cases of NP-hard problems

Vladimir Deineko

Discrete Optimization & OR 2013

Based on joint works with R.Burkard, D.Foster, B.Klinz, R.Rudolf, M.Sviridenko, J.Van der Veen, G. Woeginger

Outline• Travelling Salesman Problem (TSP)• Four-point (4P) conditions - classification• Euclidean TSP with 4P conditions

– Classification & Recognition

• Summary: Further research opportunities

The travelling salesman problem (TSP)

city3 city2 city5

city1

city6city4

Find a cyclic permutation that minimizes

n

i

iic1

))(,(

1 2 3 4 5 6

1 30 45 53 58 42

2 30 20 36 50 42

3 45 20 20 35 37

4 53 36 20 16 24

5 58 50 35 16 17

6 42 42 37 24 17

=<1,5,2,3,4,6,1>

c()=c(1,5)+c(5,2)+c(2,3)+c(3,4)+c(4,6)+c(6,1)

11

56

23

4

Outline• Travelling Salesman Problem (TSP)• Four-point (4P) conditions - classification• Euclidean TSP with 4P conditions

– Classification & Recognition

• Summary: Further research opportunities

of the first version of the talk

Discrete Optimization & OR 2013

Outline

• Travelling Salesman Problem (TSP)

• Four-point (4P) conditions - classification

• Euclidean TSP with 4P conditions– Classification &

Recognition

So what?

Is it of any use for a wider community?

Discrete Optimization & OR 2013

Outline

• Travelling Salesman Problem (TSP)

• Four-point (4P) conditions - classification

• Euclidean TSP with 4P conditions– Classification &

Recognition

Discrete Optimization & OR 2013

• Special structures useful in other problems, e.g.

Master Tour problem

• Exponential neighbourhoods and solvability conditions:

Optimal implementation of Double-tree algorithm

• Techniques useful in other problems

Bipartite TSPReal life OR problems

cij cik

clk(cmn )= clj

TSP with specially structured matrices

j

i

kl

+

clkcij + clj + cik

cjlcik + cil + cjk

1 2 3 4 5 6

1 30 45 53 58 42

2 30 20 36 50 42

3 45 20 20 35 37

4 53 36 20 16 24

5 58 50 35 16 17

6 42 42 37 24 17

1

2 34

56

<1,2,…,n> is an optimal TSP tour (Kalmanson, 1975)

1

2

3

4

5

6

1 2 3 4 5 6

- - - --- - - --- - - --- - - --- - - --

Specially structured matrices

c3,4c23 + c2,4 + c3.3Specially Structured Matrices: notations

i

j

k l

Two-exchange and four-point conditions

i j

lk

We consider the TSP with special matrices (cst)

such that clkcij + clj + cik

All permutations

NP-hard

N-permutationsO(n4)

O(n2)pyramidal tours

arbitrary tour τ

Pyramidal O(n2)1976

Demidenko conditions

Four Point Conditions for symmetric TSPs: Classification

NP-hardD,W2000

Van der Veen conditions

PyramidalO(n2)1994

Max Demidenko

NP-hardSteiner et al

2005Max Van der Veen

NP-hardD,Tiskin2006

Relaxed KalmansonN-perm O(n4)D, 2004

Relaxed Supnick

Kalmanson O(n)1975

Supnick O(n)1957

Pyramidal1976

Pyramidal1992

NP-hardD,W1997

NP-hardSteiner et al

2005

N-permO(n4)

NP-hardD,T2006

Demidenko conditions

Four Point Conditions: Classification

Van der Veen conditions

Max Demidenko

Max Van der Veen

Relaxed Kalmanson

Relaxed Supnick

Pyramidal

Similar toSupnick

SpecialMaxKalmanson

NP-hard

New(linear)case

SpecialLawlerO(n2)

Supnick Max,19571971,87

KalmansonMax,1970

Sum Matrixc(i,j)=u(i)+v(j)

Kalmansonsubclass

Kalmanson19701,2,3,…,n

Supnick 19571,3,5,…2,1

Kalmansonsubclass

Similar toSupnick

Sum Matrixc(i,j)=u(i)+v(j)

Recognition of specially structured matrices

dij dik

dlk(dmn )= dlj

Is there a permutation to permute rows and columns in the matrix so that the new permuted matrix (cmn) with cmn= d(m)(n) is a Relaxed Kalmanson (Kalmanson, Supnick, Demidenko ,…) matrix?

1 2

34

56

7

8

cij cik

clk

(cmn )= d(m)(n) = clj X

+

O(n4)1999

UnpublishedD,W

Demidenko conditions

Four Point Conditions for symmetric TSPs: Recognition

Van der Veen conditions ?

Max Demidenko

Max Van der Veen

?

Relaxed Kalmanson

Relaxed Supnick

O(n2log n)1998 D,R,W

O(n2)?C,F,T

O(n4)Van der Veen,

D., Rudolf,Woeginger

Demidenko conditions

Four Point Conditions for TSP: Recognition

n<17

Van der Veen conditions

O(n4) D.,

Burkard

Max Demidenko

n<17Max Van der Veen

n<17 orall are on the line

Relaxed Kalmanson O(n4)D., FosterSviridenko

Relaxed Supnick

Euclidean

Conjecture: n<7.

Conjecture: n<7.

Conjecture: n<7.

Four Point Conditions for TSP: Recognition

Relaxed Kalmanson

Euclideann1 n2 n3 n4 n5

n1

n2

n3

n4

n5

d(n1,n3 )-d(n2,n3 )≥ d(n1,n4 )-d(n2,n4 )

> =

d(n1,n4 )-d(n2,n4 )= d(n1,n5 )-d(n2,n5 )

Four Point Conditions for TSP: Recognition

Relaxed Kalmanson

Euclidean

(i) Two branches of hyperbolea intersect in no more than 4 points.

(ii) Two branches of hyperbolea with a common focal point intersect in no more than 2 points.Xu,Sahni,Rao, 2008

object localisation

Pyramidal1976

Pyramidal1992

NP-hardD,W1997

NP-hardSteiner et al

2005

N-permO(n4)

NP-hardD,T2006

Demidenko conditions

Four Point Conditions: Classification

Van der Veen conditions

Max Demidenko

Max Van der Veen

Relaxed Kalmanson

Relaxed Supnick

Pyramidal

Similar toSupnick

SpecialMaxKalmanson

NP-hard

New(linear)case

SpecialLawlerO(n2)

Supnick Max,19571971,87

KalmansonMax,1970

Sum Matrixc(i,j)=u(i)+v(j)

Kalmansonsubclass

Kalmanson19751,2,3,…,n

Supnick 19571,3,5,…2,1

Kalmansonsubclass

Similar toSupnick

Sum Matrixc(i,j)=u(i)+v(j)

Gaspard Monge, 1746-1818

Monge (Supnick) matricesMonge (1781): For an optimal transportation of goods from locations P1 and Q1 to locations P2 and Q2 the routes from P1 and from Q1 must not intersect.

P1 P2

Q2Q1

d(P1,P2) d(P1,Q2)

d(Q1,P2) d(Q1,Q2)

d(P1,P2)+d(Q1,Q2)≤ d(P1,Q2)+d(Q1,P2)

Burkard, Klinz,Rudolf: Perspectives of Monge Properties in Optimization. Survey(1996)

Monge 1781 - transportation Supnick 1956 - TSPHoffman 1963 – transportation; introduced Monge;

D.,Filonenko 1979 – recognition of Monge matrices

D., Jonsson, Klasson, Krokhin: The approximability of MAX CSP with fixed-value constraints.) 2008

Burdjuk,Trofimov 1976 – TSP with permuted Monge matrices

Pyramidal1976

Pyramidal1992

NP-hardD,W1997

NP-hardSteiner et al

2005

N-permO(n4)

NP-hardD,T2006

Demidenko conditions

Four Point Conditions: Classification

Van der Veen conditions

Max Demidenko

Max Van der Veen

Relaxed Kalmanson

Relaxed Supnick

Pyramidal

Similar toSupnick

SpecialMaxKalmanson

NP-hard

New(linear)case

SpecialLawlerO(n2)

Supnick Max,19571971,87

KalmansonMax,1970

Sum Matrixc(i,j)=u(i)+v(j)

Kalmansonsubclass

Kalmanson19751,2,3,…,n

Supnick 19571,3,5,…2,1

Kalmansonsubclass

Similar toSupnick

Sum Matrixc(i,j)=u(i)+v(j)

Kalmanson Matrices:TSP with the master tourj

i

kl An optimal TSP tour < 1, 2, 3,…, n, 1>

is called the master tour, if it is an optimal tour and it remains to be an optimal after deleting any subset of cities.

+

Illustration to Master Tour problem

PostCode 15A15

PostCode 14A14

PostCode 13A13

PostCode 12A12

PostCode 11A11

PostCode 10A10

PostCode 9A9

PostCode 8A8

PostCode 7A7

PostCode 6A6

PostCode 5A5

PostCode 4A4

PostCode 3A3

PostCode 2A2

PostCode 1A1Given a set of customers

TSP: Find a tour with the minimal total length

PostCode 15A15

PostCode 14A14

PostCode 13A13

PostCode 12A12

PostCode 11A11

PostCode 10A10

PostCode 9A9

PostCode 8A8

PostCode 7A7

PostCode 6A6

PostCode 5A5

PostCode 4A4

PostCode 3A3

PostCode 2A2

PostCode 1A1Given a set of today’s customers

???

PostCode 15A15

PostCode 14A14

PostCode 13A13

PostCode 12A12

PostCode 11A11

PostCode 10A10

PostCode 9A9

PostCode 8A8

PostCode 7A7

PostCode 6A6

PostCode 5A5

PostCode 4A4

PostCode 3A3

PostCode 2A2

PostCode 1A1Given a set of customers

Find a tour with the minimal total

length

PostCode 15A15

PostCode 14A14

PostCode 13A13

PostCode 12A12

PostCode 11A11

PostCode 10A10

PostCode 9A9

PostCode 8A8

PostCode 7A7

PostCode 6A6

PostCode 5A5

PostCode 4A4

PostCode 3A3

PostCode 2A2

PostCode 1A1Given a set of today’s customers

???

Illustration to Master Tour problem

Kalmanson Matrices: TSP with the master tour

j

i

kl

An optimal TSP tour < 1, 2, 3,…, n, 1> is called the master tour, if it is an optimal tour and it remains to be an optimal after deleting any subset of cities.

Conjecture (Papadimitriou, 1983) The master tour problem is ∑2P-complete.Sometimes travelling is easy: D., Rudolf, Woeginger, 1998 For a distance matrix C, a tour < 1, 2, 3,…, n, 1> is the master tour, if and only if C is a Kalmanson matrix.

Permuted Kalmanson matrices can be recognized in O(n2) time

Pyramidal1976

Pyramidal1992

NP-hardD,W1997

NP-hardSteiner et al

2005

N-permO(n4)

NP-hardD,T2006

Demidenko conditions

Four Point Conditions: Classification

Van der Veen conditions

Max Demidenko

Max Van der Veen

Relaxed Kalmanson

Relaxed Supnick

Pyramidal

Similar toSupnick

SpecialMaxKalmanson

NP-hard

New(linear)case

SpecialLawlerO(n2)

Supnick Max,19571971,87

KalmansonMax,1970

Sum Matrixc(i,j)=u(i)+v(j)

Kalmansonsubclass

Kalmanson19751,2,3,…,n

Supnick 19571,3,5,…2,1

Kalmansonsubclass

Similar toSupnick

Sum Matrixc(i,j)=u(i)+v(j)

Specially structured matrices & Exponential neighbourhoods

Kalmanson (1970)

K*= <1,2,…,n> is an optimal TSP tour

cij cik

clk(cmn )= clj

Demidenko (1976) * is a pyramidal tour

(cmn )=

Supnick (1957) matrices

S*= <1,3,5,7…,n,…,6,4,2>

is an optimal TSP tour

cij cik

clk(cmn )= clj

+

1 1

n

2 3

4 5

67

8

1 1

n

234

56

n-1

Demidenko TSP:

Demidenko,1979: An optimal TSP tour can be found among 2n-2 pyramidal tours in O(n2) time

1 1

n

2 3 4 5 6 7 8 9

P1(i,j)=min{ci,j+1+P2(j,j+1), cj+1,j+P1(i,j+1)} P2(i,j)=min{cj,j+1+P2(i,j+1), cj+1,i+P1(j,j+1)}P1(i,n)=cj,n P2(i,n)=cj,n

P2

P1

P1 P2

P1

Structure of dynamic programming recursions:

Double Tree algorithm & Exponential neighbourhoods

begin Compute the minimum

spanning tree; Double every edge in the

tree to get an Eulerian graph;

Find an Eulerian circuit and transform the circuit into a TSP tour by shortcutting: for every city remove all but one of its occurrence in the Eulerian circuit.

end

F(9,6)

H(6,2)

B(5,6)

I(6,0)

E(3,4)D(0,4)

A(5,8)C(2,7)

G(9,4)

<IHEBABECEDEHGFGH I>

<IHEBA C D GF I>

D

I

H E

B A

C F

G

HI

FB

ED

AC

G

Theorem (Folklore). A tour tree found by the Double Tree Algorithm is guaranteed to have no more than twice the length of the optimal tour opt for the TSP.

1

~2n+2n(1- )

~2n+2

4 5

6

1 2

m

3

4 5

6

2 3

n

1

1 tree

opt

Good N

ews

Bad News

GB

H

F

I

ED

AC

F G D

A

I H

E B C

I H

F E D

B A

C

G F

D

I

H E

B A

C

2 is the tight bound for the Double Tree Algorithm

Is it possible to find in polynomial time the best tour among all tours constructed by the Double-Tree Algorithm?

GB

H

F

I

ED

AC

F G D

A

I H

E B C

I H

F E D

B A

C

G F

D

I

H E

B A

CF G D

A

I

H E B

C

32

Double tree for metric TSP: Optimal implementation

Burkard, D.,Weginger, 1999, TSP & PQ-trees; O(n3)

time, O(n2) space

D., Tiskin, 2009, An optimal tour amongst of all those constructed by the tree algorithm can be found in O(2dn2) time and O(22dn) space, where d is a maximum vertex degree in the spanning tree.

“Conjecture” (Papadimitiou, Vazirani, 1986) The problem of finding the best tour among all tours constructed by the Double-Tree Algorithm is NP-hard.

33

Dynamic programming for the TSP

F G DA I E C

n n-1 n-2 ... 2 1

Pyramidal Tours

O(n2) algorithm +Special solvable

cases

F G D I

H

E C

A

Set of all n! tours

O(n2 2n) well known

DP algorithm +exact solution

GB

H

F

I

ED

AC

GB

H

F

I

ED

AC

O(2dn2) algorithm

+”good” heuristic

DTd

34

The best tour constructing heuristic

x

35

The bipartite travelling salesman problem (BTSP)

city3 city2 city5

city1

city6city4

“black” and “white” points have to alternate in a feasible tour

Shoe-lace problem (Halton,1995; Misiurewicz, 1996)

36

The bipartite travelling salesman problem (BTSP)

point1

item1

item2item3

point2 point3

37

point1

item1

item2item3

point2 point3

38

point1

item1

item2item3

point2 point3

39

point1

item1

item2item3

point2 point3

40

point1

item1

item2item3

point2 point3

41

point1

item1

item2item3

point2 point3

42

point1

item1

item2item3

point2 point3

43

point1

item1

item2item3

point2 point3

set of permutations

Transformation techniqueArbitrary permutation 0

1

c(0) c(1)

2c(1) c(2)special

subset

Warwick Business School

V.D.,G.Woeginger

Bipartite Travelling Salesman, or ShoeLace Problem for very old shoes

1

2

4

5

6

7 8 9 10 12

-6.0 -10.6 1.5 -1.1 -0.5

-3.0 2.1 -4.2 1.4 1.2

-0.5 -5.4 0.8 -0.8 -0.3

-0.7 -5.5 -0.1 -9.4 -4.0

-0.2 0.1 -0.4 -2.7 -4.4

1

2

4

5

6

7 8 9 10 12

-5.6 -0.2 -0.5 0.2 -0.0

-8.5 -13.5 -0.2 -5.4 +0.0

-5.7 -0.2 -0.6 -11.9 -0.8

-5.7 0.1 -12.3 11.3 -0.0

5.2 -0.6 7.7 -13.8 -2.5

Summary

• Travelling Salesman Problem (TSP)

• Four-point (4P) conditions - classification

• Euclidean TSP with 4P conditions– Classification &

Recognition

“Byproducts”

• Special structures useful in other problems, e.g.

Master Tour problem• Exponential neighbourhoods

and solvability conditions,Optimal implementation of Double-tree algorithm

• Techniques useful in other problems

Bipartite TSPReal life OR problems

Transformation technique for Bipartite TSP

28

Transformation steps to transform arbitrary tour

1

7 i2 i6

j3 1

i3 8 i5

2 j4 j5 j6

1

7 9 8

4 1

11 12 10

2 6 5 3

into specially structured tour

O(n2 ) inequalities tobe satisfied

1

2

4

5

6

7 8 9 10 12

- - - --- - - --- - - --- - - --- - - --

3

Transformation technique

28

Transformation steps to transform arbitrary tour

1

7 i2 i6

j3 1

i3 8 i5

2 j4 j5 j6

1

7 9 8

4 1

11 12 10

2 6 5 3

into specially structured tour

O(n2 ) inequalities tobe satisfied

1

2

4

5

6

7 8 9 10 12

- - - --- - - --- - - --- - - --- - - --

3

Recognition of special cases

Recognising Relaxed Supnick / Kalmanson matrices

  1       1    

1   1 1     1 1

  1   1     1  

  1 1     1   1

               

1     1     1  

  1 1     1   1

  1   1     1  

      1 1    

        1 1 1 1

        1 1 1 1

               

1 1 1       1 1

1 1 1          

  1 1   1      

  1 1   1      

0-1 RK matrix before and after permuting rows/columns

52

Minimal Spanning TreeOptimal double-tree tour

6A+√3 A

The approximation ratio is (6A+√3 A)/6A 1.622

Optimal TSP tour

6A

Hard Instances for the Optimal Double-Tree

Algorithm

Relaxed Supnick TSP: dynamic programming recursions

− } ≥hh=2 linear time algorithm

P2

P1

P1 P2

P1

Compare with DP for pyramidal tours

Three-exchange and six-point conditionsi j

l

k

mn

ji

l

k

mn

l

i jk

mni j

l

k

mn

i j

l

k

mn

<i, j, k, l, m, n>

5!*4=480 cases

add 480*479/2=114960 cases

if consider pairs of the conditions

Warwick Business School

Two dimensional bin packing3

X1 2

4 5 6

Y

1 2

3

4 5 6

Warwick Business School

Binary vector packing problem

Student A being allocated to Group X should not be disadvantaged (compared with student B being allocated to Group Y)

We want groups with the same number of• male/female• maths / non-maths• leaders • collaborators• mature students …

Motivation: Allocation of Students to Working Teams

Warwick Business School

Vehicle Routing Problem (CCC case study) Given a set of customers (& demand), a set of

vehicles (& capacity), SERVE all customers satisfying the demand and not exceeding the capacity.

Warwick Business School

Current partition of customers for one of the collection services in CCC

Partition of customers found by the new algorithms (up to 20% savings in transportation costs)

Recommended