Hamiltonian Paths in the Square of a Tree

  • Jakub Radoszewski
  • Wojciech Rytter
Part of the Lecture Notes in Computer Science book series (LNCS, volume 7074)


We introduce a new family of graphs for which the Hamiltonian path problem is non-trivial and yet has a linear time solution. The square of a graph G = (V,E), denoted as G 2, is a graph with the set of vertices V, in which two vertices are connected by an edge if there exists a path of length at most 2 connecting them in G. Harary & Schwenk (1971) proved that the square of a tree T contains a Hamiltonian cycle if and only if T is a caterpillar, i.e., it is a single path with several leafs connected to it. Our first main result is a simple graph-theoretic characterization of trees T for which T 2 contains a Hamiltonian path: T 2 has a Hamiltonian path if and only if T is a horsetail (the name is due to the characteristic shape of these trees, see Figure 1). Our next results are two efficient algorithms: linear time testing if T 2 contains a Hamiltonian path and finding such a path (if there is any), and linear time preprocessing after which we can check for any pair (u,v) of nodes of T in constant time if there is a Hamiltonian path from u to v in T 2.


tree square of a graph Hamiltonian path 


Unable to display preview. Download preview PDF.

Unable to display preview. Download preview PDF.


  1. 1.
    Abderrezzak, M.E.K., Flandrin, E., Ryjáček, Z.: Induced S(K\(_{\mbox{1, 3}}\)) and Hamiltonian cycles in the square of a graph. Discrete Mathematics 207(1-3), 263–269 (1999)MathSciNetCrossRefzbMATHGoogle Scholar
  2. 2.
    Diestel, R.: Graph Theory, 4th edn. Springer, Heidelberg (2010)CrossRefzbMATHGoogle Scholar
  3. 3.
    Fleischner, H.: The square of every two-connected graph is Hamiltonian. J. Combin. Theory (Series B) 16, 29–34 (1974)MathSciNetCrossRefzbMATHGoogle Scholar
  4. 4.
    Georgakopoulos, A.: A short proof of Fleischner’s theorem. Discrete Mathematics 309(23-24), 6632–6634 (2009)MathSciNetCrossRefzbMATHGoogle Scholar
  5. 5.
    Georgakopoulos, A.: Infinite Hamilton cycles in squares of locally finite graphs (2006) (preprint)Google Scholar
  6. 6.
    Harary, F., Schwenk, A.: Trees with Hamiltonian square. Mathematika 18, 138–140 (1971)MathSciNetCrossRefzbMATHGoogle Scholar
  7. 7.
    Hendry, G., Vogler, W.: The square of a S(K\(_{\mbox{1, 3}}\))-free graph is vertex pancyclic. Journal of Graph Theory 9, 535–537 (1985)MathSciNetCrossRefzbMATHGoogle Scholar
  8. 8.
    Karaganis, J.J.: On the cube of a graph. Canad. Math. Bull. 11, 295–296 (1968)MathSciNetCrossRefzbMATHGoogle Scholar
  9. 9.
    Lin, Y.-L., Skiena, S.: Algorithms for square roots of graphs. SIAM J. Discrete Math. 8(1), 99–118 (1995)MathSciNetCrossRefzbMATHGoogle Scholar
  10. 10.
    Sekanina, M.: On an ordering of the set of vertices of a connected graph. Technical Report 412, Publ. Fac. Sci. Univ. Brno. (1960)Google Scholar
  11. 11.
    Thomassen, C.: Hamiltonian paths in squares of infinite locally finite blocks. Annals of Discr. Math. 3, 269–277 (1978)MathSciNetCrossRefzbMATHGoogle Scholar
  12. 12.
    Řiha, S.: A new proof of the theorem by Fleischner. J. Comb. Theory Ser. B 52, 117–123 (1991)MathSciNetCrossRefzbMATHGoogle Scholar

Copyright information

© Springer-Verlag Berlin Heidelberg 2011

Authors and Affiliations

  • Jakub Radoszewski
    • 1
  • Wojciech Rytter
    • 1
    • 2
  1. 1.Department of Mathematics, Computer Science and MechanicsUniversity of WarsawWarsawPoland
  2. 2.Faculty of Mathematics and InformaticsCopernicus UniversityToruńPoland

Personalised recommendations