Not guaranteed to find best answer, but run in a reasonable time

Slides:



Advertisements
Similar presentations
Knapsack Problem: Greedy vs. Brute Force pp (Section 7.6)
Advertisements

VEHICLE ROUTING PROBLEM
Vehicle Routing & Scheduling Multiple Routes Construction Heuristics –Sweep –Nearest Neighbor, Nearest Insertion, Savings –Cluster Methods Improvement.
Planning under Uncertainty
1 Greedy Algorithms. 2 2 A short list of categories Algorithm types we will consider include: Simple recursive algorithms Backtracking algorithms Divide.
Clustering Color/Intensity
5-Nov-2003 Heuristic Search Techniques What do you do when the search space is very large or infinite? We’ll study three more AI search algorithms: Backtracking.
Vehicle Routing & Scheduling: Part 2 Multiple Routes Construction Heuristics –Sweep –Nearest Neighbor, Nearest Insertion, Savings –Cluster Methods Improvement.
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.
A Dynamic Messenger Problem Jan Fábry University of Economics Prague
Heuristic Optimization Methods Greedy algorithms, Approximation algorithms, and GRASP.
For Friday Finish reading chapter 4 Homework: –Lisp handout 4.
For Monday Read chapter 4, section 1 No homework..
Search with Costs and Heuristic Search 1 CPSC 322 – Search 3 January 17, 2011 Textbook §3.5.3, Taught by: Mike Chiang.
Review: Tree search Initialize the frontier using the starting state While the frontier is not empty – Choose a frontier node to expand according to search.
For Wednesday Read chapter 6, sections 1-3 Homework: –Chapter 4, exercise 1.
For Wednesday Read chapter 5, sections 1-4 Homework: –Chapter 3, exercise 23. Then do the exercise again, but use greedy heuristic search instead of A*
Evolutionary Computation: A New Way to Search for Solutions Blase B. Cindric Mount Union College November 14, 2006.
Search Techniques CS480/580 Fall Introduction Trees: – Root, parent, child, sibling, leaf node, node, edge – Single path from root to any node Graphs:
Solving the Vehicle Routing Problem with Multiple Multi-Capacity Vehicles Michael Sanders.
A few m3 tips. Street Segment Length / Travel Time Need to compute in double precision –Otherwise too much round off See piazza.
Review: Tree search Initialize the frontier using the starting state
School of Computer Science & Engineering
Greedy Algorithms.
Clustering Data Streams
CSCI 4310 Lecture 10: Local Search Algorithms
Data Structures Lab Algorithm Animation.
Measuring Where CPU Time Goes
BackTracking CS255.
CSPs: Search and Arc Consistency Computer Science cpsc322, Lecture 12
USING MICROBIAL GENETIC ALGORITHM TO SOLVE CARD SPLITTING PROBLEM.
Local Container Truck Routing Problem with its Operational Flexibility Kyungsoo Jeong, Ph.D. Candidate University of California, Irvine Local container.
CSPs: Search and Arc Consistency Computer Science cpsc322, Lecture 12
For Monday Chapter 6 Homework: Chapter 3, exercise 7.
Reinforcement Learning (1)
CPU Efficiency Issues.
Local Search Algorithms
Unsolvable Problems December 4, 2017.
C ODEBREAKER Class discussion.
Informed Search and Exploration
Data Mining (and machine learning)
Artificial Intelligence Problem solving by searching CSC 361
HW #1 Due 29/9/2008 Write Java Applet to solve Goats and Cabbage “Missionaries and cannibals” problem with the following search algorithms: Breadth first.
CSPs: Search and Arc Consistency Computer Science cpsc322, Lecture 12
Chapter 2: Business Efficiency Business Efficiency
Informed search algorithms
Heuristic Algorithms via VBA
Advanced Analysis of Algorithms
Informed search algorithms
Where to Optimize? Where do we spend our limited resources looking for issues that will improve performance?
Graph Searching.
8. Efficient Scoring Most slides were adapted from Stanford CS 276 course and University of Munich IR course.
Artificial Intelligence
A General Backtracking Algorithm
M4 and Parallel Programming
Milestone 4: Courier Company
Mental Health and Wellness Resources
Min Heap Update E.g. remove smallest item 1. Pop off top (smallest) 3
Route Graph Optimization
Efficiently Estimating Travel Time
Heuristic Algorithms via VBA
Heuristic Algorithms via VBA
More on HW 2 (due Jan 26) Again, it must be in Python 2.7.
More on HW 2 (due Jan 26) Again, it must be in Python 2.7.
Spanning Trees Lecture 20 CS2110 – Spring 2015.
The Rich/Knight Implementation
Midterm Review.
Approximation Algorithms
Pointer analysis John Rollinson & Kaiyuan Li
The Rich/Knight Implementation
Presentation transcript:

Not guaranteed to find best answer, but run in a reasonable time Heuristic Algorithms Not guaranteed to find best answer, but run in a reasonable time

Heuristic 1 Ideas? Overall: O(M*N) + O(N*N) + O(M) = O(M*N + N2) Go from any depot to nearest pickup, p while (packages to deliver) drop off package at delivery[p].dropOff p = nearest remaining pickup } Go to nearest depot O(M*N) N iterations O(N) O(M) Overall: O(M*N) + O(N*N) + O(M) = O(M*N + N2)

Fast Enough? O(M*N + N2) Ideas? Say M = 10, N = 100 Time = C * [10 * 100 + 1002] Time = C * 11000 Call m3 findpath to evaluate each possible travel time? C  0.1 s Time  1100 s  too big! Ideas? Estimate travel time as  geometric distance Now C  10-7 Time  10-7 * 11000 = 1 ms  more than fast enough! Call find_path on final order: 200 calls  20s  OK!

Heuristic 1 D A A B B C C D Much better than using given/random order Can we improve more?

Heuristic 1++ Overall: O(M*N) + O(2N*N) + O(M) = O(M*N + N2) Go from any depot to nearest pickup, p while (packages to deliver) p = nearest legal pickUp or dropOff solution += path to p } Go to nearest depot O(M*N) 2N iterations O(N) O(M) Overall: O(M*N) + O(2N*N) + O(M) = O(M*N + N2)

Heuristic 1++ Better still Not much more code; slightly more CPU time A A B B C C D Better still Not much more code; slightly more CPU time

Heuristic 1 & 1++ are “Greedy” Make the next decision “greedily” Best decision you can make now And never go back to change a decision Greedy algorithms Generally fast But often don’t get the best solution Smarter variants: use guess of what may happen in future to make a better decision

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? Force it to start at a different depot Start with the 2nd smallest travel time from depot to a pick up Have a 10% chance of taking the second smallest travel time when choosing each next delivery ...

Heuristic 1++ (Greedy) Again B A A B Optimal?

Heuristic 2: Multi-Start B A A B Force route to start on 2nd best depot Better final answer, even though first hop is longer!