Hi there, I'm Matt Sergei (do call me Matt, please) and can help you -
please provide more details.
1. Can Leaflet and OpenStreetMap (both free) be used?
2. You have only points (geolocations) of ports, right?
3. And the shortest path should use your complete "mesh" of connections between ports (nodes) that already includes avoiding any obstacles along any connections (e.g. land, islands, forbidden areas for non-domestic ships near some countries etc)?
Otherwise I'm a webmaster and developer for 27 years.
Regards and hope you're safe,
Matt