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.Hamiltonian path and cycle problems for grid graphs are NP-complete. They also gave the necessary and sufficient conditions for a rectangular grid graph to be Hamiltonian connected. Thus, rectangular grid graphs are not always Hamiltonian connected. Zamfirescu et al. [39] gave the sufficient conditions for a grid graph having a Hamiltonian cycle, and proved that all grid graphs of positive width have Hamiltonian line graphs. Later, Chen et al. [4] improved the Hamiltonian path algorithm of [21] on rectangular grid graphs and presented a parallel algorithm for the Hamiltonian path problem with two given end vertices in rectangular grid graph. Also Lenhart and Umans [33] showed the Hamiltonian cycle problem on solid grid graphs, which are grid graphs without holes, is solvable in polynomial time. Recently, 25] presented linear-time and parallel algorithms to compute the longest path between two given vertices in rectangular grid graphs. Reay and Zamfirescu [37] proved that all 2-connected, linearconvex triangular grid graphs contain Hamiltonian cycles except one special case. The Hamiltonian cycle and path problems on triangular grid graphs were known to be NP-complete [9]. In addition, the Hamiltonian cycle problem on hexagonal grid graphs has been shown to be NP-complete [20]. Alphabet grid graphs first appeared in [38], in which Salman determined the classes of alphabet grid graphs containing Hamiltonian cycles. Keshavarz-Kohjerdi and Bagheri [23] gave the necessary and sufficient conditions for the existence of Hamiltonian paths in alphabet grid graphs, and presented a linear-time algorithm for finding Hamiltonian path with two given endpoints in these graphs. Recently, verified the Hamiltonian connectivity of L-shaped grid graphs. Very recently, Keshavarz-Kohjerdi and Bagheri presented a linear-time algorithm to find Hamiltonian (s, t)-paths in rectangular grid graphs with a rectangular hole [27,28], and to compute longest (s, t)-paths in L-shaped and C-shaped grid graphs [29,30]. The supergrid graphs were first appeared in [13]...