# The Longest (s, t)-paths of O-shaped Supergrid Graphs

In this paper, we continue the study of the Hamiltonian and longest (s, t)-paths of supergrid graphs. The Hamiltonian (s, t)-path of a graph is a Hamiltonian path between any two given vertices s and t in the graph, and the longest (s, t)-path is a simple path with the maximum number of vertices from s to t in the graph. A graph holds Hamiltonian connected property if it contains a Hamiltonian (s, t)-path. These two problems are well-known NP-complete for general supergrid graphs. An O-shaped supergrid graph is a special kind of a rectangular grid graph with a rectangular hole. In this paper, we first prove the Hamiltonian connectivity of O-shaped supergrid graphs except few conditions. We then show that the longest (s, t)-path of an O-shaped supergrid graph can be computed in linear time. The Hamiltonian and longest (s, t)-paths of O-shaped supergrid graphs can be applied to compute the minimum trace of computerized embroidery machine and 3D printer when a hollow object is printed.

READ FULL TEXT