Graph Theory Hamilton Paths and Hamilton Circuits.

Slides:



Advertisements
Similar presentations
Aim: Graph Theory – Hamilton Paths & Circuits Course: Math Literacy Do Now: Aim: How does a Hamilton path and circuit differ from Euler’s path and circuit?
Advertisements

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 7 Graph Theory 7.1 Modeling with graphs and finding Euler circuits. Learning Objectives: Know how to use graphs as models and how to determine.
Chapter 15 Graph Theory © 2008 Pearson Addison-Wesley. All rights reserved.
1 Chapter 15.3 Hamilton Paths and Hamilton Circuits Objectives 1.Understand the definitions of Hamilton paths & Hamilton circuits. 2.Find the number of.
Chapter 4 sec. 2.  A famous and difficult problem to solve in graph theory.
1 Discrete Structures & Algorithms Graphs and Trees: II EECE 320.
Homework collection Read Pages 175 – 184 Page 188: 21 – 26, 29 – 36, 41 – 44, 47 – 49, 51, 52, 59, 62, 63.
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.
Graphs. Graph A “graph” is a collection of “nodes” that are connected to each other Graph Theory: This novel way of solving problems was invented by a.
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.
Chapter 2: Business Efficiency Lesson Plan Business Efficiency  Visiting Vertices-Graph Theory Problem Hamiltonian Circuits  Vacation Planning Problem.
Chapter 15 Graph Theory © 2008 Pearson Addison-Wesley. All rights reserved.
Slide 14-1 Copyright © 2005 Pearson Education, Inc. SEVENTH EDITION and EXPANDED SEVENTH EDITION.
Excursions in Modern Mathematics, 7e: Copyright © 2010 Pearson Education, Inc. 6 The Mathematics of Touring 6.1Hamilton Paths and Hamilton Circuits.
Slide Copyright © 2009 Pearson Education, Inc. AND Active Learning Lecture Slides For use with Classroom Response Systems Chapter 14 Graph Theory.
UNIT 3 THINKING MATHEMATICALLY BY BLITZER Hamilton Paths and Hamilton Circuits.
Ch. 15: Graph Theory Some practical uses Degree of separation- Hollywood, acquaintance, collaboration Travel between cities Konigsberg bridge Shortest.
Spring 2015 Mathematics in Management Science Network Problems Networks & Trees Minimum Networks Spanning Trees Minimum Spanning Trees.
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.
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.
© 2010 Pearson Prentice Hall. All rights reserved. 1 §15.3, Hamilton Paths and Circuits.
Spring 2015 Mathematics in Management Science Traveling Salesman Problem Approximate solutions for TSP NNA, RNN, SEA Greedy Heuristic Algorithms.
Chapter 2: Business Efficiency Lesson Plan
Copyright © 2014, 2010, 2007 Pearson Education, Inc. Section 4.2, Slide 1 4 Graph Theory (Networks) The Mathematics of Relationships 4.
Copyright 2013, 2010, 2007, Pearson, Education, Inc. Section 14.3 Hamilton Paths, and Hamilton Circuits.
Page 714 #1-10 ANSWERS Lesson Reflection for Chapter 14 Section 7.
6.4: The Brute-Force Algorithms
Chapter 14 Section 4 - Slide 1 Copyright © 2009 Pearson Education, Inc. AND.
EXCURSIONS IN MODERN MATHEMATICS SIXTH EDITION Peter Tannenbaum 1.
6.1 Hamilton Circuits and Hamilton Path
CIRCUITS, PATHS, AND SCHEDULES Euler and Königsberg.
Graph Theory Hamilton Paths Hamilton Circuits and.
AND.
Euler Paths and Circuits. The original problem A resident of Konigsberg wrote to Leonard Euler saying that a popular pastime for couples was to try.
By: Christophe Dufour Chrishon Adams Mischael Joseph.
Graphs Definition: a graph is an abstract representation of a set of objects where some pairs of the objects are connected by links. The interconnected.
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.
Copyright © 2008 Pearson Education, Inc. Slide 13-1 Unit 13B The Traveling Salesman Problem.
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.
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,
Mathematical modeling To describe or represent a real-world situation quantitatively, in mathematical language.
MAT 110 Workshop Created by Michael Brown, Haden McDonald & Myra Bentley for use by the Center for Academic Support.
Hamilton Paths and Hamilton Circuits
Excursions in Modern Mathematics Sixth Edition
Weighted Graphs and traveling Salesperson problem
Shortest Path Problems
Traveling Salesman Problems
Routing Through Networks - 1
HAMILTONIAN CIRCUIT ALGORITHMS
Chapter 2: Business Efficiency Lesson Plan
Chapter 2: Business Efficiency Lesson Plan
Section 14.3 Hamilton Paths, and Hamilton Circuits
Hamiltonian Circuit/Paths:
Graph Theory Unit 2.
Graph Theory.
4-4 Graph Theory Trees.
6.1 Hamilton Circuits and Hamilton Path
A path that uses every vertex of the graph exactly once.
Chapter 15 Graph Theory © 2008 Pearson Addison-Wesley.
Chapter 15 Graph Theory © 2008 Pearson Addison-Wesley.
Classwork Worksheet Homework (day 67) worksheet
Hamilton Paths and Hamilton Circuits
Section 13.4 Trees.
Traveling Salesman Problems Nearest Neighbor Method
Presentation transcript:

