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.

Slides:



Advertisements
Similar presentations
Decision Maths Dijkstra’s Algorithm.
Advertisements

Design and Analysis of Algorithms Approximation algorithms for NP-complete problems Haidong Xue Summer 2012, at GSU.
Chapter 15 Graph Theory © 2008 Pearson Addison-Wesley. All rights reserved.
Excursions in Modern Mathematics(Tannenbaum) and Thinking Mathematically (Blitzer)
Graph Algorithms: Minimum Spanning Tree We are given a weighted, undirected graph G = (V, E), with weight function w:
§ Algorithms, Algorithms, Algorithms Recall that an algorithm is a set of procedures or rules that, when followed, lead to a ‘solution’ to.
A traveling salesman has customers in 5 cities which we will call A, B, C, D, and E. The salesman needs to travel to all 5 cities with his trip starting.
Chapter 2: Business Efficiency Lesson Plan Business Efficiency  Visiting Vertices-Graph Theory Problem Hamiltonian Circuits  Vacation Planning Problem.
Minimum Spanning Trees. Subgraph A graph G is a subgraph of graph H if –The vertices of G are a subset of the vertices of H, and –The edges of G are a.
Copyright © Cengage Learning. All rights reserved.
Shortest Path. Dijkstra’s Algorithm finds the shortest path from the start vertex to every other vertex in the network. We will find the shortest path.
SPANNING TREES Lecture 21 CS2110 – Spring
Graph Theory Hamilton Paths and Hamilton Circuits.
© Nuffield Foundation 2011 Nuffield Free-Standing Mathematics Activity Chinese postman problems What route can I take to avoid going along the same street.
Which of these can be drawn without taking your pencil off the paper and without going over the same line twice? If we can find a path that goes over all.
Structures 7 Decision Maths: Graph Theory, Networks and Algorithms.
6.1 Hamilton Circuits and Paths: Hamilton Circuits and Paths: Hamilton Path: Travels to each vertex once and only once… Hamilton Path: Travels to each.
Module 5 – Networks and Decision Mathematics Chapter 23 – Undirected Graphs.
Spring 2015 Mathematics in Management Science Traveling Salesman Problem Approximate solutions for TSP NNA, RNN, SEA Greedy Heuristic Algorithms.
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.
Copyright 2013, 2010, 2007, Pearson, Education, Inc. Section 14.3 Hamilton Paths, and Hamilton Circuits.
Branch and bound branch and bound methods economize the search for the best trees by backing out of dead alleys.
TSP – Upper Bounds and Lower Bounds Initial problem : Upper Bound A salesman based in Stockton needs to visit shops based in Darlington, Billingham, Middlesbrough,
WK15. Vertex Cover and Approximation Algorithm By Lin, Jr-Shiun Choi, Jae Sung.
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.
CIRCUITS, PATHS, AND SCHEDULES Euler and Königsberg.
SPANNING TREES Lecture 20 CS2110 – Fall Spanning Trees  Definitions  Minimum spanning trees  3 greedy algorithms (incl. Kruskal’s & Prim’s)
EULER PATHS & CHINESE POSTMAN SOL: DM.2 CLASSWORK WORKSHEET HOMEWORK (DAY 59) WORKSHEET.
I can describe the differences between Hamilton and Euler circuits and find efficient Hamilton circuits in graphs. Hamilton Circuits I can compare and.
Chapter 14 Section 3 - Slide 1 Copyright © 2009 Pearson Education, Inc. AND.
Unit 2 Hamiltonian Circuits. Hamiltonian Circuit: A tour that starts at a vertex of a graph and visits each vertex once and only once, returning to where.
The Traveling Salesman Starring: Mr. Brute Force Co Starring: Mrs. Sorted Edge Lord Nearest Neighbor.
Spanning Trees Dijkstra (Unit 10) SOL: DM.2 Classwork worksheet Homework (day 70) Worksheet Quiz next block.
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.
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
Weighted Graphs and traveling Salesperson problem
Minimum Spanning Trees
Redraw these graphs so that none of the line intersect except at the vertices B C D E F G H.
Nuffield Free-Standing Mathematics Activity
HAMILTONIAN CIRCUIT ALGORITHMS
Chapter 2: Business Efficiency Lesson Plan
Chapter 2: Business Efficiency Lesson Plan
Section 14.3 Hamilton Paths, and Hamilton Circuits
Minimum Spanning Trees
The Travelling Salesperson problem
Introduction to Graph Theory Euler and Hamilton Paths and Circuits
D1 Discrete Mathematics
Nuffield Free-Standing Mathematics Activity
Decision Maths Dijkstra’s Algorithm.
Shortest Path.
Shortest Path.
Chapter 2: Business Efficiency Business Efficiency
Applied Combinatorics, 4th Ed. Alan Tucker
A path that uses every vertex of the graph exactly once.
Route Inspection Which of these can be drawn without taking your pencil off the paper and without going over the same line twice? If we introduce a vertex.
The travelling salesman problem
Networks Kruskal’s Algorithm
Nearest Neighbor Repetitive Nearest Neighbor (Unit 10) SOL: DM.2
Chapter 15 Graph Theory © 2008 Pearson Addison-Wesley.
Shortest Path.
Chapter 15 Graph Theory © 2008 Pearson Addison-Wesley.
Euler and Hamilton Paths
Classwork Worksheet Homework (day 67) worksheet
Spanning Trees Lecture 20 CS2110 – Spring 2015.
Traveling Salesman Problems Nearest Neighbor Method
Presentation transcript:

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 vertex and returning to the start Unlike the postman problem you do not have to go along every edge There is not a method for finding the shortest route but there are 2 methods which will home in on the answer

Nearest Neighbour Algorithm This is used to find an Upper Bound This is a value which represents the largest distance that needs to be covered. It may be possible to do the problem in a shorter distance but this algorithm gives a quick answer to a possible solution

Nearest Neighbour Algorithm 1. Start with any vertex 2. Look for the shortest edge that joins this vertex to a vertex not on the tree and add this to the tree. 3. Keep joining vertices to the last chosen vertex using the smallest edge available. Repeat until all the vertices are joined to the tree. 4. Join the last chosen vertex to the first chosen. Note DO NOT visit any vertex twice on the outward route

B A D C E G F If it is not possible to return to the start directly then it will be necessary to revisit certain vertices on the return route. Starting at A visit every vertex and return to A

B A D C E G F Choose vertex A 2. Choose vertex B as it is the Nearest Neighbour 3. Next choose vertex C, as it is the Nearest Neighbour 4. Repeat to get vertex D, then E, then F, then G 5. Return to A using the shortest route i.e 9

B A D C E G F Total distance = 24

B A D C E G F Starting at F 1. Choose vertex G as it is the Nearest Neighbour 2. Next choose vertex E, as it is the Nearest Neighbour 3. Repeat to get vertex D, then C, then B, then A 4. Return to F using the shortest route i.e Total distance = 28

B A D C E G F Since the first route gave a better answer this means that the answer is 24 or less 24 is called an Upper Bound The smaller the Upper Bound the better

B A D C E G F In fact for this problem the shortest route is 24 Applet