24
1 Jesper Larsen & Jens Clausen Informatics and Mathematical Modelling / Operations Research Branch and Cut for TSP Jesper Larsen & Jens Clausen jla,[email protected] Informatics and Mathematical Modelling Technical University of Denmark

Branch and Cut for TSP

  • Upload
    others

  • View
    1

  • Download
    0

Embed Size (px)

Citation preview

Page 1: Branch and Cut for TSP

1Jesper Larsen & Jens Clausen

Informatics and Mathematical Modelling / Operations Research

Branch and Cut for TSPJesper Larsen & Jens Clausen

jla,[email protected]

Informatics and Mathematical Modelling

Technical University of Denmark

Page 2: Branch and Cut for TSP

2Jesper Larsen & Jens Clausen

Informatics and Mathematical Modelling / Operations Research

Branch-and-Cut for TSPBranch-and-Cut is a general techniqueapplicable e.g. to solve symmetric TSPproblem.

TSP is NP-hard – no one believes that thereexists a polynomial algorithm for the problem.

TSP can be formulated as an integerprogramming problem – for an n-vertex graphthe number of binary variables becomes n(n−1)

2 ,and the problem has an exponential number ofsubtour elimination constraints.

Page 3: Branch and Cut for TSP

3Jesper Larsen & Jens Clausen

Informatics and Mathematical Modelling / Operations Research

The symmetric TSP

min∑

e∈E dexe

s.t. x(δ(v)) = 2, v ∈ {1, . . . , n}x(δ(S)) ≥ 2, ∅ ⊂ S ⊂ V

xe ∈ {0, 1}, e ∈ E

Page 4: Branch and Cut for TSP

4Jesper Larsen & Jens Clausen

Informatics and Mathematical Modelling / Operations Research

The number of subtour elimination constraintsis huge (2|V |) and even though we can removehalf of those due to symmetry there are stillexponentially many.

therefore, in the relaxed version we remove theintegrality constraints and the exponentiallymany subtour elimination constraints.

Page 5: Branch and Cut for TSP

5Jesper Larsen & Jens Clausen

Informatics and Mathematical Modelling / Operations Research

ChallengesFor the cutting plane approach to work we need to

1. be able to check whether any subtourelimination constraints are violated (efficiently)and

2. we must be able to solve the LP relaxationefficiently.

Page 6: Branch and Cut for TSP

6Jesper Larsen & Jens Clausen

Informatics and Mathematical Modelling / Operations Research

Problem 2Start by solving a smaller variant of the originalproblem. Let E ′ ⊆ E and solve:

min∑

e∈E′ dexe

s.t. x(δ(v)) = 2, v ∈ {1, . . . , n}x(δ(S)) ≥ 2, ∅ ⊂ S ⊂ V

0 ≤ xe ≤ 1, e ∈ E ′

An optimal solution x′ for this problem can beextended to a feasible solution for the originalproblem by x∗

e = x′e, e ∈ E ′ and

x∗e = 0, e ∈ E \ E ′.

Page 7: Branch and Cut for TSP

7Jesper Larsen & Jens Clausen

Informatics and Mathematical Modelling / Operations Research

BUT this solution might not be optimal in theoriginal relaxed problem.

Idea: Look at the dual problem.

Page 8: Branch and Cut for TSP

8Jesper Larsen & Jens Clausen

Informatics and Mathematical Modelling / Operations Research

Dual of the STSP

max∑

v∈V 2yv +∑

S⊂V 2YS

s.t. yu + yv +∑

(u,v)∈δ(S) YS ≤ duv, (u, v) ∈ E ′

YS ≥ 0, S ⊂ V

If (y′, Y ′) is also feasible for the dual linearprogramming problem of the original problemthen we know that x∗ is optimal

Otherwise add variables to E ′ that violated theconstraint of the dual linear programmingproblem and resolve.

Page 9: Branch and Cut for TSP

9Jesper Larsen & Jens Clausen

Informatics and Mathematical Modelling / Operations Research

Problem 1Here we use branch-and-cut.

Start of by removing the subtour eliminationconstraints. Then we get:

min∑

e∈E dexe

s.t. x(δ(v)) = 2, v ∈ {1, . . . , n}0 ≤ xe ≤ 1, e ∈ E

Let x∗ be a feasible solution to the initial linearprogramming problem.

Page 10: Branch and Cut for TSP

10Jesper Larsen & Jens Clausen

Informatics and Mathematical Modelling / Operations Research

If the solution falls apart into severalcomponents then the node set S of eachcomponent violates a subtour eliminationconstraint. This situation is very easy to detect.

