D1 Discrete Mathematics The Travelling Salesperson problem. The Nearest Neighbour Algorithm The Lower Bound Algorithm The Tour Improvement Algorithm

Similar documents
VIII. NP-completeness

REVISION SHEET DECISION MATHS 2 DECISION ANALYSIS

Curriculum Area: Mathematics A Level - 2 year course (AQA) Year: 12. Aspire Learn Achieve

Warm-up Find the shortest trip (total distance) starting and ending in Chicago and visiting each other city once.

Bounds on the Traveling Salesman Problem

Circuits. CSE 373 Data Structures

Optimization Prof. A. Goswami Department of Mathematics Indian Institute of Technology, Kharagpur. Lecture - 20 Travelling Salesman Problem

LECTURE 1: INTRODUCTION

Check off these skills when you feel that you have mastered them. Write in your own words the definition of a Hamiltonian circuit.

Algorithm Design Strategies V

1 Heuristics for the Traveling Salesman Problem

Chapter 2. Business Efficiency. Chapter Outline. Chapter Summary

ECS122A Handout on NP-Completeness March 12, 2018

(tree searching technique) (Boolean formulas) satisfying assignment: (X 1, X 2 )

Greedy Algorithms. Kleinberg and Tardos, Chapter 4

Optimisation and Operations Research

Combinatorial Optimization

Intro to Contemporary Math

Decision Problems TSP. Instance: A complete graph G with non-negative edge costs, and an integer

Single Machine Models

2. A vertex in G is central if its greatest distance from any other vertex is as small as possible. This distance is the radius of G.

Do not turn this page until you have received the signal to start. Please fill out the identification section above. Good Luck!

2 Notation and Preliminaries

Data Structures in Java

Discrete Optimization 2010 Lecture 2 Matroids & Shortest Paths

3.4 Relaxations and bounds

from notes written mostly by Dr. Matt Stallmann: All Rights Reserved

CS/COE

Discrete Wiskunde II. Lecture 5: Shortest Paths & Spanning Trees

History, Analysis, and Implementation of Traveling Salesman Problem (TSP) and Related Problems

How hard is it to find a good solution?

8.3 Hamiltonian Paths and Circuits

ABHELSINKI UNIVERSITY OF TECHNOLOGY

Mathematics (JUN10MD0101) General Certificate of Education Advanced Subsidiary Examination June Unit Decision TOTAL

Swarm Intelligence Traveling Salesman Problem and Ant System

Decision Mathematics Module D1

Traveling Salesman Problem (TSP) - Visit every city and then go home.

Data Structures and Algorithms

Algorithms and Complexity theory

Connection MATH Connection. Benjamin V.C. Collins, James A. Swenson MATH 2730

