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

Similar documents
The Traveling Salesman Problem (TSP) is where a least cost Hamiltonian circuit is found. CHAPTER 1 URBAN SERVICES

Chapter 14 Section 3 - Slide 1

Math for Liberal Arts MAT 110: Chapter 13 Notes

Study Guide Mods: Date:

Mathematical Thinking

Midterm 1 : Correction. Friday, Feb. 23.

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

The Travelling Salesman Problem

Practice Exam #3, Math 100, Professor Wilson. MULTIPLE CHOICE. Choose the one alternative that best completes the statement or answers the question.

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

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

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

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

SEVENTH EDITION and EXPANDED SEVENTH EDITION

Math 167 Review 1 (c) Janice Epstein

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

Undirected Network Summary

PATH FINDING AND GRAPH TRAVERSAL

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

7 Next choice is 4, not 3...

1. Read each problem carefully and follow the instructions.

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

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

CAD Algorithms. Categorizing Algorithms

1. The Highway Inspector s Problem

The Traveling Salesman 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?

The Traveling Salesman Problem Nearest-Neighbor Algorithm

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

MEI Further Mathematics Support Programme

Topic 10 Part 2 [474 marks]

CAD Algorithms. Shortest Path

Simple Graph. General Graph

Finite Math A Chapter 6 Notes Hamilton Circuits


IE 102 Spring Routing Through Networks - 1

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

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

Maximum Flows of Minimum Cost

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

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

Lesson 5.2. The Traveling Salesperson Problem. Explore This

Optimal tour along pubs in the UK

Coping with the Limitations of Algorithm Power Exact Solution Strategies Backtracking Backtracking : A Scenario

2 Approximation Algorithms for Metric TSP

Worksheet for the Final Exam - Part I. Graphs

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

Questions? You are given the complete graph of Facebook. What questions would you ask? (What questions could we hope to answer?)

Info 2950, Lecture 16

Chapter 9 Graph Algorithms

11/22/2016. Chapter 9 Graph Algorithms. Introduction. Definitions. Definitions. Definitions. Definitions

Spanning Tree. Lecture19: Graph III. Minimum Spanning Tree (MSP)

Module 6 NP-Complete Problems and Heuristics

(Refer Slide Time: 01:00)

MTH-129 Review for Test 4 Luczak

Module 2: NETWORKS AND DECISION MATHEMATICS

Math 3012 Combinatorial Optimization Worksheet

Module 6 NP-Complete Problems and Heuristics

Further Mathematics 2016 Module 2: NETWORKS AND DECISION MATHEMATICS Chapter 9 Undirected Graphs and Networks

Chapter 9 Graph Algorithms

Module 6 NP-Complete Problems and Heuristics

Chapter 9 Graph Algorithms

Chapter 5: Euler Paths and Circuits The Mathematics of Getting Around

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

Question Points Score TOTAL 55 TOTAL (Calibrated) 50

Amanur Rahman Saiyed (Indiana State University) THE TRAVELING SALESMAN PROBLEM November 22, / 21

CSE 100: B+ TREE, 2-3 TREE, NP- COMPLETNESS

Chapter 5: Euler Paths and Circuits The Mathematics of Getting Around

Technische Universität München, Zentrum Mathematik Lehrstuhl für Angewandte Geometrie und Diskrete Mathematik. Combinatorial Optimization (MA 4502)

Department of Computer Applications. MCA 312: Design and Analysis of Algorithms. [Part I : Medium Answer Type Questions] UNIT I

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

56:272 Integer Programming & Network Flows Final Exam -- December 16, 1997

EECS 203 Lecture 20. More Graphs

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

56:272 Integer Programming & Network Flows Final Examination -- December 14, 1998

CS6402 DESIGN AND ANALYSIS OF ALGORITHMS QUESTION BANK UNIT I

Algorithms and Data Structures (INF1) Lecture 15/15 Hua Lu

We have already seen the transportation problem and the assignment problem. Let us take the transportation problem, first.

a) Graph 2 and Graph 3 b) Graph 2 and Graph 4 c) Graph 1 and Graph 4 d) Graph 1 and Graph 3 e) Graph 3 and Graph 4 f) None of the above

Graph Theory(Due with the Final Exam)

Discussion. What problems stretch the limits of computation? Compare 4 Algorithms. What is Brilliance? 11/11/11

Design and Analysis of Algorithms

Effective Tour Searching for Large TSP Instances. Gerold Jäger

