TSP – Upper Bounds and Lower Bounds Initial problem : Upper Bound A salesman based in Stockton needs to visit shops based in Darlington, Billingham, Middlesbrough,

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

Networks Prim’s Algorithm
Chen, Lu Mentor: Zhou, Jian Shanghai University, School of Management Chen213.shu.edu.cn.
Discrete Maths Chapter 3: Minimum Connector Problems Lesson 1: Prim’s and Kruskal.
Graphs: MSTs and Shortest Paths David Kauchak cs161 Summer 2009.
Chapter 15 Graph Theory © 2008 Pearson Addison-Wesley. All rights reserved.
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.
The Minimum Connector Problem: Finding the shortest way to link all the vertices in a graph. Method: Find a minimum spanning tree An example would be joining.
Aims: To know the terms: tree, spanning tree, minimum spanning tree. To understand that a minimum spanning tree connects a network using the lowest possible.
Excursions in Modern Mathematics(Tannenbaum) and Thinking Mathematically (Blitzer)
1 Discrete Structures & Algorithms Graphs and Trees: II EECE 320.
Graph Algorithms: Minimum Spanning Tree We are given a weighted, undirected graph G = (V, E), with weight function w:
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.
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
Problem Solving with Networks 18/08/2012 Jamie Sneddon
Graph Theory Hamilton Paths and Hamilton Circuits.
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.
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.
Minimum spanning trees Aims: To know the terms: tree, spanning tree, minimum spanning tree. To understand that a minimum spanning tree connects a network.
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)
Minimum- Spanning Trees
Prims Algorithm for finding a minimum spanning tree
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.
Spanning Trees Dijkstra (Unit 10) SOL: DM.2 Classwork worksheet Homework (day 70) Worksheet Quiz next block.
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.
Mathematical modeling To describe or represent a real-world situation quantitatively, in mathematical language.
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.
MAT 110 Workshop Created by Michael Brown, Haden McDonald & Myra Bentley for use by the Center for Academic Support.
Hamilton Paths and Hamilton Circuits
D1 Discrete Mathematics
Redraw these graphs so that none of the line intersect except at the vertices B C D E F G H.
Shortest Paths and Minimum Spanning Trees
Minimum Spanning Tree Chapter 13.6.
Chapter 2: Business Efficiency Lesson Plan
Graph Algorithm.
Minimum-Cost Spanning Tree
Spanning Trees.
Minimum Spanning Tree.
The Travelling Salesperson problem
D1 Discrete Mathematics
Decision Maths Dijkstra’s Algorithm.
Shortest Path.
Shortest Path.
Kruskal’s Algorithm for finding a minimum spanning tree
Minimum spanning trees
Shortest Paths and Minimum Spanning Trees
Minimum spanning trees
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.
Minimum spanning trees
The travelling salesman problem
Networks Kruskal’s Algorithm
Chapter 15 Graph Theory © 2008 Pearson Addison-Wesley.
Shortest Path.
Chapter 15 Graph Theory © 2008 Pearson Addison-Wesley.
Networks Prim’s Algorithm
The travelling salesman problem
Spanning Trees Lecture 20 CS2110 – Spring 2015.
Minimum-Cost Spanning Tree
Jan 2009.
Presentation transcript:

TSP – Upper Bounds and Lower Bounds Initial problem : Upper Bound A salesman based in Stockton needs to visit shops based in Darlington, Billingham, Middlesbrough, Hartlepool and Yarm and return to Stockton. What is the minimum distance he needs to travel?

TSP – Upper Bounds and Lower Bounds The model The distances between the towns is given below: SMDHYB S M D H Y B D M S B Y H

TSP – Upper Bounds and Lower Bounds Nearest neighbour algorithm 1. Choose any vertex as the starting point. 2. From the vertices not already selected find the nearest vertex to the last one. 3. Repeat step 2 until all vertices have been selected. 4. Join the last vertex to the first vertex. 5. Repeat for different starting vertices. 6. Choose the smallest upper bound.

TSP – Upper Bounds and Lower Bounds 1. Choose a starting vertex D M S B Y H S is chosen as a starting vertex. S

TSP – Upper Bounds and Lower Bounds 2. Find the nearest vertex D M S B Y H B is the nearest vertex to S (the last one). S B 4

TSP – Upper Bounds and Lower Bounds 3. Repeat 2 ‘til all vertices selected D M S B Y H M is the nearest vertex to B. S B 4 M 6 Y is the nearest vertex to M (not already selected). Y 9 D is the nearest vertex to Y (not already selected). D 13 H is the nearest vertex to D (not already selected). H 25

TSP – Upper Bounds and Lower Bounds 4. Join the last vertex to the first D M S B Y H H is joined to S. S B 4 M 6 Y 9 D 13 H The resulting tour has length: = 69

TSP – Upper Bounds and Lower Bounds 5. Repeat for a different start vertex Upper bound found starting at S: Upper bound found starting at D: Upper bound found starting at B: Upper bound found starting at H: Upper bound found starting at M: Upper bound found starting at Y: 69 64* 64 *Choosing DY as first edge

TSP – Upper Bounds and Lower Bounds 6. Choose the least upper bound The shortest tour (least upper bound) has length 64. D M S B Y H S B 4 M 6 Y 6 D 13 H D-Y-S-B-M-H-D has been chosen, but we could have had B-S-M-Y-D-H-B

TSP – Upper Bounds and Lower Bounds Initial problem: Lower Bound A salesman based in Stockton needs to visit shops based in Darlington, Billingham, Middlesbrough, Hartlepool and Yarm and return to Stockton. What is the minimum distance he needs to travel?

TSP – Upper Bounds and Lower Bounds The model The distances between the towns is given below: SMDHYB S M D H Y B D M S B Y H

TSP – Upper Bounds and Lower Bounds An algorithm – Nearest Neighbour 1. Choose a vertex and delete it and all its edges from the network. 2. Find a minimum connector for the remaining network using Kruskal’s or Prim’s. 3. Add in the weights of the two least weight deleted edges. 4. Repeat deleting a different vertex. 5. Choose the greatest lower bound.

TSP – Upper Bounds and Lower Bounds 1. Choose a vertex and delete it S B Y H D M D is chosen (arbitrarily) and deleted along with all of the edges from D.

TSP – Upper Bounds and Lower Bounds 2. Find a minimum connector S B Y H D M A minimum connector is found (in this case using Kruskal’s algorithm)

TSP – Upper Bounds and Lower Bounds 3. Add in 2 least deleted edges S B Y H D M The two deleted edges of least weight are added back in The Lower Bound found by deleting D has weight : = 49

TSP – Upper Bounds and Lower Bounds 4. Repeat using a different vertex Lower bound found by removing D: Lower bound found by removing S: Lower bound found by removing B: Lower bound found by removing H: Lower bound found by removing M: Lower bound found by removing Y:

TSP – Upper Bounds and Lower Bounds 5. Choose greatest lower bound The greatest lower bound found is 49 S B Y H D M

TSP – Upper Bounds and Lower Bounds Interpreting the Upper and Lower Bound Values The greatest lower bound found is 49 The shortest tour (least upper bound) has length 64. So the actual route lies between 49 and 64. It is definitely possible to do it in 64 but a shorter route may be possible. This can only be found by trial and error If the UB and the LB are the same then that is the answer The smaller the gap the better