As science and technology develop in recent years, the center of ship shafting has received high attention from the ship industry. The traditional ship shafting calibration mostly focuses on the issue that hull deformation cannot be accurately estimated. The ship is floating after entering the water, and this method is not conducive to the long-term stable operation of the ship shafting. To solve the above problems, the study establishes the optimization model of ship axis alignment based on slide alignment and finite element method. This model can be optimized by adopting the non-dominant sequencing genetic algorithm improved by elite strategy. The study verified the performance of the optimization model of ship axis alignment. The results showed that the adaptive value, super-volume value, and inverse generation distance of the improved genetic algorithm were 74.57, 0.38, and 0.03, respectively. In the application of a ship, the intermediate bearing position could be adjusted by the ship shafting optimization model based on the improved non-dominant sorting genetic algorithm. As a result, the shaft reaction under the ballast condition was reduced by 24019 N than before, making the bearing load of the ship shafting more uniform. To sum up, the proposed optimal model is robust, which can effectively reduce the impact of hull deformation, improve the optimal effect of ship shafting alignment and ensure the safe navigation of the ship.