MULTIPLE CHOICE. Choose the one alternative that best completes the statement or answers the question.

More NP-complete Problems. CS255 Chris Pollett May 3, 2006.

Math 101 Final Exam Study Notes:

MULTIPLE CHOICE. Choose the one alternative that best completes the statement or answers the question.

Algorithm Design Techniques. Hwansoo Han

SPANNING TREES. Lecture 21 CS2110 Spring 2016

1. Sorting (assuming sorting into ascending order) a) BUBBLE SORT

Discrete mathematics

Outline. Graphs. Divide and Conquer.

Honors ICM- Graph Theory Unit 7 Homework Packet Homework Day 1

AQR UNIT 7. Circuits, Paths, and Graph Structures. Packet #

Lecture 10 Graph Algorithms

Graphs Definitions. Gunnar Gotshalks. GraphDefinitions 1

Real-World Applications of Graph Theory

CSE 21: Mathematics for Algorithms and Systems Analysis

The Traveling Salesman Problem Brute Force Method

14 Graph Theory. Exercise Set 14-1

Transcription:

Math 167 Review of Chapter 2 1 (c) Janice Epstein CHAPTER 2 BUSINESS EFFICENCY A path that visits every vertex exactly once is a Hamiltonian path. A circuit that visits every vertex exactly once is a Hamiltonian circuit. D B D B A A C C E E EBCAD ADBACBEA ACBFGDEA Use the method of trees to find all Hamiltonian circuits in the graph below starting at vertex E. A B E D C

Math 167 Review of Chapter 2 2 (c) Janice Epstein The Traveling Salesman Problem (TSP) is where a least cost Hamiltonian circuit is found. The graph below shows the time in minutes to travel between the vertices R, S, T, and U. Find the least cost Hamiltonian circuit for this graph starting at vertex T. 10 R 22 7 S 9 12 T 5 U A complete graph is a graph in which every pair of vertices is connected by exactly one edge. How are the number of vertices and the number of edges related in a complete graph?

Math 167 Review of Chapter 2 3 (c) Janice Epstein Brute Force Method: There are n! routes that visit every vertex once in a complete graph. There are n!/2 unique Hamiltonian circuits in a complete graph. If a starting point is specified, there are n 1!2 unique Hamiltonian circuits in a complete graph. Remember that n n n n! 1 2 3 2 1 Consider a complete graph with 14 vertices. a) How many edges does the graph have? b) If you can start at any vertex, how many different routes are there if every vertex is visited exactly once? c) If you can start at any vertex, how many different Hamiltonian circuits are there? d) If you start at a given vertex how many different Hamiltonian circuits are there? A heuristic algorithms is an algorithm that is fast but may not be optimal. A greedy algorithm is one in which the choices are made by what is best at the next step.

Math 167 Review of Chapter 2 4 (c) Janice Epstein Nearest Neighbor Algorithm: Starting from the home city, visit the nearest city first. Then visit the nearest city that has not already been visited. Return to the home city when no other choices remain. The graph below shows the time in minutes to travel between the vertices R, S, T, and U. Find the least cost Hamiltonian circuit for this graph using the nearest neighbor algorithm starting at R. Is the result different if you start at S? 10 R 22 7 S 9 12 T 5 U

Math 167 Review of Chapter 2 5 (c) Janice Epstein Use the nearest neighbor algorithm to find the shortest Hamiltonian circuit for the graph below starting at B. The values on the edges are the distance in km between the vertices. D 14 29 B 16 25 10 F 15 20 11 39 C 26 A The chart below shows the distance between vertices in miles. Find the shortest Hamiltonian circuit using the nearest neighbor algorithm starting at vertex C A B C D E F A 0 26 49 50 7 34 B 26 0 48 24 28 36 C 49 48 0 18 40 15 D 50 24 18 0 13 17 E 7 28 40 13 0 20 F 34 36 15 17 20 0

Math 167 Review of Chapter 2 6 (c) Janice Epstein Sorted Edges Algorithm: 1. Arrange edges of the complete graph in order of increasing cost 2. Select the lowest cost edge that has not already been selected that a. Does not cause a vertex to have 3 edges b. Does not close the circuit unless all vertices have been included. Find the shortest Hamiltonian circuit using the sorted edges algorithm for the graphs below. 10 R 22 7 S 9 12 T 5 U D 14 29 B 16 25 10 F 15 20 11 39 C 26 A