Practice Final Solutions. 1. Consider the following algorithm. Assume that n 1. line code 1 alg(n) { 2 j = 0 3 if (n = 0) { 4 return j

The P = NP Problem Bristol Teachers Circle, June P.D.Welch, University of Bristol

Unit 7 Day 4 Section 4.5 & Practice Hamiltonian Circuits and Paths

More on NP and Reductions

MATHEMATICS Unit Decision 1

Decision Mathematics D1

Decision Mathematics D1 Advanced/Advanced Subsidiary. Tuesday 9 June 2015 Morning Time: 1 hour 30 minutes

Hamiltonian Cycle. Zero Knowledge Proof

Algorithms and Theory of Computation. Lecture 22: NP-Completeness (2)

UNIVERSITY OF YORK. MSc Examinations 2004 MATHEMATICS Networks. Time Allowed: 3 hours.

P, NP, NP-Complete. Ruth Anderson

Interventionist Routing Algorithm for single-block warehouse: Application and Complexity

Part III: Traveling salesman problems

Decision Mathematics D1 Advanced/Advanced Subsidiary. Friday 17 May 2013 Morning Time: 1 hour 30 minutes

A Survey on Travelling Salesman Problem

Analysis of Uninformed Search Methods

Question Paper Code :

Node Edge Arc Routing Problems (NEARP)

FINAL EXAM PRACTICE PROBLEMS CMSC 451 (Spring 2016)

GTOC 7 Team 12 Solution

Decision Mathematics D1

University of Toronto Department of Electrical and Computer Engineering. Final Examination. ECE 345 Algorithms and Data Structures Fall 2016

CMPSCI611: The Matroid Theorem Lecture 5

Proof methods and greedy algorithms

A path that visits each vertex exactly once is a path

Unit 1A: Computational Complexity

July 18, Approximation Algorithms (Travelling Salesman Problem)

Euler and Hamilton Paths

Design and Analysis of Algorithms May 12, 2011 Massachusetts Institute of Technology. Practice Final Exam. Problem Title Points Parts Grade Initials

AS Further Mathematics

Mathematical Thinking Exam 2 20 November 2017

Tractable & Intractable Problems

Informatique Fondamentale IMA S8

AM 121: Intro to Optimization Models and Methods Fall 2018

Introduction. An Introduction to Algorithms and Data Structures

MATH 22 HAMILTONIAN GRAPHS. Lecture V: 11/18/2003

Problem Set 3 Due: Wednesday, October 22nd, 2014

Part III: Traveling salesman problems

September 14, 1999 Name The first 16 problems count 5 points each and the final 3 count 15 points each.

Theoretical computer science: Turing machines

Maximum Flow Problem (Ford and Fulkerson, 1956)

A path that visits each vertex exactly once is a Hamiltonian path. A circuit that visits each vertex exactly once is a Hamiltonian circuit.

Optimization (2MMD10/2DME20), lecture 1b. Gerhard Woeginger. Technische Universiteit Eindhoven

NP and Computational Intractability

NP Completeness and Approximation Algorithms

15.083J/6.859J Integer Optimization. Lecture 2: Efficient Algorithms and Computational Complexity

Finding optimal configurations ( combinatorial optimization)

Lecture 6 January 21, 2013

Pearson Edexcel GCE Decision Mathematics D2. Advanced/Advanced Subsidiary

Decision Mathematics D1

Algorithms: COMP3121/3821/9101/9801

NP-Completeness. CptS 223 Advanced Data Structures. Larry Holder School of Electrical Engineering and Computer Science Washington State University

LATITUDES AND LONGITUDES

P vs. NP. Data Structures and Algorithms CSE AU 1

The algorithm of adaptive random search for discrete-continuous optimization 1

PhysicsAndMathsTutor.com

Design and Analysis of Algorithms April 16, 2015 Massachusetts Institute of Technology Profs. Erik Demaine, Srini Devadas, and Nancy Lynch Quiz 2

Contents Lecture 4. Greedy graph algorithms Dijkstra s algorithm Prim s algorithm Kruskal s algorithm Union-find data structure with path compression

Trees/Intro to counting

Vehicle Routing and Scheduling. Martin Savelsbergh The Logistics Institute Georgia Institute of Technology

Transcription:

1 iscrete Mathematics The Travelling Salesperson problem The Nearest Neighbour lgorithm The Lower ound lgorithm The Tour Improvement lgorithm

The Travelling Salesperson: Typically a travelling salesperson will want to cover all the towns in their area using the minimum driving distance. Travelling salesperson problems tackle this by first turning the towns and roads into a network. We have seen that finding a tour that visits every arc (route inspection) depended on earlier work by Euler. Similarly the problem of finding a tour that visits every node (travelling salesperson) was investigated in the 19 th entury by the Irish mathematician Sir William Hamilton. efinition: Hamiltonian cycle is a tour which contains every node once

with weight 1 There are just three essentially different Hamiltonian cycles: onsider the Hamiltonian cycles for this graph 2 with weight 17 with weight 17 2 2

However, not all graphs have Hamiltonian cycles. onsider this graph: 3 23 12 3 33 21 salesperson living in town, say, may still want to find the shortest round trip visiting every town. To enable you to use the next three algorithms you can replace any network like this one by the complete network of shortest distances. The shortest distance between and is 33 (via : 12 + 21) The shortest distance between and is 3 (via : 12 + 23) dding direct arcs and does not change the problem but does produce a graph with Hamiltonian cycles. The rest of this module assumes the problem is always the classical one of finding a Hamiltonian cycle of minimum weight with no repetition of nodes. Our next algorithm is called the Nearest Neighbour it will find a solution to a travelling salesperson problem but not necessarily the best (optimum). So we will then look at finding limits between which the optimum solution must lie and how to improve any solution we find.

The Nearest Neighbour lgorithm To find a (reasonably good) Hamiltonian cycle i.e. a closed trail containing every node of a graph Step 1 hoose any starting node Step 2 onsider the arcs which join the node just chosen to nodes as yet unchosen. Pick the one with minimum weight and add it to the cycle Step 3 Repeat step 2 until all nodes have been chosen Step Then add the arc that joins the last-chosen node to the first-chosen node

To find a (reasonably good) Hamiltonian cycle i.e. a closed trail containing every node of this graph using the Nearest Neighbour lgorithm: 7 7 E E hoose any starting node let s say onsider the arcs which join the node just chosen to nodes as yet unchosen. Pick the one with minimum weight and add it to the cycle The first arc is as is the least of,, and From, E is chosen as is the least of 7, 7, and Then E,, and finally The cycle is E which has weight 2 ( + + + + ) The Nearest Neighbour lgorithm is greedy because at each stage the immediately best route is chosen, without a look ahead, or back, to possible future problems or better solutions. We do know that the optimum solution will have an equal or lower weight than it (by definition) and so the algorithm has produced an upper bound. This then begs the question: an we find a lower bound to see how much potential there is for improvement?

Step 1 Step 2 The Lower ound lgorithm To find a lower bound for a travelling salesperson problem Step 3 Pick any node and remove the two connecting arcs with least weight Find the minimum spanning tree for the other nodes using Prim s algorithm dd back in the two arcs removed previously Step The weight of the resulting graph (which may not be a cycle) is a lower bound i.e. any optimum solution must have at least this weight

To find a lower bound for a Hamiltonian cycle using the Lower ound lgorithm: 7 How do we know this? 7 E Pick any node and remove the two connecting arcs with least weight Let s pick and remove arcs and E Find the minimum spanning tree for E using Prim s algorithm Pick any starting node, say,. The shortest arc is, then E and finally E. Now we add in the two arcs we removed earlier This tree has weight 2 ( + + + + ) The optimum solution must have at least this weight Well, any Hamiltonian cycle must consist of arcs (because there are nodes): 2 arcs into and out of and the other three arcs connecting,, and E. The two arcs from must have weight of at least +, since these are the smallest available. y applying Prim s algorithm to,, and E we can see that the three arcs connecting,, and E must have at least weight + + (the minimum connector or spanning tree) Hence, it is impossible for any Hamiltonian cycle to have weight less than + + + +

The Tour Improvement lgorithm To look for possible improvement in a tour found by the nearest neighbour algorithm: 1 2 Step 1 Number the nodes in the order of the tour; start at node 1 Step 2 onsider just the part of the tour 1 3 1-2 - 3-2 Step 3 Swap the middle nodes to change the order to 1-3 - 2 - Step ompare the two and keep the order with the lower weight 3 Step Move on to node 2 and repeat until each node has been the start node once

To look for possible improvement in a tour using the tour improvement algorithm: Here is a network: 7 7 nd here is a tour: E It has weight 3 Let s see if we can improve on that: We have now had each node at the front and so we stop. The final tour is E. E Pick as node 1 and consider the tour from --E- This has weight + + = 21 Now swap the middle two nodes nd you get -E-- This has weight + + 7 = 20 So swap E and and the tour becomes E Now look at E E = + 7 + 7 = 22 E = + 7 + = 17 So swap and and the tour becomes E Now look at = 7 + + = 1 = 7 + + = 20 So leave the tour as E Now look at E E = + + = 1 E = + + = 20 So leave the tour as E Now look at E E = + + = 1 E = + + = 1 So swap and E and the tour becomes E

1 2 3