Cargo ship sailing in the open sea at sunset, with navigation routes overlaid on a digital map
news

Ship Route Optimization with Reinforcement Learning

NeuralPulse|18 de junho de 2026|6 min read|Ler em Português

Maritime transport is responsible for about 90% of global trade, but also for approximately 3% of global CO2 emissions. By 2026, regulatory pressure from the International Maritime Organization (IMO) to reduce carbon intensity by 40% by 2030 is forcing shipowners to rethink their operations. One of the most promising solutions is real-time route optimization using reinforcement learning (RL), which has already demonstrated average fuel consumption reductions of 15% in operational trials.

The problem is complex: a maritime route is not a straight line between two ports. Factors such as ocean currents, winds, waves, traffic, draft restrictions, and weather conditions are constantly changing. Traditional route planning methods use static forecasts and are manually recalculated every few hours, resulting in suboptimal routes that waste fuel and increase emissions.

How Reinforcement Learning Transforms Navigation

Reinforcement learning is particularly well-suited to this problem because it treats navigation as a sequential decision-making process under uncertainty. The RL agent interacts with a simulated environment representing the ocean, receiving rewards for fuel efficiency, safety, and punctuality.

The typical architecture of an RL-based route optimization system includes three main components.

The first is the simulation environment, which integrates historical and real-time data on ocean currents (HYCOM models), winds (GFS), and waves (WW3). These data are obtained from public sources, such as the Copernicus Marine Service, and are updated every 6 hours.

The second component is the decision agent, usually implemented with deep Q-networks (DQN) or proximal policy optimization (PPO) algorithms. The agent's state includes the ship's current position, speed, heading, environmental conditions, and destination. Possible actions are course and speed changes within safe operational limits.

The third component is the reward system, which weighs multiple objectives: minimizing fuel consumption, respecting arrival windows, avoiding risk areas (such as piracy or storms), and complying with emissions regulations. The reward function is calibrated with real ship fuel consumption data obtained from fuel monitoring systems.

Practical Example: Optimization Pipeline with AIS Data

To illustrate applicability, consider a simplified Python pipeline that uses public Automatic Identification System (AIS) data and current forecasts to train a basic RL agent. The code below demonstrates the structure of a simulation environment:

import numpy as np
import gym
from gym import spaces

class ShipRoutingEnv(gym.Env): """Route optimization environment for a ship on a 2D grid with currents."""

def __init__(self, current_field, start, goal, max_steps=100):
    super().__init__()
    self.current_field = current_field  # 2D array with current vectors
    self.start = start
    self.goal = goal
    self.max_steps = max_steps
    self.action_space = spaces.Discrete(8)  # 8 possible directions
    self.observation_space = spaces.Box(low=0, high=1, shape=(4,))
    self.reset()

def reset(self):
    self.pos = np.array(self.start, dtype=float)
    self.steps = 0
    return self._get_obs()

def _get_obs(self):
    # Normalizes position and distance to goal
    return np.array([
        self.pos[0] / self.current_field.shape[0],
        self.pos[1] / self.current_field.shape[1],
        (self.goal[0] - self.pos[0]) / self.current_field.shape[0],
        (self.goal[1] - self.pos[1]) / self.current_field.shape[1]
    ])

def step(self, action):
    # Directions in radians (8 directions)
    directions = np.array([
        [1, 0], [1, 1], [0, 1], [-1, 1],
        [-1, 0], [-1, -1], [0, -1], [1, -1]
    ])
    move = directions[action] * 0.1  # step of 0.1 grid units
    
    # Applies current (current vector at current position)
    current = self.current_field[int(self.pos[0]), int(self.pos[1])]
    self.pos += move + current * 0.05
    
    # Keeps within bounds
    self.pos = np.clip(self.pos, 0, 
                       [self.current_field.shape[0]-1, 
                        self.current_field.shape[1]-1])
    
    self.steps += 1
    distance_to_goal = np.linalg.norm(self.pos - self.goal)
    
    # Reward: negative for distance, positive for arrival
    reward = -distance_to_goal * 0.1
    done = False
    if distance_to_goal < 0.5:
        reward = 100
        done = True
    elif self.steps >= self.max_steps:
        done = True
    
    return self._get_obs(), reward, done, {}

This environment can be used with any RL algorithm from the Stable-Baselines3 library. For a real-world case, the grid would be replaced by geographic coordinates and the current field by data from the Copernicus Marine Service, freely available at https://marine.copernicus.eu/.

Case Study: Route between Santos and Rotterdam

A recent study conducted by the University of São Paulo (USP) in partnership with the Brazilian startup NavegAI used public AIS data from 2024 and 2025 to simulate the route between Santos (Brazil) and Rotterdam (Netherlands). The study, published on arXiv in January 2026, compared traditional routes with RL-optimized routes.

The results showed an average fuel consumption reduction of 15.2%, ranging from 8% to 22% depending on seasonal conditions. The optimized route tended to avoid adverse currents and take advantage of favorable ones, even if this meant a slightly longer total distance (about 3% more in nautical miles).

The study also assessed the impact on CO2 emissions. With a 15% reduction in fuel consumption, emissions per voyage fell proportionally, equivalent to savings of approximately 300 tons of CO2 per voyage for a typical Panamax vessel.

The full data and code from the study are publicly available in the project's GitHub repository: https://github.com/navegai/rl-ship-routing.

Implementation Challenges at Real Scale

The transition from simulations to real operations faces significant barriers. The first challenge is integration with existing navigation systems. Modern ships have route management systems certified by maritime authorities, and any change requires rigorous validation.

The second challenge is the reliability of real-time environmental data. Although models such as HYCOM and GFS are accurate on a global scale, they have limited spatial resolution (about 1/12 of a degree, approximately 9 km). In coastal areas with complex currents, this resolution may be insufficient for fine-grained optimization.

The third challenge is acceptance by navigation officers. RL optimization often suggests routes that are not intuitive to experienced navigators, such as seemingly unnecessary detours. Explaining model decisions through explainable AI techniques is essential to build trust.

Regulation and Economic Incentives

The IMO, through the Energy Efficiency Design Index (EEDI) and the Ship Energy Efficiency Management Plan (SEEMP), already requires shipowners to monitor and report fuel consumption. RL-based route optimization is one of the most effective measures to comply with these regulations without resorting to slow steaming, which impacts the logistics chain.

Furthermore, the maritime carbon market, which begins full operation in 2026 under the IMO regime, creates a direct financial incentive. With carbon prices around 80 euros per ton of CO2, a reduction of 300 tons per voyage represents additional savings of 24,000 euros per voyage.

Conclusion

Maritime route optimization with reinforcement learning is a mature AI application that combines economic efficiency and environmental benefits. The data from the USP/NavegAI study, with an average 15% reduction in fuel consumption, are consistent with results from international initiatives, such as the European Union's Sea Traffic Management project.

Large-scale implementation requires overcoming challenges related to integration, data reliability, and human acceptance, but the regulatory and economic incentives are strong. For shipowners operating long-distance routes, adopting this technology can represent a significant competitive advantage in a sector with tight margins.

The path to widespread adoption goes through making public datasets and standardized benchmarks available, allowing the research and development community to validate and improve the algorithms. Initiatives such as the NavegAI repository and the open data from the Copernicus Marine Service are important steps in this direction.

#reinforcement-learning#maritime-navigation#energy-efficiency#logistics#ais-data
Compartilhar: