Branch and Cut for the Travelling Salesman Problem CS 581 Neil - - PowerPoint PPT Presentation

branch and cut for the travelling salesman problem
SMART_READER_LITE
LIVE PREVIEW

Branch and Cut for the Travelling Salesman Problem CS 581 Neil - - PowerPoint PPT Presentation

Branch and Cut for the Travelling Salesman Problem CS 581 Neil Lindquist, Nigel Tan 1 Neil Lindquist 1st year CS PhD student Numerical linear algebra B.A. in CS and Math Saint Johns University Originally from New Ulm 2


slide-1
SLIDE 1

Branch and Cut for the Travelling Salesman Problem

CS 581 Neil Lindquist, Nigel Tan

1

slide-2
SLIDE 2

Neil Lindquist

  • 1st year CS PhD student
  • Numerical linear algebra
  • B.A. in CS and Math
  • Saint John’s University
  • Originally from New Ulm

2

slide-3
SLIDE 3

Neil Lindquist

  • Rowing
  • Board games
  • Sci Fi movies/TV shows

3

slide-4
SLIDE 4

Nigel Tan

  • Originally from San Diego
  • Enrolled in 4 colleges
  • B.S. in CS and Applied Math at

UC Merced

  • MS in Computational and

Applied Math at Rice

  • PhD in CS at UTK
  • My family comes from the

Philippines

4

slide-5
SLIDE 5

Nigel Tan

  • May be the only student in UTK collaborating

with Los Alamos National Lab

  • Fan of Thai and Japanese food
  • Had Koi fish for pets

5

slide-6
SLIDE 6

Questions

  • 1. How do we ensure integer values in the solution?
  • 2. How many subtour elimination constraints are there?
  • 3. How do we detect violations of the subtour elimination

constraints?

6

slide-7
SLIDE 7

Travelling Salesman Problem

  • Given a list of cities and distances between them, compute

the shortest path that visits each city exactly once and returns to the origin city.

  • NP-Hard
  • Richard Karp showed finding a Hamiltonian cycle is NP-Complete
  • A Hamiltonian cycle is a path that visits each vertex only once
  • Millennium problem
  • Important for applications requiring routing
  • Delivery, drilling machines, space travel

7

slide-8
SLIDE 8

Examples

8

UK49687 Pub Crawl 63,739,687 meters http://www.math.uwaterloo.ca /tsp/uk/uk49_run720.mp4 100,000 city TSP representing the Mona Lisa as a continuous-line drawing. $1000 Prize Tour of 2,008 Pokestops in Houston TX. 2,121,499 meters or 1,318 miles

slide-9
SLIDE 9

History

  • Exact origins are unclear
  • Formulated in 1800s by Sir William Rowan Hamilton and

Thomas Penyngton Kirkman

  • The Icosian Game: Find a Hamiltonian cycle on the edges of a

dodecahedron

  • Mathematically defined by Karl Menger in the 1930s
  • Nicos Christofides published approximate algorithm in 1976
  • Finds an approximate solution within 1.5x the optimal path
  • Still the best approximation algorithm in general

9

slide-10
SLIDE 10

Linear Programming Formulation

denotes whether edge e is in the path

10

Minimum weight tour Integer constraints

slide-11
SLIDE 11

Linear Programming Formulation

denotes whether edge e is in the path

11

Minimum weight tour Integer constraints Each vertex has 2 edges

slide-12
SLIDE 12

Subtour Elimination Constraints (SEC)

12

2 subtours that satisfy (2) and (4) but are not a valid solution to the TSP. We need to add constraints to prevent subtours

slide-13
SLIDE 13

Subtour Elimination Constraints (SEC)

13

Let S be a subset of V (in red). We can prevent subtours by requiring the following

slide-14
SLIDE 14

Linear Programming Formulation

denotes whether edge e is in the path

14

Minimum weight tour Integer constraints Each vertex has 2 edges Subtour elimination constraints

slide-15
SLIDE 15

Linear Programming Formulation

denotes whether edge e is in the path

15

2|V| constraints!

slide-16
SLIDE 16

Solve a relaxed problem instead

denotes whether edge e is in the path

16

slide-17
SLIDE 17

Branch and Cut

  • Check solution of relaxed problem against original

constraints

  • Fix non-integral values with branch and bound
  • Fix violations of SEC by re-adding the specific constraint
  • Add a “cutting plane”

17

slide-18
SLIDE 18

Branch and Bound

  • Given an LP solution with a non-integral variable xi, solve

two variations of the LP problem

  • One with xi = 1
  • One with xi = 0
  • For non-integral solutions, branch again
  • Unless the objective value is worse than the best integral

solution found (bound)

  • For integral solutions, record the best

18

slide-19
SLIDE 19

Branch and Bound Example

19

z = 4 Non-int xi = 0 z = ? xi = 1 z = ? Minimizing Upper Bound: ∞ Lower Bound: 4

slide-20
SLIDE 20

Branch and Bound Example

20

z = 4 Non-int xi = 0 z = 6 int xi = 1 z = ? Minimizing Upper Bound: 6 Lower Bound: 4

Record as best solution found

slide-21
SLIDE 21

Branch and Bound Example

21

z = 4 Non-int xi = 0 z = 6 int xi = 1 z = 5.5 non-int Minimizing Upper Bound: 6 Lower Bound: 5.5 xj = 0 z = ? xj = 1 z = ?

Smallest z of open nodes is 5.5. We cannot do better than that

slide-22
SLIDE 22

Branch and Bound Example

22

z = 4 Non-int xi = 0 z = 6 int xi = 1 z = 5.5 non-int Minimizing Upper Bound: 6 Lower Bound: 5.5 xj = 0 z = 6.1 non-int xj = 1 z = ?

All children will have z ≥ 6.1 Thus, they cannot be optimal

  • Bounded. Don’t recurse further
slide-23
SLIDE 23

Branch and Bound Example

23

z = 4 Non-int xi = 0 z = 6 int xi = 1 z = 5.5 non-int Minimizing Upper Bound: 6 Lower Bound: 5.5 xj = 0 z = 6.1 non-int xj = 1 z = 6.4 int

Integral, but not an improvement No remaining open nodes. 6 is the optimal objective value.

slide-24
SLIDE 24

Min-Cut

  • How to detect SEC violations?
  • Use the min-cut algorithm
  • If the cut crosses < 2 edges the solution contains a subtour

24

Wc = 0

slide-25
SLIDE 25

Min-Cut

  • Stoer-Wagner Algorithm
  • O(|V||E|+|V|²log|V|), (O(|E|+|V|log|V|) with Fibonacci heap)

25

Stoer, Mechthild, and Frank Wagner. "A simple min-cut algorithm." Journal of the ACM (JACM) 44.4 (1997): 585-591.

slide-26
SLIDE 26

Stoer-Wagner Min-Cut Algorithm

26

1 5 2 6 3 7 4 8 3 1 3 2 2 2 2 4 3 2 2 3

slide-27
SLIDE 27

Stoer-Wagner Min-Cut Algorithm

27

1 5 2 6 3 7 4 8 3 1 3 2 2 2 2 4 3 2 2 3 1 5 2 6 3 7 4 8 3 1 3 2 2 2 2 4 3 2 2 3 Start

w = 5, Best Cut = 5

slide-28
SLIDE 28

Stoer-Wagner Min-Cut Algorithm

28

1,5 2 6 3 7 4 8 3 1 3 2 2 2 2 4 3 4

w = 5, Best Cut = 5

Start

slide-29
SLIDE 29

Stoer-Wagner Min-Cut Algorithm

29

1,5 2 6 3 7,8 4 3 1 2 2 4 4 3 4

w = 7, Best Cut = 5

Start

slide-30
SLIDE 30

Stoer-Wagner Min-Cut Algorithm

30

1,5 2 6 3 4 7,8 3 1 2 6 3 4

w = 7, Best Cut = 5

Start

slide-31
SLIDE 31

Stoer-Wagner Min-Cut Algorithm

31

1,5 2 6 3,4 7,8 3 2 3 4 1

w = 4, Best Cut = 4

Start

slide-32
SLIDE 32

Stoer-Wagner Min-Cut Algorithm

32

1,5 2 3,4 6,7, 8 3 5 4

w = 7, Best Cut = 4

Start

slide-33
SLIDE 33

Stoer-Wagner Min-Cut Algorithm

33

2 V \ 2 9

w = 9, Best Cut = 4

Start

slide-34
SLIDE 34

Stoer-Wagner Min-Cut Algorithm

34

1 5 2 6 3 7 4 8 3 1 3 2 2 2 2 4 3 2 2 3 Minimum cut

slide-35
SLIDE 35

TSP Test Examples

  • att48
  • 48 capitals of U.S., 1128 edges
  • berlin52
  • 52 locations in Berlin, 1326 edges
  • gr21
  • 21 city problem by Martin Groetschel, 210 edges
  • hk48
  • 48 city problem by Michael Held and Richard Karp, 1128 edges
  • pr76
  • 76 city problem by Manfred Padberg and Giovanni Rinaldi, 2850 edges
  • st70
  • 70 city problem by T.H.C. Smith Gerald Thompson, 2415 edges
  • ulysses22
  • Odyssey of Ulysses by Martin Groetschel and Manfred Padberg, 231 edges

35

slide-36
SLIDE 36

TSP Examples

  • Implemented with Gurobi
  • Only used for solving relaxed LPs
  • Ryzen 5 2600, 3.4 - 3.9 GHz
  • Single threaded
  • Using the nearest neighbor algorithm for the initial bound

36

slide-37
SLIDE 37

Results

37

Graph

  • Avg. Time (s)

# of branch nodes # of subtours att48 0.862226057 13 20 berlin52 0.166384503 1 3 gr21 0.001985988 1 hk48 0.550707614 7 11 st70 14.51977184 97 41 ulysses22 0.015799748 1 8 pr76 2904.12748115 23467 391

slide-38
SLIDE 38

Other Cuts & Inequalities

  • Chvatal-Gomory cuts
  • 2-matching inequalities
  • Where 𝜀 is the set of edges with only 1 vertex in S
  • Comb inequalities
  • 38

http://homepages.rpi.edu/~mitchj/handouts/gomorycuts/gomorycuts.html

slide-39
SLIDE 39

Questions

  • 1. How do we ensure integer values in the solution?
  • 2. How many subtour elimination constraints are there?
  • 3. How do we detect violations of the subtour elimination

constraints?

39