Milestone 4: Courier Company

Slides:



Advertisements
Similar presentations
Limitation of Computation Power – P, NP, and NP-complete
Advertisements

The Theory of NP-Completeness
CPE702 Complexity Classes Pruet Boonma Department of Computer Engineering Chiang Mai University Based on Material by Jenny Walter.
Vehicle Routing & Scheduling Multiple Routes Construction Heuristics –Sweep –Nearest Neighbor, Nearest Insertion, Savings –Cluster Methods Improvement.
CSE332: Data Abstractions Lecture 27: A Few Words on NP Dan Grossman Spring 2010.
The Theory of NP-Completeness
CSE 326: Data Structures NP Completeness Ben Lerner Summer 2007.
Circuits CSE 373 Data Structures Lecture 22. 3/12/03Circuits - Lecture 222 Readings Reading ›Sections and 9.7.
Euler and Hamilton Paths
Ch. 11: Optimization and Search Stephen Marsland, Machine Learning: An Algorithmic Perspective. CRC 2009 some slides from Stephen Marsland, some images.
A Dynamic Messenger Problem Jan Fábry University of Economics Prague
Package Transportation Scheduling Albert Lee Robert Z. Lee.
Scott Perryman Jordan Williams.  NP-completeness is a class of unsolved decision problems in Computer Science.  A decision problem is a YES or NO answer.
University of Texas at Arlington Srikanth Vadada Kishan Kumar B P Fall CSE 5311 Solving Travelling Salesman Problem for Metric Graphs using MST.
1 The Theory of NP-Completeness 2012/11/6 P: the class of problems which can be solved by a deterministic polynomial algorithm. NP : the class of decision.
Complexity Classes (Ch. 34) The class P: class of problems that can be solved in time that is polynomial in the size of the input, n. if input size is.
CS440 Computer Science Seminar Introduction to Evolutionary Computing.
Euler and Hamilton Paths
CSE 326: Data Structures NP Completeness Ben Lerner Summer 2007.
TECH Computer Science NP-Complete Problems Problems  Abstract Problems  Decision Problem, Optimal value, Optimal solution  Encodings  //Data Structure.
A few m3 tips. Speed Tuning 1.Algorithm 2.Data structures 3.Low level code string streetName1, streetName2; if (streetName1 != streetName2) {... int streetId1,
CSCI 3160 Design and Analysis of Algorithms Tutorial 10 Chengyu Lin.
1 The Theory of NP-Completeness 2 Cook ’ s Theorem (1971) Prof. Cook Toronto U. Receiving Turing Award (1982) Discussing difficult problems: worst case.
Limits to Computation How do you analyze a new algorithm? –Put it in the form of existing algorithms that you know the analysis. –For example, given 2.
2101INT – Principles of Intelligence Systems Lecture 3.
CSCI 2670 Introduction to Theory of Computing November 17, 2005.
1 CPSC 320: Intermediate Algorithm Design and Analysis July 30, 2014.
NPC.
The Multicommodity Flow Problem Updated 21 April 2008.
David Luebke 1 2/18/2016 CS 332: Algorithms NP Completeness Continued: Reductions.
Young CS 331 D&A of Algo. NP-Completeness1 NP-Completeness Reference: Computers and Intractability: A Guide to the Theory of NP-Completeness by Garey and.
Lecture 38 CSE 331 Dec 5, OHs today (only online 9:30-11)
1 CPSC 320: Intermediate Algorithm Design and Analysis July 30, 2014.
Lecture 20 CSE 331 July 30, Longest path problem Given G, does there exist a simple path of length n-1 ?
Algorithm Complexity By: Ashish Patel and Alex Golebiewski.
A few m3 tips. Street Segment Length / Travel Time Need to compute in double precision –Otherwise too much round off See piazza.
CSC 172 P, NP, Etc.
Optimization Problems
Limitation of Computation Power – P, NP, and NP-complete
NP-completeness Ch.34.
University of British Columbia
Computational problems, algorithms, runtime, hardness
EMIS 8373: Integer Programming
Measuring Where CPU Time Goes
Routing Through Networks - 1
Hard Problems Introduction to NP
Unsolvable Problems December 4, 2017.
Chapter 2: Business Efficiency Lesson Plan
Chapter 2: Business Efficiency Lesson Plan
GEOP 4355 Transportation Routing Models
Approximation Algorithms for TSP
Intro to NP Completeness
Introduction to Graph Theory Euler and Hamilton Paths and Circuits
Optimization Problems
Chapter 2: Business Efficiency Business Efficiency
CPS 173 Computational problems, algorithms, runtime, hardness
Class 24: Computability Halting Problems Hockey Team Logo
M4 and Parallel Programming
Mental Health and Wellness Resources
Not guaranteed to find best answer, but run in a reasonable time
NP-Completeness Reference: Computers and Intractability: A Guide to the Theory of NP-Completeness by Garey and Johnson, W.H. Freeman and Company, 1979.
Lecture 39 CSE 331 Dec 5, 2011.
Efficiently Estimating Travel Time
CSE 589 Applied Algorithms Spring 1999
CSC 380: Design and Analysis of Algorithms
Traveling Salesman Problems Nearest Neighbor Method
Approximation Algorithms
Algorithms CSCI 235, Spring 2019 Lecture 36 P vs
RAIK 283 Data Structures & Algorithms
Lecture 36 CSE 331 Nov 22, 2013.
Presentation transcript:

Milestone 4: Courier Company

Problem Definition C B D C A D A B Given N deliveries (pick up, drop off, weight) N = 4 here, all intersections and Given M courier depots, each with a truck of capacity C M = 3 here, all intersections Return: low travel time path Starting and ending at some depot Making all N deliveries by traversing intersections while Picking up each package before delivering it, and never overloading truck

No  dropping off packages before they’re picked up! Possible Solution? C B D C A D A B No  dropping off packages before they’re picked up!

Legal Solution C B D C A D A B Output: vector of courier paths Courier path: start intersection, end intersection, deliveries picked up at start, vector of street segments to follow

Simple Solution: Re-use m3 path-finder // Go from first depot to first package pick up path = find_path (depot[0], delivery[0].pickUp); // Complete deliveries, in order for (i = 0; i < N-1; i++) { path += find_path (delivery[i].pickUp, delivery[i].dropOff); path += find_path (delivery[i].dropOff, delivery[i+1].pickUp); } // Drop off last package path += find_path (delivery[N-1].pickUp, delivery[N-1].dropOff); // Go back to the first depot to drop off the truck path += find_path (delivery[N-1].dropOff, depot[0]);

Possible Solution C B D C A D 2 A B 1 Lots of wasted travel!

Need to optimize delivery order! More Logical Solution C B D C A D A B Need to optimize delivery order!

Exhaustive Algorithm? Try all possible delivery orders Pick the one with lowest travel time How many combinations? M truck depots N deliveries  2N pick-up + drop-off intersections Pick one of M starting locations Then pick one of 2N pick-up/drop-off intersections Then one of 2N-1 for the second intersection … (repeat until last delivery) Then drop off at closest depot M * 2N * (2N-1) * (2N-2) * … * 1 = M * (2N)! Some of these are illegal orders  say algorithm checks legality after generating the solution

Exhaustive Algorithm? Say M = 10, N = 100 10 * (2N)!  10377 Invoke find_path () 2N+1 times to get path between each intersection Say find_path takes 0.1 s (very good!) 10377 * 201 * 0.1 s = 1.6 x 10378 s 5 x 10370 years! Lifetime of universe: ~14 x 109 years!

Traveling Salesman Problem We are solving a variation of the traveling salesman problem Computationally hard problem For N deliveries, no guaranteed optimal (lowest travel time solution) in polynomial time i.e. > O(Nk), for any k Means at least O(2N) Need to use heuristics to solve Most research problems are computationally hard Integrated circuit design, drug design, transportation network design, …

Stephen Cook: Pioneer of Complexity Theory U of T professor in Computer Science NP-complete problems No polynomial time solution known on conventional computers Proved: If a method to solve any of these problems in polynomial time found, Then all these problems can be solved in polynomial time P vs. NP: most famous open problem in computer science 1970: denied tenure at UC Berkeley 1971: published most famous paper 1982: won Turing award