We might end in a situation where the graph isnot disconnected but there are actually subtourelimination constraints that are violated. Howdo we detect those?

Page 11: Branch and Cut for TSP

11Jesper Larsen & Jens Clausen

Informatics and Mathematical Modelling / Operations Research

The separation algorithmUse max-flow to find cuts that are violated in thepresent situation. Here we have two problems:

Max-flow works on directed graphs – this is anon-directed graph.

We need a sink and a source to run themax-flow algorithm.

Page 12: Branch and Cut for TSP

12Jesper Larsen & Jens Clausen

Informatics and Mathematical Modelling / Operations Research

Now we are in a good position. We are now able todetect all possible subtour elimination constraints,but is that enough to solve the problem?

Page 13: Branch and Cut for TSP

13Jesper Larsen & Jens Clausen

Informatics and Mathematical Modelling / Operations Research

Consider the following part of a graph (dash is aflow of 0.5).

Page 14: Branch and Cut for TSP

14Jesper Larsen & Jens Clausen

Informatics and Mathematical Modelling / Operations Research

Comb inequalitiesLet C be a comb with a handle H and teethT1, T2, . . . , T2k+1 for k ≥ 1. Then the solution x for afeasible solution must satisfy:

x(E(H))+2k+1∑

i=1

x(E(Ti)) ≤ |H|+2k+1∑

i=1

(|Ti|−1)−(k+1)

Page 15: Branch and Cut for TSP

15Jesper Larsen & Jens Clausen

Informatics and Mathematical Modelling / Operations Research

These cuts are generally still not enough but thereare more cuts we could add:

Grötschel and Padberg (1985)

Jünger, Reinelt and Rinaldi (1995)

Naddef (1990)

Even these are not enough. There is today no fulldescription of the convex hull for the TSP.Furthermore for some of the valid inequalities theexists no efficient (polynomial) separation algorithm.

Page 16: Branch and Cut for TSP

16Jesper Larsen & Jens Clausen

Informatics and Mathematical Modelling / Operations Research

THEREFORE branch after having added all the“simple” valid inequalities.

Example:

Upper bound: 56892 (simple heuristic)Lower bound: 56785 (LP-relaxation, subtourand simple comb-ineq)Gap: 0.2% !!

Page 17: Branch and Cut for TSP

17Jesper Larsen & Jens Clausen

Informatics and Mathematical Modelling / Operations Research

16 cities –15 + 14 + 13 + . . . + 2 + 1 =16×15

2 = 120 variables.

Let us keep the constraintthat∑

j xij = 2, i = 1, . . . , N .

Relax integrality constraintson variables to 0 ≤ xij ≤ 1

Page 18: Branch and Cut for TSP

18Jesper Larsen & Jens Clausen

Informatics and Mathematical Modelling / Operations Research

Objective value: 920

Forbid the subtour Skagen-Thisted-Aalborg andresolve

Page 19: Branch and Cut for TSP

19Jesper Larsen & Jens Clausen

Informatics and Mathematical Modelling / Operations Research

Objective value: 960

Forbid the subtourFredericia-Kolding-Vejleand resolve

Page 20: Branch and Cut for TSP

20Jesper Larsen & Jens Clausen

Informatics and Mathematical Modelling / Operations Research

Objective value: 982

Forbid the subtour Kolding-Fredericia-Vejle-Esbjerg-Aabenraa-Tønder-Ribe andresolve

Page 21: Branch and Cut for TSP

21Jesper Larsen & Jens Clausen

Informatics and Mathematical Modelling / Operations Research

Objective value: 992.5

Identify a comb inequal-ity: Handle being Thisted,Ringkøbing and Herning;teeth being (Thisted, Ska-gen), (Ringkøbing, Esbjerg)and (Herning, Vejle).

Page 22: Branch and Cut for TSP

22Jesper Larsen & Jens Clausen

Informatics and Mathematical Modelling / Operations Research

Objective value: 992.5

Identify a comb inequal-ity: Handle being Ve-jle, Silkeborg and Aarhus;teeth being (Vejle, Fred-ericia), (Silkeborg, Viborg)and (Aarhus, Randers).

Page 23: Branch and Cut for TSP

23Jesper Larsen & Jens Clausen

Informatics and Mathematical Modelling / Operations Research

Objective value: 994.5

Identify a comb inequality:Handle being Viborg, Ran-ders and Aalborg; teethbeing (Viborg, Silkeborg),(Randers, Aarhus) and(Aalborg, Skagen).

Page 24: Branch and Cut for TSP

24Jesper Larsen & Jens Clausen

Informatics and Mathematical Modelling / Operations Research

Objective value: 996

Integer solution!!!