Graph Theory Hamilton Paths and Hamilton Circuits

WHAT YOU WILL LEARN Hamilton paths and Hamilton circuits Traveling salesman problem Brute force method Nearest neighbor method

Definitions A Hamilton path is a path that contains each vertex of a graph exactly once. A Hamilton circuit is a path that begins and ends at the same vertex and passes through all other vertices of the graph exactly one time.

Example: Hamilton Path Graph (a) shown has Hamilton path A, B, C, E, D. The graph also has Hamilton path C, B, A, D, E. Can you find some others? Graph (b) shown has Hamilton path A, B, C, F, H, E, G, D. The graph also has Hamilton path G, D, E, H, F, C, B, A. Can you find some others?

Example: Hamilton Circuit Graph (a) shown has Hamilton circuit A, B, D, G, E, H, F, C, A. Graph (b) shown has Hamilton circuit A, B, C, E, D, A. Can you find another?

Definition A complete graph is a graph that has an edge between each pair of its vertices.

Example: Finding Hamilton Circuits Determine a Hamilton circuit for the graph shown. One solution is A, G, F, E, C, D, B, A A B C E F G D

Number of Unique Hamilton Circuits in a Complete Graph The number of unique Hamilton circuits in a complete graph with n vertices is (n  1)!, where (n  1)! = (n  1)(n  2)(n  3)…(3)(2)(1)

Example: Number of Hamilton Circuits How many unique Hamilton circuits are there in a complete graph with the following number of vertices? a) 4b) 9 a) 4 = (4  1)! = 321 = 6 b) 9 = (9  1)! = = 40,320

The Brute Force Method of Solving Traveling Salesman Problems To determine the optimal solution: 1.Represent the problem with a complete, weighted graph. 2.List all possible Hamilton circuits for this graph. 3.Determine the cost (or distance) associated with each of these Hamilton circuits. 4.The Hamilton circuit with the lowest cost (or shortest distance) is the optimal solution.

Example: Brute Force Method Find a minimum Hamilton circuit for the complete, weighted graph shown. List all the Hamilton circuits. Since there are 4 vertices there are (4  1)! = 3! = 6 possible circuits. AB CD

Example: Brute Force Method continued A, D, C, B, A A, D, B, C, A A, C, D, B, A Fourth Leg A, C, B, D, A 22686A, B, D, C, A A, B, C, D, A TotalThird Leg Second Leg First Leg Circuit The minimum amount for the graph would be 22. AB CD

Nearest Neighbor Method of Determining an Approximate Solution to a Traveling Salesman Problem To approximate a optimal solution: 1. Represent the problem with a complete, weighted graph. 2.Identify the starting vertex. 3.Of all the edges attached to the starting vertex, choose the edge that has the smallest weight. This edge is generally either the shortest distance or the lowest cost. Travel along this edge to the second vertex.

