The optimization of offshore wind farms is mainly performed through the deployment of wind farms and submarine cables to maximize power output and minimize cable costs. However, the above results are affected by the wake effect, equipment layout, and the cost of cables. To effectively complete the deployment of wind turbines and submarine cable lines, first, a bi‐level constrained optimization model based on maximum profit and the shortest route of cable is proposed in this paper; then, a differential evolution and improved Prim algorithm (IPADE) are used to optimize the upper‐ and lower‐level objective function, respectively. Moreover, the fitness values are used to divide the population, and a surrogate model is used to evaluate approximate fitness values for the sub‐population with poor performance; the best individual is selected as the offspring individual according to the approximate fitness values. Next, a clustering method is used to divide the position of the wind farm, and a Prim algorithm based on roulette wheel selection is designed to deploy submarine cables of every subwind farm. Finally, the proposed algorithm is compared with five other popular algorithms under the two wind conditions. The simulation experimental results show that algorithm IPADE performs better than other algorithms in terms of the power output, profit, and the length of cables.