Traveling Salesman Problems Repetitive Nearest-Neighbor and Cheapest-Link Algorithms Chapter: 6.

Slides:



Advertisements
Similar presentations
AES Sub-Key Generation By Muhammad Naseem. Rotate Word 09CF4F3C.
Advertisements

Minimum Spanning Trees (MSTs) Prim's Algorithm For each vertex not in the tree, keep track of the lowest cost edge that would connect it to the tree This.
Minimum Spanning Tree Sarah Brubaker Tuesday 4/22/8.
6.8 The Cheapest-Link Algorithm. The Cheapest-Link Algorithm Pick the edge with the smallest weight and mark it Pick the next edge with the smallest weight.
Chapter 15 Graph Theory © 2008 Pearson Addison-Wesley. All rights reserved.
Excursions in Modern Mathematics(Tannenbaum) and Thinking Mathematically (Blitzer)
§ 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.
Traveling-Salesman Problems
CPSC-608 Database Systems Fall 2011 Instructor: Jianer Chen Office: HRBB 315C Phone: Notes #8.
Chapter 9: Graphs Basic Concepts
Chapter 15 Graph Theory © 2008 Pearson Addison-Wesley. All rights reserved.
Excursions in Modern Mathematics, 7e: Copyright © 2010 Pearson Education, Inc. 7 The Mathematics of Networks 7.1Trees 7.2Spanning Trees 7.3 Kruskal’s.
Slide 14-1 Copyright © 2005 Pearson Education, Inc. SEVENTH EDITION and EXPANDED SEVENTH EDITION.
Graph Partitioning Problem Kernighan and Lin Algorithm
Excursions in Modern Mathematics, 7e: Copyright © 2010 Pearson Education, Inc. 6 The Mathematics of Touring 6.1Hamilton Paths and Hamilton Circuits.
Graph Theory Hamilton Paths and Hamilton Circuits.
Chapter 4 sections 1 and 2.  Fig. 1  Not connected  All vertices are even.  Fig. 2  Connected  All vertices are even.
The Traveling-Salesman Problem. Born August 4, 1805 in Dublin, Ireland Died September 2, 1865 in Dublin, Ireland Made many contributions to the Physics.
1 Excursions in Modern Mathematics Sixth Edition Peter Tannenbaum.
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.
Spring 2015 Mathematics in Management Science Traveling Salesman Problem Approximate solutions for TSP NNA, RNN, SEA Greedy Heuristic Algorithms.
Overview of Probability Theory In statistical theory, an experiment is any operation that can be replicated infinitely often and gives rise to a set of.
Excursions in Modern Mathematics, 7e: Copyright © 2010 Pearson Education, Inc. 6 The Mathematics of Touring 6.1Hamilton Paths and Hamilton Circuits.
Find Probabilities Using Combinations
Computing the chromatic number for block intersection graphs of Latin squares Ed Sykes CS 721 project McMaster University, December 2004 Slide 1.
Phrase-structure grammar A phrase-structure grammar is a quadruple G = (V, T, P, S) where V is a finite set of symbols called nonterminals, T is a set.
6.4: The Brute-Force Algorithms
EXCURSIONS IN MODERN MATHEMATICS SIXTH EDITION Peter Tannenbaum 1.
AES Encryption FIPS 197, November 26, Bit Block Encryption Key Lengths 128, 192, 256 Number of Rounds Key Length Rounds Block.
A horse race has the following horses running. How many different first, second and third place results are possible: Mushroom Pepper Sausage Tomato Onion.
Representing Relations Using Matrices A relation between finite sets can be represented using a zero-one matrix Suppose R is a relation from A = {a 1,
A Valentines Day Problem Source The teachers lab Patterns in Mathematics
Geometry: Plane Figures Chapter. point A point marks a location. A A B B line segment the part of the line between 2 points endpoints.
I can describe the differences between Hamilton and Euler circuits and find efficient Hamilton circuits in graphs. Hamilton Circuits I can compare and.
Excursions in Modern Mathematics, 7e: Copyright © 2010 Pearson Education, Inc. 6 The Mathematics of Touring 6.1Hamilton Paths and Hamilton Circuits.
Chapter 14 Section 3 - Slide 1 Copyright © 2009 Pearson Education, Inc. AND.
Turn in HW and Classwork sheet from last class. You have 10 minutes to complete the warm- up. After the warm-up, we will finish our notes on algorithms.
Graphs and Matrices Spring 2012 Mills College Dan Ryan Lecture Slides by Dan Ryan is licensed under a Creative Commons Attribution-NonCommercial-ShareAlike.
Shortest Path -Prim’s -Djikstra’s. PRIM’s - Minimum Spanning Tree -A spanning tree of a graph is a tree that has all the vertices of the graph connected.
Excursions in Modern Mathematics Sixth Edition
6.4: The Brute-Force Algorithms
Weighted Graphs and traveling Salesperson problem
The Polar Environmental Centre
HAMILTONIAN CIRCUIT ALGORITHMS
Aim: Full House Grid: 9 Grid Play: Calculate answer & cross it off
Chapter 2: Business Efficiency Lesson Plan
Combinations COURSE 3 LESSON 11-3
Chapter 2: Business Efficiency Lesson Plan
Make an Organized List and Simulate a Problem
Single Source Shortest Paths Bellman-Ford Algorithm
Chapter 9: Graphs Basic Concepts
Shortest path algorithm
Splash Screen.
AB AC AD AE AF 5 ways If you used AB, then, there would be 4 remaining ODD vertices (C, D, E and F) CD CE CF 3 ways If you used CD, then, there.
Splash Screen.
Cheapest-Link Algorithm/Sorted Edges (Unit 10) SOL: DM.2
Nearest Neighbor Repetitive Nearest Neighbor (Unit 10) SOL: DM.2
A Series of Slides in 5 Parts Movement 2. BFS
Chapter 15 Graph Theory © 2008 Pearson Addison-Wesley.
Chapter 15 Graph Theory © 2008 Pearson Addison-Wesley.
Classwork Worksheet Homework (day 67) worksheet
Splash Screen.
Kruskal’s Algorithm AQR.
If AD = 10, DC =6, and ED = 15, find DB.
A Series of Slides in 5 Parts Movement 4. Best-First
A Series of Slides in 5 Parts Movement 4. Best-First
A Series of Slides in 5 Parts Movement 1. DFS
A Series of Slides in 5 Parts Movement 3. IDFS
Jan 2009.
Presentation transcript:

Traveling Salesman Problems Repetitive Nearest-Neighbor and Cheapest-Link Algorithms Chapter: 6

Repetitive Nearest-Neighbor Algorithm Let A be any vertex. Apply the nearest-neighbor algorithm using A as the starting vertex and calculate the total cost associated with the circuit. Repeat the process using each of the other vertices (B,C, D, E) of the graph as the staring vertex. Keep the best one from all the Hamilton circuits. If there is a designated starting vertex, rewrite this circuit with that vertex as the reference point.

Repetitive Nearest-Neighbor Algorithm $133 $185 $121 $174 $199 $200 $120 $152 $150 $119 A B C D E Step 1: Let A be any vertex. Apply nearest-neighbor Algo. Calculate the cost of circuit At point A: EdgeWeight AE$133 AD$152 AC$119 Min AB$185

Repetitive Nearest-Neighbor Algorithm $133 $185 $121 $174 $199 $200 $120 $152 $150 $119 A B C D E Step 1: Let A be any vertex. Apply nearest-neighbor Algo. Calculate the cost of circuit At point C: EdgeWeight CB$121 CA$119 Already visited CE$120 Min CD$174

Repetitive Nearest-Neighbor Algorithm $133 $185 $121 $174 $199 $200 $120 $152 $150 $119 A B C D E Step 1: Let A be any vertex. Apply nearest-neighbor Algo. Calculate the cost of circuit At point E: EdgeWeight EA$133 Cannot revisit A as all vertices are visited yet EB$200 EC$120 Already visited ED$199 Min

Repetitive Nearest-Neighbor Algorithm $133 $185 $121 $174 $199 $200 $120 $152 $150 $119 A B C D E Step 1: Let A be any vertex. Apply nearest-neighbor Algo. Calculate the cost of circuit At point D: EdgeWeight DE$199 DA$152 DB$150 Min DC$174

Repetitive Nearest-Neighbor Algorithm $133 $185 $121 $174 $199 $200 $120 $152 $150 $119 A B C D E Step 1: Let A be any vertex. Apply nearest-neighbor Algo. Calculate the cost of circuit At point B: From the last vertex (B), return to the starting point (A). All vertices have been visited Selected edge: BA

Repetitive Nearest-Neighbor Algorithm $133 $185 $121 $174 $199 $200 $120 $152 $150 $119 A B C D E Step 1: Let A be any vertex. Apply nearest-neighbor Algo. Calculate the cost of circuit Using the Nearest-Neighbor algorithm with A as the starting vertex, we got: Hamilton circuit: A, C, E, D, B, A Cost associated with the Hamilton circuit: $119+$120+$199+ $150+$185 = $773

Repetitive Nearest-Neighbor Algorithm Starting pointHamilton CircuitCost BB, C, A, E, D, B$722 CC, A, E, D, B, C$722 DD, B, C, A, E, D$722 EE, C, A, D, B, E$741 $133 $185 $121 $174 $199 $200 $120 $152 $150 $119 A B C D E Step 2: Repeat the process using each of the other vertices (B,C, D, E) of the graph as the staring vertex.

Repetitive Nearest-Neighbor Algorithm Starting pointHamilton CircuitCost AA, C, E, D, B, A$773 BB, C, A, E, D, B$722 CC, A, E, D, B, C$722 DD, B, C, A, E, D$722 EE, C, A, D, B, E$741 $133 $185 $121 $174 $199 $200 $120 $152 $150 $119 A B C D E Step 3: Keep the best one from all the Hamilton circuits. If there is a designated starting vertex, rewrite this circuit with that vertex as the reference point.

Repetitive Nearest-Neighbor Algorithm The Best one from all Hamilton circuits: B, C, A, E, D, B C, A, E, D, B, C D, B, C, A, E, D B, C, A, E, D, B  Rewrite with A as the starting vertex A, E, D, B, C, A B, C, A, E, D, B  Rewrite with C as the starting vertex C, A, E, D, B, C B, C, A, E, D, B  Rewrite with E as the starting vertex E, D, B, C, A, E $133 $185 $121 $174 $199 $200 $120 $152 $150 $119 A B C D E Step 3: Keep the best one from all the Hamilton circuits. If there is a designated starting vertex, rewrite this circuit with that vertex as the reference point. Tie: Select randomly

Cheapest-Link Algorithm $133 $185 $121 $174 $199 $200 $120 $152 $150 $119 A B C D E Pick the edge with the smallest weight first. Mark the edge (say in red). Pick the next “cheapest” edge and mark the edge in red. Continue picking the “cheapest” edge available and mark the edge in red except when –It closes a circuit –It results in three edges coming out of a single vertex When there are no more vertices to join, close the red circuit.

Cheapest-Link Algorithm $133 $185 $121 $174 $199 $200 $120 $152 $150 $119 A B C D E Step 1: Pick the edge with the smallest weight first. Mark the edge (say in red).  Edge AC (Weight: $119)

Cheapest-Link Algorithm $133 $185 $121 $174 $199 $200 $120 $152 $150 $119 A B C D E Step 2: Pick the next “cheapest” edge. Mark the edge (say in red).  Edge EC (Weight: $120)

Cheapest-Link Algorithm $133 $185 $121 $174 $199 $200 $120 $152 $150 $119 A B C D E Step 3: Continue picking the next “cheapest” edge. Mark the edge (say in red) except when it results in 3 edges coming out of a single vertex.  Edge BC Weight ($121)

Cheapest-Link Algorithm $133 $185 $121 $174 $199 $200 $120 $152 $150 $119 A B C D E Step 3: Continue picking the next “cheapest” edge. Mark the edge (say in red) except when it closes a circuit.  Edge AE Weight ($133)

Cheapest-Link Algorithm $185 $174 $199 $200 $120 $152 $150 $119 A B C D E Step 3: Continue picking the next “cheapest” edge. Mark the edge (say in red).  Edge BD Weight ($150)

Cheapest-Link Algorithm $185 $174 $199 $200 $120 $152 $150 $119 A B C D E Step 3: Continue picking the next “cheapest” edge. Mark the edge (say in red).  Edge AD Weight ($152)

Cheapest-Link Algorithm $185 $174 $199 $200 $120 $152 $150 $119 A B C D E Step 4: When there are no more vertices to join, close the red circuit  Edge EB Weight ($200)

Summary of Cheapest-Link Algorithm $185 $174 $199 $200 $120 $152 $150 $119 A B C D E StepCheapest edgeWeightUsed in circuit? 1AC$119Yes 2EC$120Yes 3BC$121No, step 3(b) 4EA$133No, step 3(a) 5DB$150Yes 6AD$152Yes 7EB$200Yes, close the ckt.