New generation of high-resolution meteo-oceanographic predictions provides useful tools for routing of ships in short maritime distances. In this work, the optimal ship routing analysis is investigated in maritime routes in the Western Mediterranean Sea for relative short sea distances. A* algorithm is implemented in order to obtain the optimal path under an energetic wave events. The methodological aspects are presented including the grid description and weather prediction systems. The optimized cost function is the travel time and it is obtained considering the added resistance due to waves. A practical example considers the maritime route between Barcelona and Algiers. The results show the influence of this factor in the optimum path recovered by the algorithm. The relevance of the relative direction between wave and ship route is proven comparing the ship routing results.