Warm-up Find the shortest trip (total distance) starting and ending in Chicago and visiting each other city once.

Similar documents
Traveling Salesman Problem (TSP) - Visit every city and then go home.

Check off these skills when you feel that you have mastered them. Write in your own words the definition of a Hamiltonian circuit.

Intro to Contemporary Math

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

8.3 Hamiltonian Paths and Circuits

Algorithm Design Strategies V

Chapter 2. Business Efficiency. Chapter Outline. Chapter Summary

A path that visits each vertex exactly once is a path

Data Structures and Algorithms (CSCI 340)

CS 320, Fall Dr. Geri Georg, Instructor 320 NP 1

Data Structures in Java

D1 Discrete Mathematics The Travelling Salesperson problem. The Nearest Neighbour Algorithm The Lower Bound Algorithm The Tour Improvement Algorithm

Graphs. COMPSCI 355 Fall 2016

Mathematical Thinking Exam 2 20 November 2017

Hamiltonian Graphs Graphs

Theoretical computer science: Turing machines

P, NP, NP-Complete. Ruth Anderson

Optimization Prof. A. Goswami Department of Mathematics Indian Institute of Technology, Kharagpur. Lecture - 20 Travelling Salesman Problem

NP-Completeness. CptS 223 Advanced Data Structures. Larry Holder School of Electrical Engineering and Computer Science Washington State University

CS/COE

NP-Completeness. ch34 Hewett. Problem. Tractable Intractable Non-computable computationally infeasible super poly-time alg. sol. E.g.

Nondeterministic Polynomial Time

Lecture 4: NP and computational intractability

Bounds on the Traveling Salesman Problem

Data Structures and Algorithms

CS Analysis of Recursive Algorithms and Brute Force

1 Heuristics for the Traveling Salesman Problem

VIII. NP-completeness

Tractable & Intractable Problems

NP-Completeness. Andreas Klappenecker. [based on slides by Prof. Welch]

NP-Complete Problems and Approximation Algorithms

NP-Completeness. Until now we have been designing algorithms for specific problems

Easy Problems vs. Hard Problems. CSE 421 Introduction to Algorithms Winter Is P a good definition of efficient? The class P

Hamiltonian Cycle. Hamiltonian Cycle

Travelling Salesman Problem

Hamiltonian Cycle. Zero Knowledge Proof

ABHELSINKI UNIVERSITY OF TECHNOLOGY

Chapter 34: NP-Completeness

CSCI3390-Lecture 17: A sampler of NP-complete problems

SAT, Coloring, Hamiltonian Cycle, TSP

NP-completeness. Chapter 34. Sergey Bereg

CSCI3390-Lecture 18: Why is the P =?NP Problem Such a Big Deal?

Data Structures in Java. Session 22 Instructor: Bert Huang

Informatique Fondamentale IMA S8

NP-Complete problems

Computational Complexity

Outline. 1 NP-Completeness Theory. 2 Limitation of Computation. 3 Examples. 4 Decision Problems. 5 Verification Algorithm

Unit 7 Day 4 Section 4.5 & Practice Hamiltonian Circuits and Paths

CSE 326: Data Structures NP Completeness

Lecture 24: How to become Famous with P and NP

Problem Complexity Classes

Algorithms and Theory of Computation. Lecture 22: NP-Completeness (2)

CSL 356: Analysis and Design of Algorithms. Ragesh Jaiswal CSE, IIT Delhi

1.4 Rewriting Equations

July 18, Approximation Algorithms (Travelling Salesman Problem)

MVE165/MMG630, Applied Optimization Lecture 6 Integer linear programming: models and applications; complexity. Ann-Brith Strömberg

NP-complete problems. CSE 101: Design and Analysis of Algorithms Lecture 20

Connection MATH Connection. Benjamin V.C. Collins, James A. Swenson MATH 2730

Algorithms and Complexity theory

NP-Complete Problems. More reductions

Lecture 6 January 21, 2013

Node Edge Arc Routing Problems (NEARP)

The quest for finding Hamiltonian cycles

Algorithms Design & Analysis. Approximation Algorithm

Foundations of Math. Chapter 3 Packet. Table of Contents

10.3 Matroids and approximation

P and NP. Warm Up: Super Hard Problems. Overview. Problem Classification. Tools for classifying problems according to relative hardness.

The P = NP Problem Bristol Teachers Circle, June P.D.Welch, University of Bristol

Edge Elimination for the Hamiltonian Cycle problem

Data Structures and Algorithms

ECS122A Handout on NP-Completeness March 12, 2018

Ant Colony Optimization: an introduction. Daniel Chivilikhin

Minimum-weight spanning trees

Automata Theory CS Complexity Theory I: Polynomial Time

Circuits. CSE 373 Data Structures

P vs NP: Solutions of the Traveling Salesman Problem

IS 709/809: Computational Methods for IS Research. Math Review: Algorithm Analysis

Math 9 Homework & Notebook

NP-Completeness I. Lecture Overview Introduction: Reduction and Expressiveness

CS 6505, Complexity and Algorithms Week 7: NP Completeness

NP Complete Problems. COMP 215 Lecture 20

