# Mumbai Navigator by R7OqsR

VIEWS: 9 PAGES: 40

• pg 1
```									       Mumbai Navigator
“How to commute using delay prone buses”

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          6:32 train from z
Destination = y                         to w.
7:15 train from w
to 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”
“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
B3                       B4

w                                     u

…            …                      …          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
1
B                               R( B)
F ( B)

Destination
1            R( B1 ) F ( B1 )  R( B2 ) F ( B2 )

Origin
F ( B1 )  F ( B2 )           F ( B1 )  F ( B2 )

B1           B2
Destination         Destination
Origin

B1                       B2

SubPlan 1                         Subplan 2
Expected time T1                  Expected time T2

1            F ( B1 ){R( B1 )  T1}  F ( B2 ){R( B2 )  T2 }

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    Running Time   Frequency
398               120 min        Every 5 min

L1                80 min         Every 30 min
Possible Plans
Bor       Bor                    Bor
398        L1            398           L1
Mul        Mul        Mul                  Mul

5 + 120   30 + 80       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
buses          F    * 1
,R 
R F
*     i       i

F          F
i                i
i             i

3. Find j s.t.                 1
R j 1          R*
j
F j*
4. 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        Optimal k-1             Optimal k-1
Change plan        Change plan             Change plan
From S1 to         From S2 to              From St to
Destination        Destination             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
S                                      S12
S11
t Start of B2     S
a
Can wait for B1, get off at optimal stop.
Start of B1          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.     = 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)
9           3
6                                     4
5           Route with end-to-end time = 90
1
• 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              3
6                              4
5           Ordinary Route with
1                 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              3
6                                4
5           Route R with
1                  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