You are on page 1of 8

Commuting with Delay Prone Buses

Mayur Datar Abhiram Ranade


Department of Computer S ien e, Department of Computer S ien e and Engg.,

Stanford University, Indian Institute of Te hnology Bombay,

Stanford, CA 94305, USA. Powai, Mumbai 400076, India.

E-Mail: datar s.stanford.edu. E-Mail: ranade se.iitb.ernet.in

Abstra t In this paper we present an algorithm for plan-


What is the fastest way to go from point X to point Y within a
ning travel under su h onditions. Our algorithm has
ity using its publi bus servi e, with bus hanges as ne essary? been implemented for the bus system of the ity of
If buses ran a ording to a s hedule this is an easy query { Mumbai. This is a fairly large bus system with the
it an be solved by using lassi al shortest path algorithms. following gures indi ating its size:
Unfortunately, as everyone knows, buses in most ities hardly
on rm to a xed s hedule. On e you get into a bus it usually
takes a predi table amount of time to rea h its destination, but
 There are 417 bus routes, with buses plying in
the amount of time you spend waiting for it is quite random both dire tions on most routes.
and an usually be estimated only statisti ally.  There are a total of 2018 bus stops in the ity.
We present an algorithm to generate travel plans for su h
onditions. Our plans allow a tions of the form "wait for buses  On the average there are 35 bus-stops on ea h
with route number R1,R2 ... if you get into R1 get o at ... route.
and wait for ..., else if you get into R2 ..." and are modelled  The number of buses stopping at ea h bus stop is
as a tree. We guarantee that the expe ted time taken by widely variable, with as many as 130 bus routes
the plan we generate will be minimum over all possible plans passing through some nodal points (Khodadad
for travel between the given starting point and destination. ir le in entral Mumbai).
The algorithm has been implemented for the bus system of
Mumbai, and it generates the (optimal) travel plan essentially Our program doesnt onsider other modes of publi
instantaneously. A trans ript of a session with the program is transport (su h as ommuter trains) available in the
in luded. ity, but these may be in luded fairly easily. Of
ourse, we expe t our algorithm to be useful for
1 Introdu tion planning travel in other ities also.
In this paper we onsider the onsumer side planning We note that generating minimum time travel
problem for a publi transport system: what is the plans would be an easy undertaking if buses/trains
fastest way to get from point X to point Y within a reliably adhered to their published s hedules (assum-
ity making (bus/train) hanges as ne essary. The ing su h s hedules are published in the rst pla e).
bus servi e and even other modes of ommuter trans- In that ase the problem would be solved by using a
port in many ities hardly runs a ording to a reliable standard shortest path algorithm with minor modi-
predetermined s hedule (de nitely not in Mumbai!). ations. Su h programs are ommon on the Eurail
This is be ause of various fa tors su h as traÆ jams network. However, with unpredi table waiting times
and breakdowns. On e you get into a bus it usually the problem is substantially more omplex, as will be
takes a predi table amount of time to rea h its des- seen from the following example.
tination, but the amount of time you spend waiting Consider a fragment of a bus network as shown
for it is quite random and an usually be estimated in Figure 1. Suppose we wish to travel from to
X Y

only statisti ally. whi h fall on the route of bus 1 . Suppose 1 runs
B B

approximately every 30 minutes, and takes about 60


 This work was done while the author was at IIT Bombay. minutes to travel between and . Suppose that
X Y
,
B1 B2 ,
B1 B3 Se tion 6. In Se tion 3 we des ribe the algorithm
X Z Y for generating travel plans. Our algorithm requires a
database des ribing the details of the bus system su h
as frequen y of ea h bus route, the stops on ea h bus
Figure 1: A sample bus network route and the running time between onse utive stops
on the route. Unfortunately the bus ompany did not
there is a bus 2 that runs from X to whi h is
B Z
supply us data this detailed. In parti ular, the bus
midway between and whi h runs about on e
X Y
ompany only gave us estimates of the end-to-end
every 5 minutes, and there is a bus 3 whi h runs B
running times for ea h bus route, from whi h we had
from to , also on e every 5 minutes. What is the
Z Y
to infer the running time between onse utive stops
best travel plan to go from to ? If we opted for
X Y
on ea h route. The strategies we used for generating
bus 1 alone, the expe ted time would be about 75
B
the detailed data are des ribed in Se tion 4.
minutes (15 minutes of waiting time1 and 60 minutes
of running time). If we opted for bus 2 followed Se tion 7 sket hes possible extensions to our
work.
B

by 3 , the time would be 65 minutes (2.5 minutes


B

waiting time and 30 minutes of running time for both


B 2 and 3 ). However, the se ond strategy alone is
B 2 Model and Notation
also learly suboptimal. The best strategy in this
ase is \Wait at for either 1 or 2 . If you get For the rest of this paper the term bus route will mean
a unidire tional sequen e of bus stops. Ea h bus
X B B

1 , ne; if you get 2 go to and wait there for 1


route is asso iated with a frequen y ( ); arrivals
B B Z B

or 3 ." Finding su h plans is learly more omplex b F b

of a bus on route are assumed Poisson distributed


B

than nding standard shortest paths. b

with expe ted time between arrivals being 1 ( ). =F b


This paper makes two main ontributions. First, We assume that the frequen y of ea h route is known
a model is presented in whi h travel plans are rep- to us.
resented as trees. The details of this are des ribed
later; however we note that for the above example, We assume that on e you get into a bus its
we would have three trees (asso iated with the three movement happens predi tably. In parti ular, if s

plans: (i) Take 1 , (ii) Take 2 and then 3 , and and are onse utive bus stops on one or more routes,
t

then all su h buses take time ( ) to travel between


B B B

(iii) Take whi hever of 1 or 2 that omes rst, and R s; t

them. We assume we know ( ) for all pairs of


B B

then take 3 if ne essary). With ea h su h tree our R s; t

stops that happen to be onse utive on some route.


B

model asso iates a ost whi h is simply the expe ted


travel time (in luding the waiting time) were the plan We negle t the time buses wait at stops although it
asso iated with the tree to be followed. Finding the an be easily in orporated in the travel time ( ) R s; t

fastest plan to go from point X to point Y is equiva- where is where the bus stops while is the next
s t

lent in our model to nding the least ost tree from stop on its route. Let 1 2 be a sequen e of
s ; s ; : : : ; sk

the set of trees orresponding to all the plans for trav- onse utive bus stops on a route . The time to go b

elling between X and Y. Our se ond ontribution is a from 1 to having already got into bus is denoted
s sk b

polynomial time algorithm for nding the least ost as ( 1 ) and is of ourse:
R b s ; sk

tree. We have implemented the algorithm for the bus X1


system of the ity of Mumbai. On standard work-
k

( )= ( )
stations it gives optimal plans se onds after the user
R b s1 ; sk R si ; si+1

i=1
types in the starting and ending points.
We note that ( 1 ) need not equal 0 ( 1 ) if
R b s ; sk Rb s ; sk

and 0 do not halt at the same stops between 1 and


b b s
1.1 Overview
. sk

We begin by des ribing our model for bus routes in the We model travel plans as trees. Ea h node u

and travel plans in Se tion 2. A detailed ritique tree has a label ( ) whi h must be a bus S u

of the model and possible extensions appears in stop. Ea h edge ( ) has a label ( ) whi h is
u; v B u; v

a bus route that passes through stops ( ) and ( ) S u S v

in that order (not ne essarily onse utively). Further


1 This really depends upon the distribution of bus arrivals. we require that the root must be labelled with the
origin stop, and every leaf with the destination stop. stop. Of ourse, height 0 plans are trivially available:
The a tion indi ated by a tree node having hildren the destination stop an be rea hed (without taking
u

is:
v ; v ; : : : ; vk
1 2 any bus) only from the destination stop itself. We
des ribe below the pro ess of generating optimal
Wait at stop ( ) for buses height plans given optimal height 1 plans.
S u h h

( 1) ( 2)
B u; v ; B u; v ( ). If bus
; : : : ; B u; vk
We rst need the notion of a bus restri ted plan.
( ) is the rst to arrive, then take it
B u; vi
A bus restri ted plan is also a tree similar to an
to stop ( ). Then exe ute the a tion
S vi
ordinary plan, ex ept the root has only one outgoing
indi ated by .
r
vi
edge going to some node . There is also a di eren e u

as far as the pre ondition and the a tion asso iated


The plan exe ution begins at the root and follows with the root. In parti ular, the plan an be invoked
a path to a leaf depending upon whi h buses arrive only after the user is already aboard a bus of route
rst. ( ) at stop ( ). The expe ted time for a bus
B r; u S r

restri ted plan is thus ( ) ( ) + ( ), where RB r;u r; u T u

2.1 Expe ted time of a plan ( ) an be evaluated as given in Se tion 2.1.


T u

It should be lear that the expe ted time taken by Let ( ) denote the expe ted time to rea h
a plan an be evaluated re ursively, sin e subtrees of the destination from stop using an optimal height
T s; h

a given plan tree are themselves plan trees. Let ( ) plan. Let ( ) denote the expe ted time to rea h
s
T u

denote the expe ted time to rea h the destination the destination using a bus restri ted plan of height
h Tb s; h

starting at node in the tree.


u
whi h starts in bus at stop . Our algorithm
h b s

Let be the root of the plan tree, and 1


r works on the basis of the relationships between these
v ; : : : ; vk

the hildren of the root. Let = ( ). Then we quantities.


bi B r; vi

note that First observe that if you are already in bus at b

stop , the optimal height bus restri ted plan will


s h

either (i) be the same as the optimal height 1


( ) = P 1 ( ) + P ( () ) ( i ( ) + ( )) bus restri ted plan, or (ii) require you to get down
X F bi
h

T r Rb r; vi T vi
i
F bi
i i at some bus stop following on the route of and
F bi
si s b

follow the optimal height 1 plan from there. Thus h

The rst term in the time is simply the waiting we get:


time: be ause bus arrivals are Poisson distributed we
see a ombined frequen y whi h is simply the sum of (3.1)
the frequen ies of the buses that we are waiting for. ( ) = Tb s; h

The se ond term gives the time after we get into some min( ( 1) minf ( ) + ( 1)g)
Tb s; h ; Rb s; si T si ; h
bus. Suppose bus is the rst to arrive, then the
bi
i

time taken will be i ( 1 )+ ( ). But this happens


Rb r; v T vi
The se ond observation is that a height plan
with probability proportional to the frequen y ( ), starting at stop an only onsist of waiting for some
F bi
h

hen e the weighting fa tor in the expression above. set of buses , and having got into one of these buses B
s

De ne the height of a plan as the height of the 2 , following the orresponding bus restri ted plan
b B
asso iated tree; the height is simply the maximum of height . Let denote the set of the buses passing h Bs
number of bus trips used in any exe ution of the plan. through stop . Then we have: s

3 Finding an optimal plan


( )= T s; h

Given the origin stop and the destination stop our 1 X ( )


!
algorithm nds an optimal plan of height , where min P + P ( ) F b

2 () 2 2 ()
H
 s
Tb s; h
H is a parameter set by the user. We do this B B
b B
F b
b B b B
F b

by dynami programming, su essively onstru ting


optimal height plans (if any) in the order =
h The rst term represents the time spent waiting
h

01
; . For = 0 1
;::: ;H h 1 we onstru t for the buses, and the se ond the expe ted time spent
; ;::: ;H

optimal plans to rea h the destination from every bus exe uting the bus restri ted plans.
The key question then is how to nd the subset x; y; a; q; r , we see that:
. Naively, it would seem that we need to expli - P
1 +P 2 ( )
B

itly onsider all possible olle tions of buses passing b B


F b Tb

through { whi h would require


(2j sj ) work. As
s
B
2P ( ) b

B
F b

the following lemma shows, we an get by with just 1 + 2 ( )  + ( 1)


(j j log j j).  P b B
F b Tb F bi Tbi

2 () + ( 1)
O Bs Bs
F b F bi
b B
P 

Let Bs = fb1 ; b2 ; : : : ; bm g denote the


 1 + P2 ( () ) ++ (( 1)) b B
F b Tb F bi Tbi 1
Lemma 3.1.
2 1 F b F bi
set of buses passing through stop s. Let Tbi =
b B

Tbi (s; h). Without loss of generality let Tb1  Tb2  sin e i  i 1 . But the right hand side is simply
Tb Tb
: : :  Tbm . Let the time for the plan involving waiting for the buses
in [f 1 g. Thus we may assume that the optimal
B bi

= 1 X
i
( ) plan involves waiting for buses 1 through for some b bk

Ti Pi + Pi
F bj
Tbj .
( ) ( )
k
F bj F bj
j =1 j =1 j =1

Part 2: Suppose k > l . We show that T


  T .

In other words, T is the expe ted time if we wait for We rst des ribe the intuition behind the argument
k l

for the ase = + 1. We know that the time


i
buses b1 ; : : : ; bi at stop s, and thereafter follow the k l

orresponding optimal bus restri ted height h plans. Tb l+1 needed to nish the journey even after +1 has bl

Let l be smallest su h that Tl  Tbl+1 . Then it already arrived is no less than the expe ted waiting
suÆ es to wait for buses b1 ; : : : ; bl , and ignore the and travelling time  if we wait for 1 . Thus
T b ; : : : ; bl

it annot help to take bus +1 even if it arrives


l

other buses even if they arrive rst. In other words: bl

earliest. In general:
( )=  Pk
 = 1 +P ( )
T s; h Tl


F b j Tbj
j =1
Tk
=1 ( ) k
j
F bj

Proof. The proof is based on the following two ideas. P


1 + =1 ( ) j + l+1 l
P
( )

k

First, if an optimal plan involves waiting at for bus s


P
j
P
= +1 F b j Tb Tb
j l
F bj

bi, then it must also involve waiting for bus 1 . In bi ( ) + = +1 ( ) l


F bj
k
F bj
other words, suppose that the optimal height plan h
=1 j j l

involves waiting for a set of buses at stop . Then B s Sin e l+1  l+2   k . But for positive
Tb Tb ::: Tb

B an only be of the form = f 1 g for some B b ; : : : ; bk numbers we know that


w; z; x; a; q; y

(proved in Part 1 below). After this we just need


 ++ and  =) 
k

to argue that  takes its minimum value for = ,


Tk k l
w x aq
a
x w x

with as de ned in the Lemma statement. (Part 2


l
z y q y z y

below). Thus we get:


Part 1: Suppose 2 but 1 2 . Sin e waiting
bi B bi = B 1+ ( )
Pk
F b j Tbj
for the buses in at is optimal we know that:
j =1
Pk
B s
( ) F bj

P (3.2) =1
P
j

1+ b2B
() 1+ ( ) l

 P =1
F b Tb F b j Tbj
j
P
2 P( ) ( ) l
F b F bj
b B =1 j

1+ ()
 P 2 f ig ( )
F b Tb

by hoosing:
b B b

2 f ig 
b B b
F b
P
1+ 2 ( )  ( ) = 1P+ =1 ( )
Pk
=
F b Tb F b i Tbi w F b j Tbj
b B
P j

2 () ( ) b B
F b F bi z = =1P ( ) k
j
F bj

x = 1 + =1 ( ) l
F b j Tbj

 =) 
j

Noting that x
y
x
y
aq
q
x
y
x+ar
y +r
for positive a = l+1Tb
Pk
q = Pjl =l+1
( )P
F bj We note that even in theory the maximum value
y = F bj( ) + = +1 ( ) k
of is ertainly no more than the number of bus
F bj H
j =1 j l
routes; hen e the optimal travel plan (with un-
bounded ) an be omputed in polynomial time. H

and observing that = l+1  = . But (3.2) However, in pra ti e we note that the maximum num-
a Tb T x=y

simply asserts    . In a similar manner we an ber of bus hanges a traveller might tolerate would be
l
T T

show that this holds even for


k
.
l
small, say 2-3 at most.
k < l

3.1 Algorithm Exe ution Time Analysis 4 Prepro essing

The bus ompany (Bombay Ele tri Supply and


Our algorithm for generating height plans given Transport (BEST)) gave us the following data:
h

height 1 plans is as follows.


h

1. List of stops on ea h route in order.


1. The times for the bus restri ted plans are gen-
erated rst, using equation 3.1. For ea h bus 2. Frequen y of ea h bus route. In the notation of
route , these are best omputed in reverse order
b
the previous se tion, this is ( ) for route . F b b

of the stops on route ; if and +1 are on- 3. End-to-end travel time for ea h bus route. If the
b si si

se utive bus stops on the route, it follows from stops on a route P are 1 2 , then we are b s ; s ; : : : ; sk
equation 3.1 that given the value of =11 ( +1 ). k
j
R sj ; sj

(3.3) 4. Stage length data. For the purpose of al ulat-


( )
Tb si ; h ing fares, BEST marks some of the stops on ea h
= min( ( 1) ( +1 ) + ( +1 ))
T b si ; h route as stage boundary stops. BEST has infor-
; R b si ; s i Tb si ;h
mation about the length of ea h stage, i.e. the
Thus the bus restri ted plans for ea h bus and distan e between onse utive boundary stops. In
any starting stop on its route are omputed in other words, if and 0 are su essive stage sg sg

time proportional to the number of stops on the boundary stops on the route of bus and if b

route. ( +1 ) denotes the distan e between stops


d sj ; sj

and +1 , then we are given the values of


2. Next we determine in the manner des ribed
sj sj
P g0 1
in Lemma 3.1. For this, the buses stopping
B
= g
m
( +1 ), for all stages on all buses.s
j s
d sj ; sj

at must rst be arranged in in reasing order of For the algorithm des ribed in the last se tion, we
s

i(
Tb ). This an be done in time ( log ) need the values of ( ) for every pair of onse utive
s; h O m m

using sorting. Then all  an be al ulated in bus R s; t

time ( ). From this we an determine . The learstops and on every route . It should be
Ti
s t b

total time is thus ( log ) at ea h bus stop. inadequate for usdata


that the provided by BEST is grossly
O m l

O m m
to determine these values pre isely.
This des ription only onsiders the omputation of may The question then is: of all the possible values that
( ) and ( ); however it may be noted that supplied be assigned to ( ) onsistent with the data R s; t
Tb s; h T s; h

the orresponding plans an be re overed if auxiliary by BEST, whi h ones should we use?
data stru tures are maintained. Also, it will be We use a two phase approa h for doing this. In
noted that the auxiliary data stru tures an be the rst phase, we generate estimates for distan es
maintained without hanging the algorithm exe ution ( ) between onse utive bus stops d s; ton every s; t

time estimates given above. route. In the se ond phase, we generate estimates
Let denote the maximum number of buses for ( ). Both phases use linear programming.
C
R s; t

stopping at any bus stop. Let denote the sum of Generating distan e estimates: We onsidered
L

the lengths of all bus routes. Then the time for step it reasonable to assume that adja ent bus stops
1 above is ( ), and that for step 2 is ( log ). ouldnt be arbitrarily lose (say no loser than some
O L O L C

The time for the algorithm over all phases is thus parameter min), nor arbitrarily far apart (say no d

( log ).
O HL C farther than some parameter max). We initialized d
dmin and max to values whi h are learly orre t,
d Please give the name of sour e
e.g. 10 meters and 100 km respe tively. This gives $->i.i.t.market
us inequalities of the form min  ( )  max . We
d d s; t d
Please give the name of destination
$->vashibusstation
added these to the equations given under stage length A PLAN WITH 0 CHANGE OVERS
data above and he ked if resulting linear program Expe ted travel time :
was feasible. If the linear program was feasible, then 66.231911 = 30.500000(w) + 35.731911(r)
we narrowed the gap between min and max and tried
d d

again. In this manner, the feasible solution for the 1: i.i.t.market to vashibusstation by 710ltd.
losest min and max was found and sele ted as the
d d
A PLAN WITH 1 CHANGE OVERS
estimate. Expe ted travel time :
45.505608 = 1.108896(w) + 44.396713(r)
Generating time estimates: We onsidered it
reasonable to assume that bus speeds are bounded, 1: i.i.t.market to gandhinagar[kanjurmarg℄ by
say between min = 10 kmph and max = 60 kmph.
v v
459ltd., 409ltd., 425ltd., 403ltd., 460ltd.,
398ltd., 425, 461ltd., 445ltd., 424, 307,
This gives us inequalities of the form ( ) max 
d s; t =v 185, 422, 346ltd., 496ltd., 396ltd.
( )  ( ) min . As before we try to tighten
R s; t d s; t =v 2: gandhinagar[kanjurmarg℄ to vashibusstation
these bounds while ensuring that the linear program by 511ltd., 710ltd.
remains feasible. Then we use the solution obtained 1: i.i.t.market to hindustan o.[vikhroli-w℄ by
for tightest program possible { this orresponds to 336, 392
2: hindustan o.[vikhroli-w℄ to vashibusstation
saying that within a ity we dont expe t bus speeds by 511ltd., 710ltd.
to vary too mu h. We feel that this assumption is 1: i.i.t.market to vashibusstation by 710ltd.
reasonable in absen e of additional information.
Figure 2: Sample session with Mumbai Navigator
4.1 Problems due to data in onsisten ies

5 Implementation and Sample Output

It turned out that the data given to us by BEST We have oded the algorithm and strategies des ribed
also had in onsisten ies, i.e. the system of equations above (about 2500 lines of C). The user interfa e
given to us (without the inequalities we inserted) is urrently text-based, though a menu-driven Java
didnt have a solution. We tried to get these resolved implementation is also almost ready. The C version
by reporting them ba k to BEST and requesting has been tested substantially, and we plan to release
orre t data; however be ause of various reasons this it to general users shortly. Figure 2 shows a sample
didnt always work. So we had to resort to strategies session with the program, whi h we all Mumbai
to work around in onsisten ies. Navigator.
Our approa h was to in orporate an error vari- In the sample session the program is asked to
able into ea h equation. We then added in the in- plan a journey analogous to the example in Figure 1.
equalities as des ribed above and attempted to solve The journey is to start at I. I. T. Market and end
the resulting program, this time looking for a solution at Vashi Bus Station (typed by the user after the
with small total error. We looked at the individual prompt \$->"). The program an generate plans
error values and this on o asions alerted us to obvi- of arbitrary height, the output only shows plans of
ous and orre table errors in the data (e.g. the end height 1 (0 hangeovers) and height 2 (1 hangeovers).
to end timing for some route being an absurdly small For ea h plan the total travel time is given, as well
value). But in the end we were not able to orre t as its breakup into the waiting time for the rst bus
all errors and had to live with some in onsisten ies. and the time for the rest of the journey. Noti e the
We expe t that these are all teething troubles, soon relatively large waiting time in the 0 hange over plan
enough we will get onsistent data from BEST so that (30.5 miutes).
we dont have to worry about this issue.
The program print outs the generated plan tree
in a depth rst manner, with indentation to aid
readability. Some amount of ommon subexpression
elimination is also done. For example, if and v w
are the hildren of node in the plan tree with
u The operational reason for assuming Poisson
( ) = ( ), then we are guaranteed that the subtree
S v S w arrivals is that this provides a rule for estimating
beneath and are identi al. Thus in the printout,
v w waiting time when we are waiting for arrival of a bus
we only give one of the trees, say the one below , and
v on any of a given set of routes. If we an be given a
set the new label for ( ) to be the on atenation of
u; v suitable rule for estimating the waiting time for other
the old labels ( ) ( ).
B u; v ; B u; w distributions, we expe t that should be adequate for
Ea h step of the printed plan is of the form our purposes. We spe ulate that the ombining rule
for other distributions will be very similar to the one
i: stop1 to stop2 by busno1, busno2, ...
we use.
Our assertion that \it usually takes a predi table
Here indi ates the level number (root is 1). amount of time (for a bus) to rea h its destination
on e you have limbed aboard, but the amount of
i

Thus in the plan shown, there are 3 lines indi ating


the a tion at the root: wait for buses 459 ltd. through time you spend waiting for it is random" is also an
396 ltd, buses 336 or 392, or bus 710 limited. If you engineering approximation. A bus maybe delayed
get into bus 710 (last line) you an dire tly take it when it is not travelling (i.e. between trips) be ause
to Vashi Bus Station. If you get into one of the of delays in arrival of drivers et . However, traÆ
buses 459 limited through 396 limited, then hange jams and su h will delay buses also while travelling.
at Gandhinagar into buses 511 limited or 710 limited Note however, that the delay seen while waiting
whi h will take you to Vashi Bus Station. Else if at for a bus is the umulative delay (say from the
I.I.T.market you got into 336 or 392, you would take start of the day), while the in rease observed in the
it to Hindustan o and then hange to 511 limited or running time for single journey is the in remental
710 limited. delay experien ed in that portion of the journey
alone. Thus we expe t it to be small.2 Also note
Our program allows the users to dis ourage that su h delays will a e t every plan. Thus the
hangeovers by setting a parameter alled hangeover delays in urred while travelling will very likely not
penalty. This is simply the additional time deemed a e t the hoi e among di erent plans.
spent in making ea h hangeover. In the printout
shown the hange over penalty was set to 0. If for Our model glosses over some other details, but
example we set it to 22 minutes the program would these ould be modelled if we had more information.
have reje ted the plans involving a hangeover as sub- For example, our program assumes that you an
optimal, sin e in the present ase the time saved with always get into a bus when it arrives, i.e. it always
the hange over is less than 22 minutes. has spa e. This ould be modelled by using a
bus frequen y that was smaller than the published
In addition, the program in orporates features frequen y { the di eren e would have to depend upon
su h as bus stop name ompletition, so the valid your knowledge of how full the buses run. Further,
ompletions of whatever the user types are printed our program only has one frequen y asso iated with
by the program and sele ted if there is a unique ea h bus, whereas bus frequen ies drop o at non-
ompletion. peak hours. This ould be solved by having a di erent
database for peak and nonpeak hours. Another
6 A Critique of our basi model simpli ation made in our program is that if several
buses halt at a given bus stop, the physi al lo ations
Perhaps the most unfounded assumption in our (i.e. bus stop sheds) where they halt are the same,
model is that of Poisson arrivals of the buses. This is or at least loseby. This assumption is unlikely to
only an engineering approximation: the bus ompany be satis ed in several nodal bus stops. If we knew
learly must make e orts to keep buses on a route the pre ise shed stru ture then we ould model the
running reasonably regularly (with xed separation sheds as di erent logi al bus stops. The walking
between onse utive trips perhaps). Yet, ommuter time between sheds ould be modelled by a bus with
experien e shows that bus arrivals are hardly peri- in nite frequen y and running time the same as the
odi , a bus with oÆ ial frequen y 30 minutes often
does not arrive for an hour or longer, and o asion- 2 If su h delays are also Poisson distributed, we an a tually
ally, even two buses of the same route might arrive in in lude them in our model simply by adding a (stati ally
qui k su ession. predi table) term to ea h R(s; t).
time required to walk between the sheds.
7 Future Work

Our program ould be extended in several ways.


Other modes of transport need to be in luded.
Most ities (in luding the ity of Mumbai) have
several ommuter train lines, with the bus servi e also
serving train stations. A omplete journey planner
whi h in ludes trains and buses would be very useful.
Currently, our program does not onsider travel
ost. It would be useful to in lude this. For example,
ommon ommuter queries ould be: \Tell me the
heapest way to go to X from Y.", or \Tell me the
fastest way under Rs. 20". Or some ombination of
time and ost might also be minimized.
Our program only plans journeys between bus
stops. Thus a ommuter must know the name of
the bus stops near his origin and destination. It
would be very useful to provide a graphi al input
system in whi h the user indi ates the origin and the
destination on a map, and the system tells him the
bus stops. A omplete system would also have to be
knowledgible about landmarks in the ity.

You might also like