Mumbai Navigator - Tata Institute of Fundamental Research

Download Report

Transcript Mumbai Navigator - Tata Institute of Fundamental Research

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.
Origin = x
Program
Destination = y
Bus/Train Schedules
6:32 train from z
to w.
7:15 train from w
to y.”
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
…
Destination
u
…
…
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-tostop 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
1
 R( B)
F ( B)
B
Destination
Origin
B1
Destination
R( B1 ) F ( B1 )  R( B2 ) F ( B2 )
1

F ( B1 )  F ( B2 )
F ( B1 )  F ( B2 )
B2
Destination
Origin
B1
SubPlan 1
Expected time T1
B2
Subplan 2
Expected time T2
F ( B1 ){R( B1 )  T1}  F ( B2 ){R( B2 )  T2}
1

F ( B1 )  F ( B2 )
F ( B1 )  F ( B2 )
Construction of Optimal Plans
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
Relevant Buses
398
Running Time
120 min
Frequency
Every 5 min
L1
80 min
Every 30 min
Possible Plans
Bor
398
Mul
5 + 120
Bor
L1
Mul
30 + 80
Bor
398
Mul
L1
Mul
1
120  51  80  301

1
1
5  30
51  301
= 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:
1. Sort by running time:
R1  R2  ...  Rn
2. Compute: Waiting time, running time for first i
1
buses
 Ri Fi
Fi * 
, Ri* 
 Fi
 Fi
3. Find j s.t.
4. Use buses 1..j
R j 1
1
*


R
j
Fj*
k change plans from
k-1 change plans.
Special case: Only one bus B through origin stop S.
S
Start of route B
S1
S2
S3
Can only choose where to get off
S
B
S
S
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
S
t Start of B2
a
Start of B1
S
S11
S12
S13
Can wait for B1, get off at optimal stop.
Can wait for B2, get off ..
Can wait for either B1 or B2….
Plan Construction Summary
• Inductive construction of plans. Dynamic
Programming.
• How to compose plans
• Data structures, computation order etc. to
get high efficiency.
Preprocesing Phase
Problem Definition
• Input: End-to-end time for each route
• Output: Time between consecutive stops
Idea 1: Time between consecutive stops
End-to-end time for route

Number of stops on route
Example
• End-to-end-time for 398ltd. = 90 min
• Number of stops
= 45
• Stop-to-stop time
= 2 min
• End-to-end for 521ltd.
• Number of stops
• Stop to stop time
• What if routes overlap?
= 180 min
= 60
= 3 min
Idea 2
• Let tij = running time from stop i to stop j
(consecutive on some route)
9
5
1
6
3
4
Route with end-to-end time = 90
• t15 + t56 + t69 + t93 + t34 = 90
• Formulate for each route. Find consistent
solution.
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
5
1
6
3
4
Ordinary Route with
end-to-end time = 90
• Halts only at 1,9,4. Total time: 75 min.
• t19 + t94 = 75
• t19 < t15 + t56 + t69,
t94 < t93 + t94
Errors in Data
9
5
1
6
3
4
Route R with
end-to-end time = 90
• 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.
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.
Miscellaneous Issues
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
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