400 likes | 540 Views
Mumbai Navigator. “How to commute using delay prone buses” Abhiram Ranade Department of Comp Sc. & Engg. I.I.T. Bombay. Specification. Input: Origin, Destination (In Mumbai). Output: Travel plan using public transport (400 Bus routes, 100 train stations,
E N D
Mumbai Navigator “How to commute using delay prone buses” Abhiram Ranade Department of Comp Sc. & Engg. I.I.T. Bombay
Specification Input: Origin, Destination (In Mumbai) Output: Travel plan using public transport (400 Bus routes, 100 train stations, 2500 Bus stops) Time estimate (waiting + travelling) Claim: Fastest Plan is output Least expected waiting + travel time. Under certain model.
Travel Planning in a Punctual World “6:17 bus from x to z. 6:32 train from z to w. 7:15 train from w to y.” Program Origin = x Destination = y Bus/Train Schedules Plan generated using shortest path algorithm.
Delay Prone World • Bus schedules are not reliable. • Arrival frequency is statistically reliable • Travel time is statistically reliable. Mumbai Problem: • Terminus to terminus time estimate available. Stop-to-stop not available.
Mumbai Navigator Organization • Preprocessing Phase: Given terminus-to-terminus times for each route, Guess stop-to-stop timing • Main program: Database input: Frequency of each route + Stop-to-stop time along route. User Input: Origin, Destination Output: Travel Plan, Time estimate.
Outline • Model • Plan Construction • Preprocessing Phase • Current Status • Maps
Travel Plan Models • Fixed/Sequential: “Take bus B1 to x. From there train T1 to y. From there bus B2 to z” • Adaptive: “Take bus B3 or B4 whichever comes first. If B3 then alight at w, then take either.. If B4 then alight at u, then take..” • Adaptive better in delay prone world.
Plan Tree Chirqui-Robillard ’75 Origin B4 B3 w u … … … Destination Destination Destination Destination Destination Destination
Model of Bus Arrival • Poisson Distributed, independent among routes. “Route 396 Ltd. Has 36 services in 18 hours.” “Frequency” = once every 30 minutes : f = 1/30 Prob [ Bus arrives in next minute] = f =1/30 E[Waiting time] = 1/f
Problem Statement for Planner • Database Input: Bus frequencies, stop-to-stop travel timing. • On line Input: Origin, Destination • Assumption: Bus arrivals are Poisson dist. • Output: Plan tree having minimum average time … Next
Expected Time for a Plan Origin B Destination Origin B1 B2 Destination Destination
Origin B1 B2 Subplan 2 Expected time T2 SubPlan 1 Expected time T1
Theorem Optimal plan tree can be found in polynomial time. • Optimal = minimum expected time • Brute force will not work: number of possible plan trees: exponential • 1 second for Mumbai
Algorithm (Dyn. Prog.) • Form optimal plans without bus changes from every stop to destination. • Form optimal plan with at most 1 change from every stop to destination. • … • Form optimal plan with at most k changes from every stop to destination. Implementation uses k=3.
Plans without bus changes Origin: Borivali Destination: Mulund
Possible Plans Bor Bor Bor 398 L1 398 L1 Mul Mul Mul Mul 5 + 120 30 + 80 = 4.3 + 114.3 = 118.6
Key Observation • Even if 398 arrives immediately, there is no point in getting into it, because running (398) > running(L1)+ waiting(L1) 120 80 30
General Case: n buses Algorithm: • Sort by running time: • Compute: Waiting time, running time for first i buses • Find j s.t. • Use buses 1..j
k change plans from k-1 change plans. Special case: Only one bus B through origin stop S. S3 S2 S1 S Can only choose where to get off Start of route B
S S S B B B … S1 S2 St Optimal k-1 Change plan From S1 to Destination Optimal k-1 Change plan From S2 to Destination Optimal k-1 Change plan From St to Destination Evaluate all t plans, and pick best.
k change plans from k-1 change plans. Special case: Only two buses B1,B2 at origin stop S. S22 S21 S13 S12 Sta S11 Start of B2 S Can wait for B1, get off at optimal stop. Can wait for B2, get off .. Can wait for either B1 or B2…. Start of B1
Plan Construction Summary • Inductive construction of plans. Dynamic Programming. • How to compose plans • Data structures, computation order etc. to get high efficiency.
Problem Definition • Input: End-to-end time for each route • Output: Time between consecutive stops Idea 1: Time between consecutive stops
Example • End-to-end-time for 398ltd. = 90 min • Number of stops = 45 • Stop-to-stop time = 2 min • End-to-end for 521ltd. = 180 min • Number of stops = 60 • Stop to stop time = 3 min • What if routes overlap?
Idea 2 • Let tij = running time from stop i to stop j (consecutive on some route) • t15 + t56 + t69 + t93 + t34 = 90 • Formulate for each route. Find consistent solution. 9 3 4 6 5 Route with end-to-end time = 90 1
Complications • Standard solvers find solutions with many variables = 0. Add inequalities: Tmin < tij < Tmax • Fare stage = 2-3 stops. Stage length known. • sij = speed of bus from stop i to stop j. 10 < sij < 120 • 1-5-6 = stage of length 8, then: 10t15 + 10t56 < 8, 120t15 + 120t56 > 8
Express Bus Problem 9 3 • Halts only at 1,9,4. Total time: 75 min. • t19 + t94 = 75 • t19 < t15 + t56 + t69, t94 < t93 + t94 4 6 5 Ordinary Route with end-to-end time = 90 1
Errors in Data 9 3 • What if end-to-end time is given as 900 because of typing mistake? t15 + t56 + t69 + t93 + t34 + pR - nR= 900 pR, nR 0. Minimize pR + nR If rest of the data is error free, and many routes overlap, 900 will not matter. 4 6 5 Route R with end-to-end time = 90 1
Improving Preprocessing • Geographical data can be used in preprocessing phase. • If there are many optima in LP solution, can we find one with as few non-zeros as possible? “Chebyshev points”, Interior Point methods,
Summary • Heuristic. • Dirty, incomplete information • Errors might possibly still remain.
Local Trains • Estimate frequency from train timetable. • Bus-Train connection: Walking “Walk Bus” : Infinite Frequency, running time = time to walk. Central, Western, Harbour line, included in Mumbai Navigator.
Minimum Fare • Supported only in previous version. • Construct matrix A Aij = minimum fare for travel from i to j using any direct mode. • Run shortest path algorithm using A as distance matrix.
Current Status • Available at www.cse.iitb.ac.in/~navigator • 100,000 hits per year, 250 per day. • Plans appear to be generally good. • Media exposure: Indian Express, Mumbai Doordarshan, Times of India, India Today. • Very positive comments from site visitors.
Maps • Google map, superimposed with stops. • Stops can be selected from map, plans can be shown on map. • Some problems: Google map API has not been stable • Map loading time might be large
Future • SMS support • City directory…
Credits • Mayur Datar • Kaustubh Tilak • M. Srikrishna • Amit Kotwal • Ruta Mehta • Sheetal Sonare • Alok Jadhav