The water wave optimization (WWO) algorithm is inspired by shallow water wave theory and mainly simulates propagation, refraction and breaking to obtain the global optimal solution in the search space. Due to its premature convergence and low optimization efficiency, the basic WWO has a slow convergence speed and low calculation accuracy. To improve the overall optimization performance of the basic WWO, an enhanced WWO based on the elite opposition-based learning strategy and the simplex method (ESWWO) is proposed to solve the function optimization problem and path planning problem for an autonomous underwater vehicle (AUV). The elite opposition-based learning strategy increases the diversity of the population and enhances the global search ability to avoid falling into the local optimum. The simplex method has a fast search speed and strong local search ability to obtain a very accurate solution. The ESWWO algorithm can not only achieve complementary advantages to improve the optimization efficiency of the basic WWO but can also balance exploration and exploitation to obtain the global optimal solution. For the function optimization problem, the ESWWO has strong stability and robustness, and the fitness values of the ESWWO are better than those of other algorithms. For the AUV path planning problem, the ESWWO can avoid threat areas with a minimum fuel cost to obtain the optimal path. The experimental results show that the overall optimization performance of the ESWWO algorithm is superior to that of other algorithms, and thus, ESWWO is an effective and feasible method for solving the function optimization problem and AUV path planning problem.