The travelling Salesman problem involves visiting every town (node) on a graph and returning to the start in the shortest distance. The slides will show.

Slides:



Advertisements
Similar presentations
Decision Maths Networks Kruskals Algorithm Wiltshire Networks A Network is a weighted graph, which just means there is a number associated with each.
Advertisements

ITS THE FINAL LECTURE! (SING IT, YOU KNOW YOU WANT TO) Operations Research.
Networks Prim’s Algorithm
Discrete Maths Chapter 3: Minimum Connector Problems Lesson 1: Prim’s and Kruskal.
Graphs: MSTs and Shortest Paths David Kauchak cs161 Summer 2009.
MINIMAL CONNECTOR PROBLEMS Problem: A cable TV company is installing a system of cables to connect all the towns in a region. The numbers in the network.
Prim’s Algorithm from a matrix A cable TV company is installing a system of cables to connect all the towns in the region. The numbers in the network are.
Graphs & Graph Algorithms 2 Nelson Padua-Perez Bill Pugh Department of Computer Science University of Maryland, College Park.
Algorithms on graphs In Decision Mathematics, a graph consists of points (called vertices or nodes) which are connected by lines (edges or arcs). Eg in.
The Travelling Salesman Algorithm A Salesman has to visit lots of different stores and return to the starting base On a graph this means visiting every.
1 Minimum Spanning Trees Longin Jan Latecki Temple University based on slides by David Matuszek, UPenn, Rose Hoberman, CMU, Bing Liu, U. of Illinois, Boting.
1 Minimum Spanning Trees Longin Jan Latecki Temple University based on slides by David Matuszek, UPenn, Rose Hoberman, CMU, Bing Liu, U. of Illinois, Boting.
Minimum Spanning Trees What is a MST (Minimum Spanning Tree) and how to find it with Prim’s algorithm and Kruskal’s algorithm.
C o n f i d e n t i a l HOME NEXT Subject Name: Data Structure Using C Unit Title: Graphs.
Copyright © Cengage Learning. All rights reserved.
Shortest Path Algorithm This is called “Dijkstra’s Algorithm” …pronounced “Dirk-stra”
Chapter 9 – Graphs A graph G=(V,E) – vertices and edges
Networks and the Shortest Path Problem.  Physical Networks  Road Networks  Railway Networks  Airline traffic Networks  Electrical networks, e.g.,
© Peter Andreae CS4HS Algorithms Searching for an item in a list Sorting a list Searching for a word in text Analysing Networks.
Minimum spanning trees Aims: To know the terms: tree, spanning tree, minimum spanning tree. To understand that a minimum spanning tree connects a network.
Minimum Spanning Trees
Problem Solving with Networks 18/08/2012 Jamie Sneddon
Graph Theory Hamilton Paths and Hamilton Circuits.
Networks.
COSC 2007 Data Structures II Chapter 14 Graphs III.
Structures 7 Decision Maths: Graph Theory, Networks and Algorithms.
Minimum spanning trees Aims: To know the terms: tree, spanning tree, minimum spanning tree. To understand that a minimum spanning tree connects a network.
Minimal Spanning Tree Problems in What is a minimal spanning tree An MST is a tree (set of edges) that connects all nodes in a graph, using.
TSP – Upper Bounds and Lower Bounds Initial problem : Upper Bound A salesman based in Stockton needs to visit shops based in Darlington, Billingham, Middlesbrough,
Graphs A ‘Graph’ is a diagram that shows how things are connected together. It makes no attempt to draw actual paths or routes and scale is generally inconsequential.
The Travelling Salesperson Problem A salesperson needs to visit London, Nottingham, Manchester and Leeds, he lives in Birmingham. Find the shortest route.
Minimum- Spanning Trees
I can describe the differences between Hamilton and Euler circuits and find efficient Hamilton circuits in graphs. Hamilton Circuits I can compare and.
Network Problems A D O B T E C
Chapter 14 Section 3 - Slide 1 Copyright © 2009 Pearson Education, Inc. AND.
DECISION 1. How do you do a Bubble Sort? Bubble Sort:  You compare adjacent items in a list;  If they are in order, leave them.  If they are not in.
Grade 11 AP Mathematics Graph Theory Definition: A graph, G, is a set of vertices v(G) = {v 1, v 2, v 3, …, v n } and edges e(G) = {v i v j where 1 ≤ i,
AS Decision Maths Tips for each Topic. Kruskal and Prim What examiner’s are looking for A table of values in the order that they are added and the total.
The travelling salesman problem Finding an upper bound using minimum spanning trees Find a minimum spanning tree using Prim’s algorithm or Kruskal’s algorithm.
Graphs – Part III CS 367 – Introduction to Data Structures.
Networks Teacher’s guide. Networks 2 Problem 1 – the Link The EMTV Company needs to install a new cable system that links the six major towns in its.
Lower bound algorithm. 1 Start from A. Delete vertex A and all edges meeting at A. A B C D 4 5 E Find the length of the minimum spanning.
Hamilton Paths and Hamilton Circuits
D1 Discrete Mathematics
Shortest Paths and Minimum Spanning Trees
Shortest Path from G to C Using Dijkstra’s Algorithm
Lesson Objectives Aims Understand the following “standard algorithms”:
Chapter 2: Business Efficiency Lesson Plan
Party-by-Night Problem
Spanning Trees.
Minimum Spanning Tree.
The Travelling Salesperson problem
D1 Discrete Mathematics
Decision Maths Dijkstra’s Algorithm.
CSE 373 Data Structures and Algorithms
Shortest Path.
Louisiana Travels.
Applied Combinatorics, 4th Ed. Alan Tucker
Shortest Paths and Minimum Spanning Trees
AS Maths Decision Paper January 2012 Model Answers.
The travelling salesman problem
Networks Kruskal’s Algorithm
Rounded Off Values Upper and Lower Bounds.
Minimum Spanning Tree.
CSE 373: Data Structures and Algorithms
Networks Prim’s Algorithm
The travelling salesman problem
Prim’s algorithm for minimum spanning trees
CSE 373: Data Structures and Algorithms
Jan 2009.
Presentation transcript:

The travelling Salesman problem involves visiting every town (node) on a graph and returning to the start in the shortest distance. The slides will show how to find 2 values that the actual journey lies between called the Upper and Lower Bound. The French towns below have to be visited Travelling Salesman Problem

The following slides show how to find an Upper Bound to the travelling Salesman Problem using the Nearest Neighbour Algorithm and a Lower Bound by removing a town and using the Minimum Connector Algorithm Travelling Salesman Problem Link to Nearest Neighbour Algorithm to find an Upper Bound Link to finding a Lower Bound using Kruskals Algorithm

Nearest Neighbour Algorithm This is will give an Upper Bound to the Travelling Salesman problem. It may be possible to complete the journey in a smaller distance but the Upper Bound is an upper limit to the required distance and is definitely possible. The smaller the Upper Bound the better

Nearest Neighbour from a Table The chart shows the distances between French towns

1.Choose a starting town 2.Find the nearest neighbour 3.Repeat step 2 ensuring that you have not already been there. 4.When all the towns have been visited return to the starting town using the shortest route. 5.Repeat using a different starting place and the answer giving the lowest total distance is the Upper Bound

Start at Lyons Reading across nearest neighbour is Dijon – 192 miles Reading down nearest neighbour is St Etienne – 59 miles Choose St Etienne LyonsSt Etienne 1 2

Carry on from St Etienne Reading across nearest neighbour is Dijon – 244 miles Reading down nearest neighbour is Toulouse – 528 miles Choose Dijon LyonsSt Etienne Dijon

Carry on from Dijon Cannot choose Lyons as this has already been used Reading across nearest neighbour is Calais – 543 miles Reading down nearest neighbour is Orleans – 297 miles Choose Orleans LyonsSt Etienne Dijon Orleans

Carry on from Orleans Reading across nearest neighbour is Calais – 421 miles Reading down nearest neighbour is Poitiers – 212 miles Choose Poitiers LyonsSt Etienne Dijon Orleans Poitiers

Carry on from Poitiers Reading across nearest neighbour is Bordeaux – 247 miles Reading down nearest neighbour is Toulouse – 435 miles Cannot choose St Etienne as already visited Choose Bordeaux LyonsSt Etienne Dijon OrleansPoitiers Bordeaux 6

Carry on from Bordeaux Reading down nearest neighbour is Toulouse – 244 miles Cannot read across Choose Toulouse LyonsSt Etienne Dijon OrleansPoitiers Bordeaux Toulouse 6 7

Carry on from Toulouse Reading across nearest neighbour is Marseille – 405 miles Cannot read down Choose Marseille LyonsSt Etienne Dijon OrleansPoitiers Bordeaux Toulouse 6 7 Marseille 8

Carry on from Marseille Reading across nearest neighbour is Calais – 1067 miles (Rest have all been visited) Reading down nearest neighbour have all been visited Choose Calais LyonsSt Etienne Dijon Orleans Poitiers Bordeaux Toulouse 6 7 Marseille 8 8 Calais

Carry on from Calais All towns have been visited so return to Lyons – 751 miles LyonsSt Etienne Dijon OrleansPoitiers Bordeaux Toulouse 6 7 Marseille 8 8 Calais Total distance = total of circled values = 3526 miles Upper Bound = 3526

Now repeat using a different starting value The lowest value obtained is the Upper Bound This means that the shortest route is equal or less than the Upper Bound

Lower Bound This is the smallest journey that it may be possible to do. It may not in fact be possible to actually achieve this distance but it is a value to aim for. The actual journey length lies between the upper and lower bound.

Lower Bound from a Table The chart shows the distances between French towns

1.Remove one of the towns 2.Find the minimum connector of the remaining towns using Prim or Kruskal 3.Add the town removed back in using the shortest 2 arcs. 4.Find the total length of all the arcs used.

Remove Marseille Now do Kruskals Algorithm Find the shortest distance : Draw it 1 2 St EtienneLyons St Etienne to Lyon 59 miles

Find the next shortest distance Draw it 1 2 St EtienneLyons Dijon 3 Dijon to Lyons 192 miles

Find the next shortest distance Draw it 1 2 St EtienneLyons Dijon 3 PoitiersOrleans 4 5 Orleans to Poitiers 212 miles

Find the next shortest distance Ignore Dijon to St Etienne as this makes a cycle Draw it 1 2 St EtienneLyons Dijon 3 PoitiersOrleans 4 ToulouseBordeaux Bordeaux to Toulouse 244 miles

Find the next shortest distance Draw it 1 2 St EtienneLyons Dijon 3 PoitiersOrleans 4 ToulouseBordeaux Bordeaux to Poitiers 247 miles

Find the next shortest distance Draw it 1 2 St EtienneLyons Dijon 3 PoitiersOrleans 4 ToulouseBordeaux Orleans to Dijon 297 miles

Find the next shortest distance Ignore Orleans to St Etienne and Poitiers to St Etienne as these make a cycle Draw it 1 2 St EtienneLyons Dijon 3 PoitiersOrleans 4 ToulouseBordeaux Calais Calais to Orleans 421 miles

Now all the towns are connected with the minimum connector Finally join Marseille back in with the shortest 2 arcs 1 2 St EtienneLyons Dijon 3 PoitiersOrleans 4 ToulouseBordeaux Calais

Now all the towns are connected with the minimum connector Finally join Marseille back in with the shortest 2 arcs 1 2 St EtienneLyons Dijon 3 PoitiersOrleans 4 ToulouseBordeaux Calais Marseille

Adding up all the circled distances gives a lower bound This can be repeated to find another lower bound by removing a different town 1 2 St EtienneLyons Dijon 3 PoitiersOrleans 4 ToulouseBordeaux Calais Marseille Lower Bound = 2297

The highest lower bound is the best as the actual answer lies between the Lower and Upper bound. If the Lower and Upper bound are the same then that is the answer 1 2 St EtienneLyons Dijon 3 PoitiersOrleans 4 ToulouseBordeaux Calais Marseille Lower Bound = 2297

LyonsSt Etienne Dijon OrleansPoitiers Bordeaux Toulouse 6 7 Marseille 8 8 Calais Total distance = 3526 miles Upper Bound = 3526

Lower Bound = 2297 The actual answer lies between the Lower and Upper bound and can only be found by trial and error. The Upper and Lower Bound give an idea as to what the actual answer lies between The smaller the gap the better. Remember need High Lower Bound and Low Upper Bound.