The Traveling Salesman Problem Outline/learning Objectives The Traveling Salesman Problem

Similar documents
The Traveling Salesman Problem Outline/learning Objectives The Traveling Salesman Problem

The Traveling Salesman Problem

Chapter 6: The Mathematics of Touring

Chapter 14 Section 3 - Slide 1

1. The Highway Inspector s Problem

Warm -Up. 1. Draw a connected graph with 4 vertices and 7 edges. What is the sum of the degrees of all the vertices?

Finite Math A Chapter 6 Notes Hamilton Circuits

Hamilton Circuit. Topics in Contemporary Mathematics MA 103 Summer II, 2013

SEVENTH EDITION and EXPANDED SEVENTH EDITION

Note that there are questions printed on both sides of each page!

1. Read each problem carefully and follow the instructions.

Chapter 6. The Traveling-Salesman Problem. Section 1. Hamilton circuits and Hamilton paths.

Study Guide Mods: Date:

SHORT ANSWER. Write the word or phrase that best completes each statement or answers the question.

Chapter 8 Topics in Graph Theory

Euler and Hamilton paths. Jorge A. Cobb The University of Texas at Dallas

Topics Covered. Introduction to Graphs Euler s Theorem Hamiltonian Circuits The Traveling Salesman Problem Trees and Kruskal s Algorithm

Simple Graph. General Graph

The Traveling Salesman Problem Nearest-Neighbor Algorithm

1. trees does the network shown in figure (a) have? (b) How many different spanning. trees does the network shown in figure (b) have?

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

Graphs II: Trailblazing

Chapter 3: Paths and Cycles

Modules. 6 Hamilton Graphs (4-8 lectures) Introduction Necessary conditions and sufficient conditions Exercises...

Fundamentals of Graph Theory MATH Fundamentals of Graph Theory. Benjamin V.C. Collins, James A. Swenson MATH 2730

Discrete mathematics

14 Graph Theory. Exercise Set 14-1

Precept 4: Traveling Salesman Problem, Hierarchical Clustering. Qian Zhu 2/23/2011

MATH 103: Contemporary Mathematics Study Guide for Chapter 6: Hamilton Circuits and the TSP

Math 130 Final Exam Study Guide. 1. Voting

(Refer Slide Time: 01:00)

Section Hamilton Paths, and Hamilton Circuits. Copyright 2013, 2010, 2007, Pearson, Education, Inc.

P and NP CISC4080, Computer Algorithms CIS, Fordham Univ. Instructor: X. Zhang

Notes for Recitation 9

Euler and Hamilton circuits. Euler paths and circuits

EECS 203 Lecture 20. More Graphs

Topic 10 Part 2 [474 marks]

Section Hamilton Paths, and Hamilton Circuits. Copyright 2013, 2010, 2007, Pearson, Education, Inc.

Ma/CS 6a Class 8: Eulerian Cycles

P and NP CISC5835, Algorithms for Big Data CIS, Fordham Univ. Instructor: X. Zhang

Traveling Salesman Problem. Algorithms and Networks 2014/2015 Hans L. Bodlaender Johan M. M. van Rooij

Excursions in Modern Mathematics Sixth Edition. Chapter 5 Euler Circuits. The Circuit Comes to Town. Peter Tannenbaum

Graph Traversals. CSC 1300 Discrete Structures Villanova University. Villanova CSC Dr Papalaskari 1

Circuits and Paths. April 13, 2014

Math for Liberal Arts MAT 110: Chapter 13 Notes

Travelling Salesman Problem. Algorithms and Networks 2015/2016 Hans L. Bodlaender Johan M. M. van Rooij

Chapter 8. NP-complete problems

Module 6 NP-Complete Problems and Heuristics

The Traveling Salesman Problem Brute Force Method

IE 102 Spring Routing Through Networks - 1

A region is each individual area or separate piece of the plane that is divided up by the network.

GRAPHS, GRAPH MODELS, GRAPH TERMINOLOGY, AND SPECIAL TYPES OF GRAPHS

Graph Algorithms. Tours in Graphs. Graph Algorithms

MTH-129 Review for Test 4 Luczak

Introduction III. Graphs. Motivations I. Introduction IV