Examination paper for TDT4120 Algorithms and Data Structures

Lecture 15: Genetic Algorithms

Planar Graphs (1) Planar Graphs (3) Planar Graphs (2) Planar Graphs (4)

P P P NP-Hard: L is NP-hard if for all L NP, L L. Thus, if we could solve L in polynomial. Cook's Theorem and Reductions

A Survey on Travelling Salesman Problem

Unit 1A: Computational Complexity

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

Quantum Complexity Theory. Wim van Dam HP Labs MSRI UC Berkeley SQUINT 3 June 16, 2003

Algorithms Re-Exam TIN093/DIT600

NP-Complete Reductions 1

September 14, 1999 Name The first 16 problems count 5 points each and the final 3 count 15 points each.

Section 20: Arrow Diagrams on the Integers

Introduction to Complexity Theory

Solving the Travelling Salesman Problem Using Quantum Computing

KNES Primary School Year 1 Geography Course Outline: Term 1, 2 and 3

Instructor: TODD CONKLIN Course: 3rd hour Math

Swarm Intelligence Traveling Salesman Problem and Ant System

Graph Theory and Optimization Computational Complexity (in brief)

Trees/Intro to counting

Transcription:

Warm-up Find the shortest trip (total distance) starting and ending in Chicago and visiting each other city once. Minimum-cost Hamiltonian Circuits Practice Homework time Minneapolis Cleveland 779 354 545 St Louis 567 305 427 Unlike Euler circuits, no method has been found to easily determine whether a graph has a Hamiltonian circuit Chicago

Check Homework

Objectives Content Objective: Apply the Fundamental Principal of Counting to the Traveling Salesman Problem. Social Objective: Listen well to teacher and classmates. Language Objective: Clearly write the Brute Force algorithm, the Nearest Neighbor algorithm, and the Sorted Edges algorithm for solving the Traveling Salesman Problem.

Warm-up Minimum-Cost Hamiltonian Circuit Algorithm (step-by-step process) Cleveland Brute Force Algorithm Generate all possible Hamiltonian circuits. Add up the weights (distances) on the edges of each tour. Choose the circuit of minimum distance. 779 354 545 St Louis 567 305 Minneapolis 427 Chicago

If there are a ways of choosing one thing, b ways of choosing a second after the first is chosen,, and z ways of choosing the last item after the earlier choices, then the total number of choice patterns is a b c z. Examples: Barbie Doll Clothes 10 shirts 6 skirts 4 pairs of shoes Drawing from a bag of 8 numbers (not replacing) how many different orders of numbers?

Applying the Fundamental Principle of Counting If there are n vertices (cities), then there are (n-1)! routes and edges. But each route is a reverse of another, so there are (n-1)!/2 different Hamiltonian Circuits or tours four city problem five city problem Six city problem Total # of routes= Total # of tours = Total # of routes= Total # of routes = Total # of tours = Total # of tours =

Traveling Salesman Problem (TSP) textbook: pg 38-39

The Traveling Salesman Problem

Nearest-Neighbor Algorithm From the starting point (Chicago) first visit the nearest city, then visit the nearest city that has not already been visited. Return to the starting point when no other choice is available. Try starting at St. Louis. greedy algorithm Cleveland Cleveland 779 354 545 St Louis 567 305 Minneapolis 427 Chicago 779 354 545 St Louis 567 305 Minneapolis 427 Chicago

Traveling Salesman Problem (TSP) Sorted-Edges Algorithm Sort the edges in increasing order. Select at each stage that edge of least cost that (1) never requires that three used edges meet at a vertex and that (2) never closes up a circular tour that doesn t include all the vertices. greedy algorithm Cleveland 779 354 545 St Louis 567 305 Minneapolis 427 Chicago No algorithm has been found that is both fast and always produces an optimal solution.

Problem 1 On a map there are roads from town A of length 10, 26, 12, and 50 miles. Using the nearest-neighbor algorithm for finding a Hamiltonian circuit starting at town A, which road would be traveled first? A) road of length 10 B) road of length 26 C) road of length 12 D) road of length 50

Problem 2 For the traveling salesman problem (Hamiltonian circuit) applied to six cities, how many tours are possible? A) 60 B) 120 C) 360 D) 720

Problem 3 For the traveling salesman problem (Hamiltonian circuit) applied to five cities, how many distinct tours are possible? A) 120 B) 60 C) 24 D) 12

Problem 4 On the graph below, which routing is produced by using the sorted-edges algorithm to solve the traveling salesman problem? A) ABCDA B) ABDCA C) ACBDA D) ABCD

Problem 5 For the graph below, what is the cost of the Hamiltonian circuit obtained by using the sorted-edges algorithm? A) 40 B) 58 C) 60 D) 66

Problem 6 For the graph below, which routing is produced by using the nearest-neighbor algorithm to solve the traveling salesman problem? A) ABCEDA B) ABEDCA C) ADCEBA D) ABCED

Problem 7 For the graph below, what is the cost of the Hamiltonian circuit obtained by using the sorted-edges algorithm? A) 23 B) 29 C) 33 D) 41

Problem 8 Use the brute force algorithm to solve the traveling salesman problem for the graph of the four cities shown below.