Nearest Neighbor Method of Determining an Approximate Solution to a Traveling Salesman Problem (continued) 4.At the second vertex, choose the edge that has the smallest weight that does not lead to a vertex already visited. Travel along this edge to the third vertex. 5.Continue this process, each time moving along the edge with the smallest weight until all vertices are visited. 6.Travel back to the original vertex.

Example: Nearest Neighbor An appliance repair man must repair four appliances at the locations shown in the graph on the next slide. The estimated travel time (in minutes) is shown between the four locations. The repair man wants to visit the four locations in an order that takes the least amount of time. Use the nearest neighbor algorithm to find an approximate solution to the problem.

Example: Nearest Neighbor (continued) Choose a starting vertex. Let’s choose vertex A. Choose the edge that has the smallest weight. Either AD or AB, lets choose AD (8). At D choose the edge that has the smallest weight DE (4). E start here 2 nd vertex C B A D

Example: Nearest Neighbor (continued) Continue moving along the edge with the smallest weight. Circuit would be: A, D, E, B, C, A = 37 This route would take about 37 minutes. start here 2 nd vertex C B A E D

Example: Nearest Neighbor (continued) Other circuits and weights = 47E, B, D, C, A, EE = 34 D, E, B, A, C, D D = 34 C, D, E, B, A, C C = 34B, E, D, C, A, BB Total WeightCircuitStarting Vertex

In the following graph, determine a Hamilton path. a.HGEDABCFBE b.GEDABCFH c.HGEDABCF d.FBADEGH

In the following graph, determine a Hamilton path. a.HGEDABCFBE b.GEDABCFH c.HGEDABCF d.FBADEGH

Alicia lives in Washington, D.C. and wants to take a road trip to visit her friends from college who live in the following cities: New York, Boston, Philadelphia, Dover, and Baltimore. How many ways can Alicia visit each city and return home to Washington, D.C.? a.120b.60 c.25d.24

Alicia lives in Washington, D.C. and wants to take a road trip to visit her friends from college who live in the following cities: New York, Boston, Philadelphia, Dover, and Baltimore. How many ways can Alicia visit each city and return home to Washington, D.C.? a.120b.60 c.25d.24

Robert decides to take a walk to run his errands. He needs to walk to the drug store, the post office, and the dry cleaners. The distances between these four locations are as follows: home (H) to the drug store (D) is 0.6 miles, home to the post office (P) is 0.5 miles, home to the dry cleaners (C) is 0.7 miles, the drug store to the post office is 0.2 miles, the drug store to the dry cleaner is 0.5 miles, and the dry cleaner to the post office is 0.2 miles. H to D: 0.6H to P: 0.5H to C: 0.7 D to P: 0.2D to C: 0.5C to P: 0.2

Represent this traveling salesman problem with a complete, weighted graph. H to D: 0.6H to P: 0.5H to C: 0.7 D to P: 0.2D to C: 0.5C to P: 0.2 a. c. b. d

Represent this traveling salesman problem with a complete, weighted graph. H to D: 0.6H to P: 0.5H to C: 0.7 D to P: 0.2D to C: 0.5C to P: 0.2 a. c. b. d

Use the brute force method to determine the shortest route for Robert to visit each location once and return home. What is the distance when using this route? a.HDPCH; 1. 7 miles b.HPDCH; 1.7 miles c.HPCD; 1.2 miles d.HCDPH; 1.7 miles

Use the brute force method to determine the shortest route for Robert to visit each location once and return home. What is the distance when using this route? a.HDPCH; 1. 7 miles b.HPDCH; 1.7 miles c.HPCD; 1.2 miles d.HCDPH; 1.7 miles

Use the nearest neighbor method to approximate the optimal route for Robert to visit each location once and return home. What is the distance when using this route? a.HDPCH; 1. 7 miles b.HPDCH; 1.7 miles c.HPCD; 1.2 miles d.HCDPH; 1.7 miles

Use the nearest neighbor method to approximate the optimal route for Robert to visit each location once and return home. What is the distance when using this route? a.HDPCH; 1. 7 miles b.HPDCH; 1.7 miles c.HPCD; 1.2 miles d.HCDPH; 1.7 miles