6.2 Initial Problem. Section 6.2 Network Problems. 6.2 Initial Problem, cont d. Weighted Graphs. Weighted Graphs, cont d. Weighted Graphs, cont d

Module 6 P, NP, NP-Complete Problems and Approximation Algorithms

11.2 Eulerian Trails

Graphs and Algorithms

Graph Theory. Connectivity, Coloring, Matching. Arjun Suresh 1. 1 GATE Overflow

Discrete Mathematics (2009 Spring) Graphs (Chapter 9, 5 hours)

MA 111 Review for Exam 3

Lecture 3. Brute Force

Number Theory and Graph Theory

Graph Theory. Chapter 4.

Chapter 5: The Mathematics of Getting Around. 5.4 Eulerizing and Semi to Eulerizing Graphs

Lecture 1: An Introduction to Graph Theory

CS 311 Discrete Math for Computer Science Dr. William C. Bulko. Graphs

Undirected Network Summary

Module 11. Directed Graphs. Contents

Unit 7 Day 6. Section 5.2 Traveling Salesman Problem & Section 5.3 Finding the Shortest Route

CSCE 350: Chin-Tser Huang. University of South Carolina

Basics of Graph Theory

Sec 2. Euler Circuits, cont.

v V Question: How many edges are there in a graph with 10 vertices each of degree 6?

Math 100 Homework 4 B A C E

MC 302 GRAPH THEORY 10/1/13 Solutions to HW #2 50 points + 6 XC points

An Introduction to Graph Theory

SCHOOL OF ENGINEERING & BUILT ENVIRONMENT. Mathematics. An Introduction to Graph Theory

Graphs. The ultimate data structure. graphs 1

Travel Every Edge 3. Example (Travel Every Edge 3) In the graphs above, can you find a circuit that hits every edge without repeating any edges?

CSC 8301 Design and Analysis of Algorithms: Exhaustive Search

Unit I: Euler's Formula (and applications).

Crossing bridges. Crossing bridges Great Ideas in Theoretical Computer Science. Lecture 12: Graphs I: The Basics. Königsberg (Prussia)

CAD Algorithms. Shortest Path

Major Themes. Graph Traversals. Euler s SoluWon to The Bridges of Königsberg. The Bridges of Königsberg Puzzle. Dr Papalaskari 1

6.2. Paths and Cycles

1. a graph G = (V (G), E(G)) consists of a set V (G) of vertices, and a set E(G) of edges (edges are pairs of elements of V (G))

Maximum Flows of Minimum Cost

CSC Design and Analysis of Algorithms. Lecture 4 Brute Force, Exhaustive Search, Graph Traversal Algorithms. Brute-Force Approach

Brute Force: Selection Sort

Network Topology and Graph

Theorem 2.9: nearest addition algorithm

Math 443/543 Graph Theory Notes 2: Transportation problems

The Travelling Salesman Problem

How can we lay cable at minimum cost to make every telephone reachable from every other? What is the fastest route between two given cities?

Junior Circle Meeting 3 Circuits and Paths. April 18, 2010

γ(ɛ) (a, b) (a, d) (d, a) (a, b) (c, d) (d, d) (e, e) (e, a) (e, e) (a) Draw a picture of G.

Combinatorial Optimization - Lecture 14 - TSP EPFL

Problem Set 6 (Due: Wednesday, December 6, 2006)

Transcription:

Chapter 6 Hamilton Joins the Circuit Outline/learning Objectives To identify and model Hamilton circuit and Hamilton path problems. To recognize complete graphs and state the number of Hamilton circuits that they have. To identify traveling-salesman problems and the difficulties faced in solving them. 2 3 Outline/learning Objectives 4 To implement brute-force, nearestneighbor, repeated nearest-neighbor, and cheapest-link algorithms to find approximate solutions to traveling salesman problems. To recognize the difference between efficient and inefficient algorithms. To recognize the difference between optimal and approximate algorithms. 5 6.1 Hamilton Circuits and Hamilton Paths Hamilton path A path that visits each vertex of the graph once and only once. Hamilton circuit A circuit that visits each vertex of the graph once and only once (at the end, of course, the circuit must return to the starting vertex). 6 7

