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.
Published Version
Talk to us
Join us for a 30 min session where you can share your feedback and ask us any queries you have