For the navigator
The optimizer answers one question: leaving at the selected time, what is the fastest way to sail from start to destination? It knows your yacht's polar table (how fast she sails at each wind strength and angle), the wind forecast for every hour, the current, and where the land is.
It tries thousands of possible courses, hour by hour, and keeps the quickest. That is why the route bends: a longer-looking leg can be faster if it finds stronger or better-angled wind. A tack or gybe costs time (45 s / 30 s by default), so the route only turns when the gain beats the penalty.
The ETA line shows a range: p10 is the optimistic arrival, p90 the pessimistic one. They come from re-sailing the same route with the forecast shifted a few hours earlier and later — a measure of how much the answer depends on the forecast being on time.
The route never crosses land: every candidate leg is checked against the coastline, and the finished route is checked again before it is shown. It is still a simulation — it uses a simplified coastline, not official charts. Always check against your chart plotter.
For the data scientist
The search is a time-dependent A* over a state of (grid cell, time bucket, tack). Cells are 0.02° (about 2 km), refined to 0.0025° in confined water; the time bucket is 600 s. Each edge sails from a cell center to a neighbor cell center: true wind is made water-relative (W_earth − C), the polar gives STW for the true wind angle, leeway rotates the track to leeward upwind, and the edge is feasible only if the constant-velocity ground track actually enters the target cell and crosses no land.
The heuristic is straight-line distance to the goal divided by the best possible speed over ground (polar V-max plus the provable maximum current in the search region), minus the arrival slack. That is a lower bound on the remaining time, so A* is admissible and the returned route is optimal on the search graph. When no current bound is available the search falls back to Dijkstra, which is equivalent under the same graph.
States are deduplicated exactly: for each (cell, time bucket, tack) only the earliest arrival is kept. ETA uncertainty (p10/p90) re-runs the search with the forecast time-shifted by ±3 h. Edges are rejected in the no-go and no-run zones of the polar, below 1 kn of true wind, and when head seas reduce speed below usable progress (uncalibrated penalty, capped). Full detail: docs/routing-engine.md.