Research Article

A Gradual Approach for Multimodel Journey Planning: A Case Study in Izmir, Turkey

Algorithm 1

Finding routes containing one transfer.
Inputs: origin, origin line , ,
for each node n in Graph:
-n.dist  ≔ infinity;
-n.previous  ≔ undefined;
origin.dist  ≔  0;
Q  ≔ Priority queue according to distance;
enqueue origin into Q;
while Q.isEmpty != true:
-u  ≔ node with min distance in Q;
-remove u from Q;
-for each outbound edge e of node u:
--v  ≔ node reachable from u with edge e;
--e.weight  ≔ infinity;
--if e.Line  :
---if u.previous != null: prev_e  ≔ edge used for reaching to u
----if prev_e.Line    :
-----if e.Line = prev_e.Line: e.weigth  ≔  ;
----else
-----if e is a line:
------if e reaches a destination stop: e.weigth  ≔  ;
------else if e.Line = prev_e.Line:  e.weigth  ≔  ;
-----else if e is foot-edge: e.weigth  ≔  ;
---else//u.previous = null:
----if e.Line is : e.weigth  ≔  ;
-for each outbound edge e of node u:
--v  ≔  node reachable from u with edge e;
--dist_v  ≔  u.dist + e.weigth;
--if dist_v < v.dist:
---dequeue v from Q with key v.dist;
---v.dist  ≔  dist_v;
---v.previous  ≔ u;
---enqueue v into Q with key v.dist;
S  ≔  empty sequence
u  ≔  target
while u.previous is not null:
-insert u into S;
-u  ≔  u.previous;