Existing work for voyage planning and energy management mainly deals with economic and environmental constraints and ignores the impact of power supply capacity on voyage security. Hence, considering the N-1 criterion, this paper establishes a novel optimal operation method for all-electric ships. The power supply capacity constraints are described based on the interconnected relationship of shipboard inverters. Secondly, the inequalities of power injections express the sailing speed and carbon emission constraints. Thirdly, a coordinated model is established to minimize the generation cost, reduce emissions, and satisfy ship arrival time requirements. The actual navigation data are used for simulation, and the results show that the proposed method can meet the requirement of economy and security during the voyage.