Algorithms for Path-Planning Shuchi Chawla Carnegie Mellon / Stanford Univ. A trick-or-treat problem • It’s Halloween… Collect large amounts of candy between 6pm and 8pm • Goal: Get as much candy as possible • In what order should you visit houses? 2 Algorithms for Path-Planning Shuchi Chawla A travelling repair-bot problem • Robot receives requests for repair • Requests come with a time-window for servicing • Brownie points for each request serviced • Goal: Maximize the total brownie points • Cannot perform all of them – Takes time to service each request and move from one to another • The problem: – Which ones to accept? Selection – How to schedule them? Ordering 3 Algorithms for Path-Planning Shuchi Chawla Path-planning • Informally… planning and ordering of tasks • Classic instance ― Traveling Salesman Problem Find the shortest tour covering all given locations • A natural extension ― Orienteering Cover as many locations as • Many variants, applications: possible by a given deadline – Delivery & distribution problems – Production planning, Supply chain management – Robot navigation • Mostly NP-hard ☹ 4 Algorithms for Path-Planning Shuchi Chawla Path-planning: A brief history • Studied in Operations Research for the past 20-30 years (also known as Vehicle Routing) Many variants: multiple vehicles, stochastic demands, pickup-and-delivery Mixedsolution inProgramming A a Integer polynomial-time • Techniques for Find2-approximation: half-as-good 1 branch (a½ 1) • cutting plane methods as ∕a OPT and bound with value OPT; value OPT • • simulated annealing Stochastic planning problems genetic algorithms … in Robotics and AI • Focus mostly on exploration, position estimation • My • Some poly-time solvable problems studied e.g. shortest paths focus: Approximation algorithms • Linear and Dynamic programming techniques 5 Algorithms for Path-Planning Shuchi Chawla Approximation Results • A reward vs. time trade-off A “quota” OPT approximation (2 hrs, ) (4 hrs, ) Reward obtained A “budget” approximation (2 hrs, ) Time taken 6 Algorithms for Path-Planning Shuchi Chawla Approximation Results • A reward vs. time trade-off • A budget on time; maximize reward – Orienteering single deadline on time – Deadline-TSP different deadlines on different locations – TSP with Time-Windows different time windows for diff. locations • A quota on reward; minimize time – TSP visit all locations – k-TSP visit k locations – Min-Excess visit k locations, but minimize excess • Optimize a combination of reward and time – Prize-Collecting TSP minimize time plus reward foregone – Discounted-Reward TSP max. reward, reward decreases with time 7 Algorithms for Path-Planning Shuchi Chawla Approximation Results • A reward vs. time trade-off • A budget on time; maximize reward This talk – Orienteering ? 3 Use structural properties – Deadline-TSP ? log n 3 & Dynamic Programming – TSP with Time-Windows ? log2 n 3 FOCS’03 & STOC’04 • A quota on reward; minimize time Use LP-rounding – TSP 1.5 [Christofides ’76] – k-TSP 2 [BRV99] [AK00] [CGRT03] [Garg05] … – Min-Excess ? 2+ • Optimize a combination of reward and time – Prize-Collecting TSP 2 [Goemans Williamson ’92] – Discounted-Reward TSP ? 6.75+ 8 Algorithms for Path-Planning Shuchi Chawla Back to candy-collection (Orienteering) • The givens A “map” G of locations, distances, start location s Rewards on locations Deadline D • To find A path that collects as much reward as possible by deadline D • NP-hard; we want to find an approximation In poly-time, find a path covering reward ⅓ OPT by deadline D 9 Algorithms for Path-Planning Shuchi Chawla Back to Orienteering: why LPs don’t work • Naïve attempt: use (a variant of) k-TSP • If there exists a path: length = ½D, reward 1∕a OPT • 2-approx to k-TSP gives: length D , reward 1∕a OPT 10 Algorithms for Path-Planning Shuchi Chawla Back to Orienteering: why LPs don’t work • Naïve attempt: use (a variant of) k-TSP – Fails when most reward is far from the start • Algorithms for “quota” problems rely on the Goemans- Williamson primal-dual subroutine – Miss out on far-away reward • Budget problems are ill-behaved w.r.t. small perturbations Bad case: low slack • Solution: handle the “very-low slack” case separately 11 Algorithms for Path-Planning Shuchi Chawla Formalizing the “slack” • Excess of path = length of path – length of shortest path • The Min-Excess problem: Given a map G, start s, end t, reward quota k Find path with reward k that minimizes excess s Shortest distance from start t dist(s,t) = 1½ hrs. Length of path length = 2 hrs. OPT excess ℓ = ½ hr. length = shortest distance Min-Excess approx = 2½ hrs. k-TSP = 4 hrs. approx 12 Algorithms for Path-Planning Shuchi Chawla Formalizing the “slack” • Excess of path = length of path – length of shortest path • a-approx to length : len(ALG) a (shorest-len + excess) • An approx. for excess an approx. for Orienteering • a-approx to excess : len(ALG) shortest-len + a excess Given approx for k-TSP: Given approx for excess: Good solution Good solution to prefix of OPT to suffix of OPT 13 Algorithms for Path-Planning Shuchi Chawla Approximating the excess • Excess of path = length of path – length of shortest path • a-approx to length : len(ALG) a (shortest-len + excess) • a-approx to excess : len(ALG) shortest-len + a excess • The simple case : excess > shortest-len – 2-approx to length gives 3-approx to excess Solution: a slightly – examine use k-TSP different problem nodes in shortest-len • Suppose OPT visits allexcess << order of increasing The harder case : distance from start; Find OPT. – Can solve this exactly using dynamic programming! 14 Algorithms for Path-Planning Shuchi Chawla Approximating the excess: combining them • The large excess case: • The small excess case: excess > shortest-len excess ≈ 0 (OPT is “monotone”) • Use k-TSP • Use Dynamic Programming a (2+)-approximation for dynamic programming Gives What about segments usingMin-Excess [FOCS’03] Patch the intermediate case? Dynamic Program Use k-TSP OPT wiggly wiggly monotone monotone monotone In order of increasing distance from start 15 Algorithms for Path-Planning Shuchi Chawla An algorithm for Orienteering • Construct a path from s tofor that has length D and An r-approximation t, min-excess gives collects a r-approximation reward maximum possible for Orienteering • Given a 3-approximation to min-excess: 1. Divide OPT into 3 “equal-reward” parts (hypothetically) 2. Approximate the part with the smallest excess 3-approximation to orienteering Excess of path from u to v OPT (u,v) = ℓ(u,v)–d(u,v) v2 1 3 2 v1 ALG Excess of ALG 1+2+3 ; Reward of ALG = ⅓ reward of OPT 16 Algorithms for Path-Planning Shuchi Chawla So far… • A new problem: min-excess • An approximation to min-excess • A 3-approximation to Orienteering • Coming up next: Planning with deadlines – a (3 log n)-approximation 17 Algorithms for Path-Planning Shuchi Chawla Planning with deadlines: Deadline-TSP • The travelling repair-bot problem: – Every node (request) v has a deadline D(v) – Reward obtained at v, if v is visited before D(v) – In Orienteering, D(v) = D for all nodes v • Constant approx known for special cases: – points on a line – Few different deadlines (based on Orienteering) • Nothing known in general 18 Algorithms for Path-Planning Shuchi Chawla Approximating Deadline-TSP • Our approach: – Divide the problem into “Orienteering sub-problems” – Solve these using algorithm developed previously • When can we use Orienteering? If the last vertex visited by OPT has the smallest deadline – Remove nodes of smaller deadline – Reduce all other deadlines to the smallest one – OPT remains unchanged • Does OPT have a large subpath with this property? 19 Algorithms for Path-Planning Shuchi Chawla A pictorial representation of OPT “Good” rectangle Deadline Can be approximated via Orienteering Time 20 Algorithms for Path-Planning Shuchi Chawla The high-level idea • A single “good” rectangle may not contain enough reward • Idea: Approximate many rectangles; stitch together the approximations • Main bottleneck: avoiding double-counting of reward – Divide graph into disjoint subsets Vi – Approximate the i-th rectangle over Vi 21 Algorithms for Path-Planning Shuchi Chawla Avoiding double-counting • Divide nodes into V4 sets by deadlines V3 • Guess last node on OPT in each group Deadline V2 • Approximate Orienteering on V1 each group length of seg. 2 length of seg. 3 Time 22 Algorithms for Path-Planning Shuchi Chawla Avoiding double-counting • To visit nodes V4 before deadlines, rectangles must be V3 disjoint along the time-axis Deadline V2 • Still consider the same sets Vi of vertices V1 • Obtain reward contained in axis- disjoint rectangles Time 23 Algorithms for Path-Planning Shuchi Chawla The disjoint-rectangle argument • Approximate reward contained in a family of “disjoint” rectangles • We construct (log n) families of disjoint rectangles – The families together contain all the nodes of OPT – We can approximate the best family via Orienteering and dynamic programming – Reward obtained ⅓ 1/(log n) – Gives a (3 log n)-approximation 24 Algorithms for Path-Planning Shuchi Chawla Deadlines to Time-Windows • Nodes have release-times as well as deadlines • Must visit a node within its time-window to obtain reward • Straightforward extension of Deadline-TSP algorithm (3 log2 n)-approximation to Time-Windows-TSP • A bicriteria approximation: Given any k > 0, get O(1/k) fraction of reward exceed deadlines by a (1+2-k) factor O(log Dmax)-approximation 25 Algorithms for Path-Planning Shuchi Chawla A recap of our results • First approximations for Orienteering, Deadline-TSP, Time-Windows-TSP, Discounted-Reward-TSP, … • Introducing the new min-excess objective and approximating it 26 Algorithms for Path-Planning Shuchi Chawla Open Problems • Hardness of planning problems • Approximations for directed path-planning – Chekuri, Pal give quasi-polytime polylog-approximations • Dealing with capacity & precedence constraints • Techniques for approximating planning problems on MDPs 27 Algorithms for Path-Planning Shuchi Chawla Questions?