In this study, the problem of trajectory optimization for underwater gliders considering depth constraints is discussed. Typically,underwater gliders are controlled to dive and climb in a saw-tooth pattern at constant gliding angles. This approach is effective and close to optimalfor deep water applications. However, the optimal path deviates from the saw-tooth path in shallow water conditions. This study focuses on findingmore efficient gliding paths that can minimize the traverse time in the horizontal plane when the water depth is limited. The trajectory optimizationproblem is formulated into a minimum time control problem with inequality path constraints and hydrodynamic drag effects. A numerical approachbased on the pseudo-spectral method is adopted as a solution approach, and the simulation results are presented.