Linear-time algorithms for finding Hamiltonian and longest (s, t)-paths in C-shaped grid graphs

Abstract The longest and Hamiltonian path problems are well-known NP-hard problems in graph theory. Despite many applications of these problems, they are still open for many classes of graphs, including solid grid graphs and grid graphs with some holes. We consider the longest and Hamiltonian ( s , t ) -path problems in C -shaped grid graphs. A ( s , t ) -path is a path between two given vertices s and t of the graph. A C -shaped grid graph is a rectangular grid graph such that a rectangular grid subgraph is removed from it to make a C -liked shape. In this paper, we first give the necessary conditions for the existence of Hamiltonian cycles and Hamiltonian ( s , t ) -paths in such graphs. Then by given a linear-time algorithm for finding Hamiltonian cycles and Hamiltonian ( s , t ) -paths, we show that these necessary conditions are also sufficient. Finally, we give a linear-time algorithm for finding the longest ( s , t ) -path in these graphs.

[1]  Asghar Asgharian-Sardroud,et al.  A linear-time algorithm for the longest path problem in rectangular grid graphs , 2012, Discret. Appl. Math..

[2]  Koki Hamada A Picturesque Maze Generation Algorithm with Any Given Endpoints , 2013, J. Inf. Process..

[3]  Hong Shen,et al.  An efficient algorithm for constructing Hamiltonian paths in meshes , 2002, Parallel Comput..

[4]  Jong-Shin Chen,et al.  The Hamiltonian connectivity of rectangular supergrid graphs , 2017, Discret. Optim..

[5]  Alireza Bagheri,et al.  Hamiltonian Paths in Some Classes of Grid Graphs , 2012, J. Appl. Math..

[6]  Zhao Zhang,et al.  Algorithms for long paths in graphs , 2007, Theor. Comput. Sci..

[7]  Stavros D. Nikolopoulos,et al.  The Longest Path Problem Is Polynomial on Cocomparability Graphs , 2011, Algorithmica.

[8]  A. J. M. van Gasteren,et al.  On computing a longest path in a tree , 2002, Inf. Process. Lett..

[9]  Alireza Bagheri,et al.  Hamiltonian paths in L-shaped grid graphs , 2016, Theor. Comput. Sci..

[10]  Rolf Klein,et al.  Exploring Simple Grid Polygons , 2005, COCOON.

[11]  Mohammad Sohel Rahman,et al.  On Hamiltonian cycles and Hamiltonian paths , 2005, Inf. Process. Lett..

[12]  Gregory Gutin,et al.  Finding a Longest Path in a Complete Multipartite Digraph , 1993, SIAM J. Discret. Math..

[13]  Alireza Bagheri,et al.  A linear-time algorithm for finding Hamiltonian (s, t)-paths in even-sized rectangular grid graphs with a rectangular hole , 2017, Theor. Comput. Sci..

[14]  Andreas Björklund,et al.  Finding a Path of Superlogarithmic Length , 2002, ICALP.

[15]  Jayme Luiz Szwarcfiter,et al.  Hamilton Paths in Grid Graphs , 1982, SIAM J. Comput..

[16]  Alireza Bagheri,et al.  Longest (s, t)-paths in L-shaped grid graphs , 2019, Optim. Methods Softw..

[17]  David R. Karger,et al.  On approximating the longest path in a graph , 1997, Algorithmica.

[18]  Edy Tri Baskoro,et al.  Spanning 2-Connected Subgraphs in Alphabet Graphs, Special Classes of Grid Graphs , 2003, J. Autom. Lang. Comb..

[19]  Alireza Bagheri,et al.  A linear-time algorithm for finding Hamiltonian (s, t)-paths in odd-sized rectangular grid graphs with a rectangular hole , 2017, The Journal of Supercomputing.

[20]  A. Rao,et al.  Understanding chicken walks on n × n grid: Hamiltonian paths, discrete dynamics, and rectifiable paths , 2015, 1502.03037.

[21]  Alireza Bagheri,et al.  An efficient parallel algorithm for the longest path problem in meshes , 2012, The Journal of Supercomputing.

[22]  Chih-Chia Yao,et al.  The Hamiltonian properties of supergrid graphs , 2015, Theor. Comput. Sci..

[23]  Yong-Jin Liu,et al.  Approximating the longest paths in grid graphs , 2011, Theor. Comput. Sci..

[24]  Christopher Umans,et al.  Hamiltonian cycles in solid grid graphs , 1997, Proceedings 38th Annual Symposium on Foundations of Computer Science.

[25]  Ryuhei Uehara,et al.  On Computing Longest Paths in Small Graph Classes , 2007, Int. J. Found. Comput. Sci..

[26]  Ruo-Wei Hung,et al.  Hamiltonian cycles in linear-convex supergrid graphs , 2015, Discret. Appl. Math..