8 Figure (a) shows a graph that has Euler circuits and has Hamilton circuits. One such Hamilton circuit is A, F, B, C, G, D, E, A. Note that once a graph has a Hamilton circuit, it automatically has a Hamilton path-- The Hamilton circuit can always be truncated into a Hamilton path by dropping the last vertex of the circuit. 9 10 Figure (b) shows a graph that has no Euler circuits but does have Euler paths (for example C, D, E, B, A, D), has no Hamilton circuits (sooner or later you have to go to C, and then you are stuck) but does have Hamilton paths (for example, A, B, E, D, C). Aha, a graph can have a Hamilton path but no Hamilton Circuit! 11 Figure (c) shows a graph that has neither Euler circuits nor paths (it has four odd vertices), has Hamilton circuits (for example A, B, C, D, E, A there are plenty more), and consequently has Hamilton paths (for example, A, B, C, D, E). 12 13

Figure (d) shows a graph that has Euler circuits (the vertices are all even), has no Hamilton circuits (no matter what, your are going to have to go through E more than once!) but has Hamilton paths (for example, A, B, E, D, C). 14 15 Figure (e) shows a graph that has no Euler circuits but has Euler paths (F and G are the two odd vertices), had neither Hamilton circuits nor Hamilton paths. 16 17 Figure (f) shows a graph that has neither Euler circuits nor Euler paths (too many odd vertices), has no Hamilton circuits, but does have Hamilton paths. The lesson in the previous Example is that the existence of an Euler path or circuit in a graph tells us nothing about the existence of a Hamilton path or circuit in that graph. This implies that Euler s theorems from Chapter 5 are useless when it comes to Hamilton circuits and paths. In fact, there are no Hamilton s theorems that we can use to determine whether a Hamilton circuit or path exists. 18 19

There are, however, nice theorems that identify special situations where a graph must have a Hamilton circuit. This best known of these theorems is Dirac s theorem: If a connected graph has N vertices (N > 2) and all of them have degree greater than or equal to N/2, then the graph has a Hamilton circuit. 6.2 Complete Graphs 20 21 If a graph has a Hamilton circuit, then how many different Hamilton circuits does it have? A graph with N vertices in which every pair of distinct vertices is joined by an edge is called a complete graph on N vertices and denoted by the symbol K N. Number of Edges in K N K N has N(N 1)/2 edges. Of all graphs with N vertices and no multiple edges or loops, K N has the most edges. 22 23 If we travel the four vertices of K 4 in an arbitrary order, we get a Hamilton path. For example, C, A, D, B is a Hamilton path. D, C, A, B is another Hamilton Path. 24 25

Each of these Hamilton paths can be closed into a Hamilton circuit-- the path C, A, D, B begets the circuit D, A, D, B, C. The path D, C, A, B begets the circuit D, C, A, B, D. 26 27 It is important to remember that the same Hamilton circuit can be written in many ways. For example, C, A, D, B, C is the same circuit as A, D, B, C, A the only difference is that in the first case we used C as the reference point in the second case we used A. 28 29 Number of Hamilton Circuits in K N There are (N 1)! Distinct Hamilton circuits in K N. 6.3 Traveling Salesman Problems 30 31

The traveling salesman is a convenient metaphor for many different important real-life applications, all involving Hamilton circuits in complete graphs but only occasionally involving salespeople. Any graph whose edges have numbers attached to them is called a weighted graph, and the numbers are called the weights of the edges. The graph is called a complete weighted graph. 32 33 The problem we want to solve is fundamentally the same find an optimal Hamilton circuit (a Hamilton circuit with least total weight) for the given weighted graph. 6.4 Simple Strategies for Solving TSPs 34 35 36 Strategy 1 (Exhaustive Search) Make a list of all possible Hamilton circuits. For each circuit in the list, calculate the total weight of the circuit. From all the circuits, choose the circuit with smallest total weight. 37 Strategy 2 (Go Cheap) Strategy 2 (Go Cheap) Start from the home city. From there go to the city that is the cheapest to get to. From each new city go to the next city that is cheapest to get to. When there are no more new cities to go to, go back home.