Approximating the Canadian Traveller Problem with Online Randomization


In this paper, we study online algorithms for the Canadian Traveller Problem defined by Papadimitriou and Yannakakis in 1991. This problem involves a traveller who knows the entire road network in advance, and wishes to travel as quickly as possible from a source vertex s to a destination vertex t, but discovers online that some roads are blocked (e.g., by snow) once reaching them. Achieving a bounded competitive ratio for the problem is PSPACE-complete. Furthermore, if at most k roads can be blocked, the optimal competitive ratio for a deterministic online algorithm is \(2k+1\), while the only randomized result known so far is a lower bound of \(k+1\). We show, for the first time, that a polynomial time randomized algorithm can outperform the best deterministic algorithms when there are at least two blockages, and surpass the lower bound of \(2k+1\) by an o(1) factor. Moreover, we prove that the randomized algorithm can achieve a competitive ratio of \(\big (1+ \frac{\sqrt{2}}{2} \big )k + \sqrt{2}\) in pseudo-polynomial time. The proposed techniques can also be exploited to implicitly represent multiple near-shortest s-t paths.

This is a preview of subscription content, access via your institution.

Fig. 1
Fig. 2
Fig. 3
Fig. 4


  1. 1.

    Due to space limit, the value of each \(D_E(\overrightarrow{(u,v)})\) is shown: \(D_E(\overrightarrow{(s,v_1)})=\{ 14,15,16 \}\), \(D_E(\overrightarrow{(s,v_2)})=\{ 14,15,16 \}\), \(D_E(\overrightarrow{(s,v_3)})=\{ 15,18,19 \}\); \(D_E(\overrightarrow{(v_1,s)})=\{ 19,20,21 \}\), \(D_E(\overrightarrow{(v_1,v_2)})=\{ 11,12,13 \}\), \(D_E(\overrightarrow{(v_1,v_4)})=\{ 9,10,11 \}\), \(D_E(\overrightarrow{(v_1,v_5)})=\{ 9,10,11 \}\); \(D_E(\overrightarrow{(v_2,s)})=\{ 18,19,20 \}\), \(D_E(\overrightarrow{(v_2,v_1)})=\{ 10,11,12 \}\), \(D_E(\overrightarrow{(v_2,v_3)})=\{ 11,14,15 \}\), \(D_E(\overrightarrow{(v_2,v_5)})=\{ 12,13,14 \}\), \(D_E(\overrightarrow{(v_2,v_6)})=\{ 10,13,14 \}\); \(D_E(\overrightarrow{(v_3,s)})=\{ 20,21,22 \}\), \(D_E(\overrightarrow{(v_3,v_2)})=\{ 12,13,14 \}\), \(D_E(\overrightarrow{(v_3,v_6)})=\{ 9,12,13 \}\); \(D_E(\overrightarrow{(v_4,v_1)})=\{ 13,14,15 \}\), \(D_E(\overrightarrow{(v_4,v_5)})=\{ 5,6,7 \}\), \(D_E(\overrightarrow{(v_4,t)})=\{ 6,12,14 \}\); \(D_E(\overrightarrow{(v_5,v_1)})=\{ 14,15,16 \}\), \(D_E(\overrightarrow{(v_5,v_2)})=\{ 18,19,20\}\), \(D_E(\overrightarrow{(v_5,v_4)})=\{ 6,7,8 \}\), \(D_E(\overrightarrow{(v_5,v_6)})=\{ 5,8,9 \}\), \(D_E(\overrightarrow{(v_5,t)})=\{ 4,10,12 \}\); \(D_E(\overrightarrow{(v_6,v_2)})=\{ 17,18,19 \}\), \(D_E(\overrightarrow{(v_6,v_3)})=\{ 15,18,19 \}\), \(D_E(\overrightarrow{(v_6,v_5)})=\{ 6,7,8 \}\), \(D_E(\overrightarrow{(v_6,t)})=\{ 3,9,11 \}\); \(D_E(\overrightarrow{(t,v_4)})=\{ 11,12,13 \}\), \(D_E(\overrightarrow{(t,v_5)})=\{ 8,9,10 \}\), \(D_E(\overrightarrow{(t,v_6)})=\{ 6,9,10 \}\). Note that for a directed edge (uv), \(D_E(\overrightarrow{(u,v)}) = \{ \ell + d(u,v) \mid \ell \in D_V(v)\}\).


  1. 1.

    Bar-Noy, A., Schieber, B.: The Canadian traveller problem. In: Proc. of the 2nd ACM-SIAM Symposium on Discrete Algorithms (SODA), (1991), pp. 261–270

  2. 2.

    Ben-David, S., Borodin, A.: A new measure for the study of online algorithms. Algorithmica 11(1), 73–91 (1994)

    MathSciNet  Article  Google Scholar 

  3. 3.

    Bender, M., Westphal, S.: An optimal randomized online algorithm for the \(k\)-Canadian traveller problem on node-disjoint paths. J. Combin. Optim. 30(1), 87–96 (2015)

    MathSciNet  Article  Google Scholar 

  4. 4.

    Bergé, P., Hemery, J., Rimmel, A., Tomasik, J.: The competitiveness of randomized strategies for Canadians via systems of linear inequalities. In: Proc. of 32nd International Symposium on Computer and Information Sciences (ISCIS) (2018), Springer, pp. 96–103

  5. 5.

    Bergé, P., Hemery, J., Rimmel, A., Tomasik, J.: On the competitiveness of memoryless strategies for the \(k\)-Canadian traveller problem. In: Proc. of 12th International Conference on Combinatorial Optimization and Applications (COCOA) (2018), LNCS 11346, pp. 566–576

  6. 6.

    Borodin, A., El-Yaniv, R.: Online computation and competitive analysis. Cambridge University Press, Cambridge (1998)

    MATH  Google Scholar 

  7. 7.

    Carlyle, W.M., Wood, R.K.: Near-shortest and \(k\)-shortest simple paths. Networks 46(2), 98–109 (2005)

    MathSciNet  Article  Google Scholar 

  8. 8.

    Dijkstra, E.W.: A note on two problems in connexion with graphs. Numer. Math. 1(1), 269–271 (1959)

    MathSciNet  Article  Google Scholar 

  9. 9.

    Eppstein, D.: Finding the \(k\) shortest paths. SIAM J. Comput. 28(2), 652–673 (1998)

    MathSciNet  Article  Google Scholar 

  10. 10.

    Eppstein, D.: \(k\)-Best enumeration. Encyclopedia of Algorithms. Springer, pp. 1–4. (2014)

  11. 11.

    Fried, D., Shimony, S.E., Benbassat, A., Wenner, C.: Complexity of Canadian traveler problem variants. Theor. Comp. Sci. 487(27), 1–16 (2013)

    MathSciNet  Article  Google Scholar 

  12. 12.

    Frieder, A., Roditty, L.: An experimental study on approximating \(k\) shortest simple paths. ACM J Exp Algorithm 19(1), 1–5 (2014)

    MathSciNet  MATH  Google Scholar 

  13. 13.

    Hershberger, J., Maxel, M., Suri, S.: Finding the \(k\) shortest simple paths: a new algorithm and its implementation. ACM Trans. Algorithms 3(4), 45 (2007)

    MathSciNet  Article  Google Scholar 

  14. 14.

    Jaillet, P., Wagner, M.R.: Generalized online routing: new competitive ratios, resource augmentation, and asymptotic analyses. Oper. Res. 56(3), 745–757 (2008)

    MathSciNet  Article  Google Scholar 

  15. 15.

    Liao, C.S., Huang, Y.: Generalized Canadian traveller problems. J. Combinat. Optim. 29(4), 701–712 (2015)

    MathSciNet  Article  Google Scholar 

  16. 16.

    Liao, C.S., Huang, Y.: The Covering Canadian traveller problem. Theor. Comp. Sci. 530(17), 80–88 (2014)

    MathSciNet  Article  Google Scholar 

  17. 17.

    Kao, K.H., Chang, J.M., Wang, Y.L., Juan, J.S.T.: A quadratic algorithm for finding next-to-shortest paths in graphs. Algorithmica 61, 402–418 (2011)

    MathSciNet  Article  Google Scholar 

  18. 18.

    Karger, D., Nikolova, E.: Exact algorithms for the Canadian traveller problem on paths and trees. MIT Computer Science & Artificial Intelligence Lab, Technical report (2008)

  19. 19.

    Katoh, N., Ibaraki, T., Mine, H.: An efficient algorithm for \(k\) shortest simple paths. Networks 12(4), 411–427 (1982)

    MathSciNet  Article  Google Scholar 

  20. 20.

    Krasikov, I., Noble, S.D.: Finding next-to-shortest paths in a graph. Inf. Process. Lett. 92, 117–119 (2004)

    MathSciNet  Article  Google Scholar 

  21. 21.

    Lalgudi, K.N., Papaefthymiou, M.C.: Computing strictly-second shortest paths. Inf. Process. Lett. 63, 177–181 (1997)

    MathSciNet  Article  Google Scholar 

  22. 22.

    Papadimitriou, C.H., Yannakakis, M.: Shortest paths without a map. Theor. Comp. Sci. 84(1), 127–150 (1991)

    MathSciNet  Article  Google Scholar 

  23. 23.

    Psaraftis, H.N., Wen, M., Kontovas, C.A.: Dynamic vehicle routing problems: three decades and counting. Networks 67(1), 3–31 (2016)

    MathSciNet  Article  Google Scholar 

  24. 24.

    Shiri, D., Salman, F.S.: On the randomized online strategies for the \(k\)-Canadian traveler problem. J. Combinat. Optim. 38, 254–267 (2019)

    MathSciNet  Article  Google Scholar 

  25. 25.

    Shiri, D., Salman, F.S.: On the online multi-agent O-D \(k\)-Canadian Traveler Problem. J. Combinat. Optim. 34(2), 453–461 (2017)

    MathSciNet  Article  Google Scholar 

  26. 26.

    Sleator, D., Tarjan, R.E.: Amortized efficiency of list update and paging rules. Commun. ACM 28, 202–208 (1985)

    MathSciNet  Article  Google Scholar 

  27. 27.

    Westphal, S.: A note on the \(k\)-Canadian traveller problem. Inf. Process. Lett. 106, 87–89 (2008)

    MathSciNet  Article  Google Scholar 

  28. 28.

    Xu, Y.F., Hu, M.L., Su, B., Zhu, B.H., Zhu, Z.J.: The Canadian traveller problem and its competitive analysis. J. Combinat. Optim. 18, 195–205 (2009)

    MathSciNet  Article  Google Scholar 

  29. 29.

    Zhang, H., Xu, Y.F., Qin, L.: The \(k\)-Canadian Travelers Problem with communication. J. Combinat. Optim. 26(2), 251–265 (2013)

    MathSciNet  Article  Google Scholar 

Download references


The authors would like to thank anonymous referees for their helpful comments, as well as Dr. Fan Chung with UC San Diego, Dr. Kazuo Iwama with Kyoto University and Dr. Wing-Kai Hon with National Tsing Hua University for discussions on this work.

Author information



Corresponding author

Correspondence to Chung-Shou Liao.

Additional information

Publisher's Note

Springer Nature remains neutral with regard to jurisdictional claims in published maps and institutional affiliations.

An extended abstract of this paper appeared in the proceedings of the 41st International Colloquium on Automata, Languages, and Programming (ICALP 2014). This work was partially supported by MOST Taiwan under Grants MOST105-2628-E-007-010-MY3, MOST105-2221-E-007-085-MY3, and JSPS KAKENHI 23240002.

Rights and permissions

Reprints and Permissions

About this article

Verify currency and authenticity via CrossMark

Cite this article

Demaine, E.D., Huang, Y., Liao, CS. et al. Approximating the Canadian Traveller Problem with Online Randomization. Algorithmica 83, 1524–1543 (2021).

Download citation


  • Canadian traveller problem
  • Competitive ratio
  • Randomized algorithm
  • Next-to-shortest path
  • Strictly ith-shortest path