Programming and Computer Software

, Volume 30, Issue 4, pp 188–203 | Cite as

Traversal of an Unknown Directed Graph by a Finite Robot

  • I. B. Bourdonov


A covering path in a directed graph is a path passing through all vertices and arcs of the graph, with each arc being traversed only in the direction of its orientation. A covering path exists for any initial vertex only if the graph is strongly connected, i.e., any of its vertices can be reached from any other vertex by some path. The strong connectivity is the only restriction on the considered class of graphs. As is known, on the class of such graphs, the covering path length is Θ(nm), where n is the number of vertices and m is the number of arcs. For any graph, there exists a covering path of length O(nm), and there exist graphs with covering paths of the minimum length Ω(nm). The traversal of an unknown graph implies that the topology of the graph is not a priori known, and we learn it only in the course of traversing the graph. At each vertex, one can see which arcs originate from the vertex, but one can learn to which vertex a given arc leads only after traversing this arc. This is similar to the problem of traversing a maze by a robot in the case where the plan of the maze is not available. If the robot is a “general-purpose computer” without any limitations on the number of its states, then traversal algorithms with the same estimate O(nm) are known. If the number of states is bounded, then this robot is a finite automaton. Such a robot is an analogue of the Turing machine, where the tape is replaced by a graph and the cells are assigned to the graph vertices and arcs. Currently, the lower estimate of the length of the traversal by a finite robot is not known. In 1971, the author of this paper suggested a robot with the traversal length O(nm + n2log n). The algorithm of the robot is based on the construction of the output directed spanning tree of the graph and on the breadth-first search (BFS) on this tree. In 1993, Afek and Gafni [1] suggested an algorithm with the same estimate of the covering path length, which was also based on constructing a spanning tree but used the depth-first search (DFS) method. In this paper, an algorithm is suggested that combines the breadth-first search with the backtracking (suggested by Afek and Gafni), which made it possible to reach the estimate O(nm + n2loglog n). The robot uses a constant number of memory bits for each vertex and arc of the graph.


Span Tree Direct Graph Lower Estimate Minimum Length Turing Machine 
These keywords were added by machine and not by the authors. This process is experimental and the keywords may be updated as the learning algorithm improves.


Unable to display preview. Download preview PDF.

Unable to display preview. Download preview PDF.


  1. 1.
    Afek, Y. and Gafni, E., Distributed Algorithms for Unidirectional Networks, SIAM J. Comput., 1994, vol. 23, no. 6, pp. 1152–1178.Google Scholar
  2. 2.
    Hoffman, D. and Strooper, P., ClassBench: A Framework for Automated Class Testing, Software Maintenance: Practice Experience, 1997, vol. 27, no. 5, pp. 573–579.Google Scholar
  3. 3.
    Murray, L., Carrington, D., MacColl, I., McDonald, J., and Strooper, P., Formal Derivation of Finite State Machines for Class Testing, Lecture Notes Comput. Sci. (Proc. of the 11th Int. Conf. of Z Users), Berlin: Springer, 1998, vol. 1493, pp.42–59.Google Scholar
  4. 4.
    Albers, S. and Henzinger, M.R., Exploring Unknown Environments, SIAM J. Comput.,2000, vol. 29, no. 4, pp. 1164–1188.Google Scholar
  5. 5.
    Deng, X. and Papadimitriou, C.H., Exploring an Unknown Graph, J. Graph Theory, 1999, vol. 32, no. 3, pp.265–297.Google Scholar
  6. 6.
    Ore, O., Theory of Graphs, Providence: AMS, 1962. Translated under the title Teoriya grafov, Moscow: Nauka, 1968.Google Scholar
  7. 7.
    Bhatt, S., Even, S., Greenberg, D., and Tayar, R., Traversing Directed Eulerian Mazes, Proc. of WG'2000,Brandes, U. and Wagner, D., Eds., Lecture Notes in Computer Science, vol. 1928, pp. 35–46, Berlin: Springer,2000.Google Scholar
  8. 8.
    Blum, M. and Sakoda, W.J., On the Capability of Finite Automata in 2 and 3 Dimensional Space, Proc. of the Eighteenth Annu. Symp. on Foundations of Comput. Sci., 1977, pp. 147–161.Google Scholar
  9. 9.
    Even, S., Graph Algorithms,Comput. Sci., 1979.Google Scholar
  10. 10.
    Even, S., Litman, A., and Winkler, P., Computing with Snakes in Directed Networks of Automata, J. Algorithms, 1997, vol. 24, pp. 158–170.Google Scholar
  11. 11.
    Rabin, M.O., Maze Threading Automata. Lecture Presented at MIT and UC Berkley, 1967.Google Scholar
  12. 12.
    Bourdonov, I.B., Study of the Automaton Behavior on Graphs, MS Dissertation, Moscow: Moscow State University, 1971.Google Scholar
  13. 13.
    Kobayashi, K., The Firing Squad Synchronization Problem for a Class of Polyautomata Networks, J. Comput. System Sci., 1978, vol. 17, pp. 300–318.Google Scholar
  14. 14.
    Kutten, S., Stepwise Construction of an Efficient Distributed Traversing Algorithm for General Strongly Connected Directed Networks, Proc. of the Ninth Int. Conf. on Comput. Commun., 1988, pp.446–452.Google Scholar
  15. 15. Scholar
  16. 16.
    Bourdonov, I., Kossatchev, A., Petrenko, A., and Gatter, D., KVEST: Automated Generation of Test Suites from Formal Specifications, Proc. of F0M'99, Lecture Notes in Computer Science, vol. 1708, pp.608–621, Berlin: Springer, 1999.Google Scholar
  17. 17.
    Bourdonov, I.B., Kossatchev, A.S., and Kuliamin, V.V., Use of Finite Automata for Program Testing, Programmirovanie, 2000, no. 2, pp. 12–28.Google Scholar
  18. 18.
    Bourdonov, I., Kossatchev, A., Kuliamin, V., and Petrenko, A., UniTesK Test Suite Architecture, Proc. of FME 2002, Lecture Notes in Computer Science, Berlin: Springer, 2002, vol.2391, pp. 77–88.Google Scholar
  19. 19.
    Bourdonov, I.B., Kossatchev, A.S., and Kuliamin, V.V.,Irredundant Algorithms for Traversing Directed Graphs: The Deterministic Case, Programmirovanie,2003, no. 5, pp.11–30.Google Scholar
  20. 20.
    Bourdonov, I.B., Kossatchev, A.S., and Kuliamin, V.V., Irredundant Algorithms for Traversing Directed Graphs: The Nondeterministic Case, Programmirovanie, 2004, no. 1, pp.4–24.Google Scholar

Copyright information

© MAIK “Nauka/Interperiodica” 2004

Authors and Affiliations

  • I. B. Bourdonov
    • 1
  1. 1.Institute for System ProgrammingRussian Academy of SciencesMoscowRussia

Personalised recommendations