Math 167 Review of Chapter 2 7 (c) Janice Epstein A connected graph that has no circuits is a tree. A spanning tree is a tree that has all the vertices of the original graph. To create a spanning tree from a graph, 1. Find a circuit and remove one edge 2. Continue until there are no circuits Create 3 different spanning trees from the graph below: A minimal spanning tree is a spanning tree with the smallest possible weight. Kruskal s Algorithm: Add edges in order of increasing cost so that no circuit is formed. Use Kruskal s algorithm to find the minimal spanning tree for the graph below. What is the cost? 13 5 7 2 3 4 1 15 8 12 16 9

Math 167 Review of Chapter 2 8 (c) Janice Epstein A list of vertices connected by arrows is a directed graph or digraph. If the tasks cannot be completed in a random order, then the order can be specified in an order-requirement digraph. If the time to complete a task is shown on the digraph, it is a weighted digraph. An independent task is one that can be done independently of any of the other tasks. Pizza Dinner To make a pizza, you need to pre-heat the oven, unwrap the frozen pizza, and bake it for 15 minutes. You also need to find plates. Show these tasks in a weighted order requirement digraph. Are any of the tasks independent? How long to make the pizza if one person is available (no multi-tasking)? How long to make the pizza if two people are available?

Math 167 Review of Chapter 2 9 (c) Janice Epstein Yard Work Arrange the tasks below in a weighted order requirement digraph. T 1 : Trim edges (40 minutes) T 2 : Mow (60 minutes) T 3 : Weed flower beds (50 minutes) T 4 : Plant flowers (20 minutes) T 5 : Mulch flowers (10 minutes) T 6 : Refill bird feeder (5 minutes) T 7 : Sweep (15 minutes)

Math 167 Review of Chapter 2 10 (c) Janice Epstein A critical path on the diagraph is the path that determines the earliest completion time. What is the critical path for making the pizza? What is the critical path for yard work? What is the critical path in the digraph below?

Math 167 Review of Chapter 2 11 (c) Janice Epstein SAMPLE EXAM QUESTIONS FROM CHAPTER 2 How many different spanning trees does the graph on the right have? (A) 2 (B) 3 (C) 4 (D) 5 (E) More than 5 Suppose that after a storm an inspection needs to be made of the sewers along the streets in a small village to make sure local flooding is not due to clogging. The technique most likely to be useful in solving this problem is: (A) finding an Euler circuit on a graph. (B) applying the nearest-neighbor algorithm for finding a Hamiltonian circuit. (C) applying Kruskal's algorithm for finding a minimum-cost spanning tree for a graph. (D) applying the method of trees for the traveling salesman problem. (E) None of these/need more information Which of the following statements are true about a spanning tree? Mark all true answers (A) A spanning tree must contain all the edges of the original graph. (B) A spanning tree must contain all of the vertices of the original graph. (C) A spanning tree must contain a circuit (D) A spanning tree must not contain a circuit (E) None of these/need more information

Math 167 Review of Chapter 2 12 (c) Janice Epstein Which, if any, of the statements below are true about a heuristic algorithm? Mark all true answers. (A) An optimal result will be found (B) An optimal result may be found (C) An optimal result will not be found (D) The brute force method is an example of a heuristic algorithm. (E) The sorted edges method is an example of a heuristic algorithm. The graph below shows the distance between houses in a rural neighborhood in yards. Use the nearest neighbor method to solve the traveling salesman problem for these houses starting at house T. P 20 32 T 21 31 12 Q 23 25 17 33 S 22 R Use the sorted edges algorithm to solve the TSP for the graph above.

Math 167 Review of Chapter 2 13 (c) Janice Epstein For the graph below, find the Hamiltonian circuit obtained by using the nearest-neighbor algorithm, starting at B. What is the cost if the numbers shown represent the distance in miles? The chart below shows the travel time between cities in hours. Use the sorted edges method to solve the TSP. G H I J K L G 0 16 21 13 32 9 H 16 0 19 29 37 29 I 21 19 0 47 27 8 J 13 29 47 0 24 17 K 32 37 27 24 0 22 L 9 29 8 17 22 0

Math 167 Review of Chapter 2 14 (c) Janice Epstein Apply Kruskal s algorithm to create a minimum cost spanning tree from the given graph. The edges show the time between vertices in seconds. What is the total time? 6 12 15 11 4 1 7 2 10 3 8 5 What is the critical path for the digraph below? The time for each task is given in minutes.