Traveling Salesman Problem Continued. Heuristic 1 Ideas? –Go from depot to nearest delivery –Then to delivery closest to that –And so on until we are.

Slides:



Advertisements
Similar presentations
Artificial Intelligence
Advertisements

Algorithm Design Techniques
Heuristic Search techniques
Lindsey Bleimes Charlie Garrod Adam Meyerson
Greedy Algorithms.
Introduction to Algorithms Greedy Algorithms
Branch-and-Bound In this handout,  Summary of branch-and-bound for integer programs Updating the lower and upper bounds for OPT(IP) Summary of fathoming.
Informed Search Methods How can we improve searching strategy by using intelligence? Map example: Heuristic: Expand those nodes closest in “as the crow.
Types of Algorithms.
Dijkstra’s Algorithm Keep Going!. Pre-Computing Shortest Paths How many paths to pre-compute? Recall: –Using single-source to single-dest find_path: Need.
Problem Solving Dr. Andrew Wallace PhD BEng(hons) EurIng
Vehicle Routing & Scheduling: Part 1
Local search algorithms
Two types of search problems
Clustering and greedy algorithms — Part 2 Prof. Noah Snavely CS1114
1 Greedy Algorithms. 2 2 A short list of categories Algorithm types we will consider include: Simple recursive algorithms Backtracking algorithms Divide.
MAE 552 – Heuristic Optimization Lecture 27 April 3, 2002
Nature’s Algorithms David C. Uhrig Tiffany Sharrard CS 477R – Fall 2007 Dr. George Bebis.
Intelligent Agents What is the basic framework we use to construct intelligent programs?
This material in not in your text (except as exercises) Sequence Comparisons –Problems in molecular biology involve finding the minimum number of edit.
MAE 552 – Heuristic Optimization Lecture 5 February 1, 2002.
Clustering and greedy algorithms Prof. Noah Snavely CS1114
Backtracking.
Ch. 11: Optimization and Search Stephen Marsland, Machine Learning: An Algorithmic Perspective. CRC 2009 some slides from Stephen Marsland, some images.
1 Traveling Salesman Problem Algorithms and Networks 2014/2015 Hans L. Bodlaender Johan M. M. van Rooij.
Copyright R. Weber Search in Problem Solving Search in Problem Solving INFO 629 Dr. R. Weber.
Lecture 23. Greedy Algorithms
Algorithms for Network Optimization Problems This handout: Minimum Spanning Tree Problem Approximation Algorithms Traveling Salesman Problem.
1 Introduction to Approximation Algorithms. 2 NP-completeness Do your best then.
Vilalta&Eick: Informed Search Informed Search and Exploration Search Strategies Heuristic Functions Local Search Algorithms Vilalta&Eick: Informed Search.
The Traveling Salesperson Problem Algorithms and Networks.
SPANNING TREES Lecture 21 CS2110 – Spring
Image segmentation Prof. Noah Snavely CS1114
Greedy Algorithms. Surprisingly, many important and practical computational problems can be solved this way. Every two year old knows the greedy algorithm.
Thursday, May 9 Heuristic Search: methods for solving difficult optimization problems Handouts: Lecture Notes See the introduction to the paper.
FORS 8450 Advanced Forest Planning Lecture 11 Tabu Search.
Lecture 3: Uninformed Search
The Generalized Traveling Salesman Problem: A New Genetic Algorithm Approach by John Silberholz, University of Maryland Bruce Golden, University of Maryland.
Dr. Christoph F. Eick: Review of the TSP Project How was the project graded? l Yan Wang and Dr. Eick both graded the project; cases were our scores disagreed.
Types of Algorithms. 2 Algorithm classification Algorithms that use a similar problem-solving approach can be grouped together We’ll talk about a classification.
Optimization Problems
Ramakrishna Lecture#2 CAD for VLSI Ramakrishna
Artificial Intelligence in Game Design Lecture 20: Hill Climbing and N-Grams.
A greedy algorithm is an algorithm that follows the problem solving heuristic of making the locally optimal choice at each stage with the hope of finding.
CMPT 463. What will be covered A* search Local search Game tree Constraint satisfaction problems (CSP)
School of Computer Science & Engineering
Greedy Algorithms.
CSCI 4310 Lecture 10: Local Search Algorithms
Data Structures Lab Algorithm Animation.
CS 460 Spring 2011 Lecture 4.
Local Search Algorithms
Subject Name: Operation Research Subject Code: 10CS661 Prepared By:Mrs
Comparing Genetic Algorithm and Guided Local Search Methods
Types of Algorithms.
Problem Solving: Brute Force Approaches
Study Guide for ES205 Yu-Chi Ho Jonathan T. Lee Nov. 7, 2000
Haim Kaplan and Uri Zwick
Fine-Grained Complexity Analysis of Improving Traveling Salesman Tours
CSE 589 Applied Algorithms Spring 1999
CS Fall 2016 (Shavlik©), Lecture 9, Week 5
Advanced Analysis of Algorithms
Graph Searching.
Artificial Intelligence
Mental Health and Wellness Resources
Not guaranteed to find best answer, but run in a reasonable time
Efficiently Estimating Travel Time
Spanning Trees Lecture 20 CS2110 – Spring 2015.
Midterm Review.
CSC 380: Design and Analysis of Algorithms
Simulated Annealing & Boltzmann Machines
Presentation transcript:

Traveling Salesman Problem Continued

Heuristic 1 Ideas? –Go from depot to nearest delivery –Then to delivery closest to that –And so on until we are done with deliveries –Then go to closest depot

Heuristic 1 Much better than just using given/random order Optimal?

Heuristic 1 is “Greedy” Makes the next decision “greedily” –Best decision you can make now –Without considering future consequences –And never go back to change a decision Greedy algorithms –Generally fast –But often don’t get the best solution

How Could We Get More Quality? By spending more CPU time Heuristic 2: take best of many results –“Multi-start” –E.g.try our greedy algorithm multiple times How to make it get a different answer? 1.Force it to start at a different depot 2.Start with the 2 nd smallest travel time from depot to a delivery 3.Have a 10% chance of taking the second smallest travel time when choosing each next delivery 4....

Heuristic 2: Multi-start Different Might be better travel time, even though first hop is longer

Heuristic 3 Improve an existing solution?

Heuristic 3 Improve an existing solution? –How? –Local perturbation Travel time for this connection (edge) Total travel time = 81

Heuristic 3: Local Perturbation E.g. 2-edge operation (2-opt) –Delete two connections in path

Heuristic 3: Local Perturbation E.g. 2-edge operation (2-opt) –Reconnect total path differently –But have to make legal!

Heuristic 3: Local Perturbation Must form a depot  all delivery  depot path –Swap endpoints of blue & yellow connections

Heuristic 3: Local Perturbation Must form a depot  all delivery  depot path –Swap endpoints of blue & yellow connections (edges) –Then reverse some edge directions to legalize path –This can affect edge travel times! Total travel time = 94

Heuristic 3: Local Perturbation Calculate new total travel time –Update current best solution if it is an improvement –Otherwise go back to prior solution Total travel time = 94

Heuristic 3: Local Perturbation Try another 2-opt –Swap end-points of pink & green connections Total travel time = 81

Heuristic 3: Local Perturbation Try another 2-opt –Swap end-points of pink & green connections –Compute new connection travel times

Heuristic 3: Local Perturbation Try another 2-opt –Swap end-points of pink & green connections –Compute new connection travel times –Legalize path (have to go to depot from last delivery)

Heuristic 3: Local Perturbation Try another 2-opt –Compute new travel time: 72 –Improvement: save in current best solution

Heuristic 3 Local perturbation or iterative improvement N-1 edges/connections between delivery locations How many different 2-opts? –(N-1) choose 2 choices between delivery locations –N = 40  39 * 38 / 2 = 741 options –Somewhat more if we also change the depot edges –Reasonable number, but fast code can check them all If you find an improvement, can try all 2-opts again –Path has changed  a 2-opt that didn’t work before now might

Iterative Improvement Can still get stuck in local minima Not at the optimum (global minimum) But your local perturbations all result in a worse solution Larger perturbations can explore a bigger space E.g 3-opts –Delete 3 connections at a time –Then reconnect in various ways –Bigger change  can explore more of space –But more combinations: N-1 choose 3: ~10,000 Times 4 ways to reconnect each: ~40,000

Heuristic 4: Hill Climbing One way to get out of a rut –Change something! –Even if it looks like a bad idea at first Hill climbing