Starting from 5 December 2022, the EU has implemented sanctions against Russian oil products, prohibiting the import of Russian crude oil transported by sea [
12]. Consequently, EU-flagged ships can no longer carry Russian crude oil, compelling tanker shipping firms to reoptimize their shipping services while considering flag states of their tankers. In addition to ship repositioning between different routes considering flag states of tankers, flag switching is another way tanker shipping firms are responding to the oil sanctions. Faced with the new challenges brought about by the EU oil sanctions, this study proposes a nonlinear IP model. This model aims to provide a scientific quantitative method for tanker shipping firms to jointly optimize fleet repositioning, flag switching, crude oil transportation scheduling, and speed optimization. Detailed analysis of the problem is provided in 
Section 3.1, while 
Section 3.2 outlines the nonlinear model developed to address the problem. To linearize the previous nonlinear model, some linearization methods are applied in 
Section 3.3.
  3.1. Problem Analysis
This study examines a tanker shipping firm affected by EU oil sanctions. Before EU oil sanctions, the firm originally provided long-term and stable crude oil shipping services along a set  of routes, indexed by , and managed a set  of tanker groups, indexed by , with tankers of identical types in terms of flag state and capacity. In response to EU oil sanctions, the firm can re-plan its shipping services in two ways. The first way is to switch the flag states of tankers that are not eligible to operate on a certain ship route. Here, note that we allow for a group of tankers to switch flag states to be eligible to serve multiple routes. The flag switching operation inevitably brings corresponding costs to the tanker shipping firm. We let  represent an auxiliary parameter that equals zero if and only if tankers from group  can operate on route  under their current flag states without the need for flag switching, and equals the lowest flag switching cost (USD) of switching the tanker’s flag state that is from group  to be eligible to operate on ship route  otherwise.
Another way to adapt to EU oil sanctions is to reposition tankers according to their flag states, which means moving eligible tankers (regardless of a qualified tanker whose current flag state is eligible or a qualified tanker after flag switching) from other groups to a ship route. In ship repositioning operations, the firm incurs costs, denoted by , which represent repositioning costs for moving a tanker from group  to route . Based on the above two ways, an important decision in this integrated optimization problem, fleet repositioning, is introduced first. We let  represent the deployment of tankers from group  on route . Obviously, the sum of tankers from group  across all routes () cannot surpass the total number of tankers in group , denoted by . The deployment of tankers on a route also depends on the number of round trips these tankers complete during the planning period, which is the second decision denoted by . Here, we note that the number of round trips of each route should meet or exceed the corresponding minimum frequency requirement which is influenced by the port’s temporary storage capacity limits and defined as .
The above round-trip completion planning and crude oil transportation scheduling, i.e., the amount of crude oil transported by a tanker each time, are also intertwined. We let  denote the crude oil volume transported in one round trip by a tanker from group  on route . It is obvious that the transported volume of each tanker cannot exceed the tanker’s corresponding maximum transported volume which is defined as , and during the planning period, tankers must meet the total crude oil transport demand for each route which is denoted by . The last decision in this study is sailing speed optimization, and we let  represent the set of all legs (ports of call) on route . Here, we note that only two legs, i.e., a laden lag and a ballast leg, are considered for each ship route. The speed (knot) of tankers sailing during leg  on route , denoted by , should be within the feasible range of speed, i.e., [] where  and  are the maximum and minimum speeds, respectively.
The aim of this study is to help the tanker shipping firm minimize its overall costs, including costs related to flag switching, repositioning, and fuel. First, the sum of the flag switching cost and the repositioning cost can be calculated by 
. Calculating fuel costs is more complex. In addition to the sailing speed, the fuel consumption is affected by the tanker’s displacement which refers to the total weight of the tanker itself, the amount of crude oil loaded, ballast water, and bunker [
25,
28,
29]. We let 
, 
, and 
 represent the total weight of the tanker itself, ballast water, and bunker of ships in group 
 (ton), the unit fuel price (USD/ton), and the length of leg 
 on route 
 (n mile), respectively. The total fuel cost is given by 
, where 
, 
, and 
 are coefficients that calculate the fuel consumption per hour for different legs. Here, we allow for a dynamic relationship among fuel consumption, speed, and load. Specifically, during the transportation of crude oil, the total weight of crude oil gradually decreases, which is because crude oil is consumed and converted into gas. Hence, the relationship among fuel consumption, speed, as well as load per hour is different for different legs. In summary, the objective is thus to minimize 
.
  3.2. Model Formulation
Based on the analysis presented earlier, this section introduces a nonlinear IP model. Before presenting the mathematical model, notation used in this model is listed as follows.
|  | set of all routes, . | 
|  | set of all legs (ports of call) on route , ; , and  correspond to laden legs, and ballast legs, respectively. | 
|  | set of all tanker groups, . | 
|  | set of all non-negative integers. | 
|  | total weight of the tanker itself, bunker, and ballast water for tankers in group  (ton). | 
|  | repositioning cost of moving a tanker from group  to route , which can be calculated by multiplying the operating cost by the repositioning time; the repositioning time includes the sailing time between the port where the tanker is currently located and the first port of call of the goal route , plus an additional three days for preparation [30] (USD). | 
|  | auxiliary parameter; equals 0 if and only if tankers from group  are eligible to operate on route  under their current flag states without flag switching and equals the lowest flag switching cost (USD) of switching the flag state of a tanker from group  to be eligible to operate on ship route  otherwise. | 
|  | total demand for crude oil transportation for route  over the planning period. | 
|  | unit fuel price (USD/ton). | 
|  | coefficients to calculate the per-hour fuel consumption of a tanker while travelling. | 
|  | length of leg  on route  (n mile). | 
|  | minimum frequency requirement for route  during the planning period, which is linked to the capacity limit of the port’s temporary storage area. | 
|  | duration of a ship stays at port of call  on route  (hour). | 
|  | maximum capacity of a tanker from group . | 
|  | number of tankers in group . | 
|  | length of the planning horizon (day). | 
|  | minimum and maximum speeds of tankers, respectively (knot). | 
|  | integer; speed of tankers sailing during leg  on route  (knot). | 
|  | integer; transported volume of crude oil for a round trip by a tanker from group  on route . | 
|  | integer; number of round trips completed by tankers from group  on route  during the planning horizon. | 
|  | integer; number of tankers from group  assigned to route . | 
Objective (1) minimizes the total cost, which includes the costs of flag switching, repositioning, and fuel consumption. Here, we notice that we allow for a group of tankers to be repositioned to serve multiple routes, and the value of  also equals the number of tankers from group  assigned to route  after flag switching if the value of  is not zero. Constraints (2) ensure that the transported volume per round trip completed by each tanker cannot exceed the maximum volume of the tanker. Constraints (3) guarantee that the number of tankers from any group across all routes must not exceed the number of tankers available in that group. Constraints (4) require that the deployed tankers meet the crude oil transportation needs for each route during the planning period. Constraints (5) ensure that the total number of completed round trips cannot be less than the minimum frequency required for the route, which is influenced by the port’s temporary storage capacity limits. Constraints (6) and (7) ensure appropriate total sailing times for all round trips in the planning period and feasible speeds for the deployed tankers. Constraints (8) and (9) define the ranges for the decision variables.
  3.3. Linearization
Model [M1] has a nonlinear objective function (1) and nonlinear constraints (4) and (6). Hence, this study linearizes these nonlinear parts in this section.
|  | maximum value of , which equals . | 
|  | binary; equals 1 if and only if values of  and  are  and , respectively; 0 otherwise. | 
Then, Constraints (4) are replaced with the following constraints:
Next is the linearization process of Constraints (6). 
|  | set of all permissible speeds, . | 
|  | big-M for linearization. | 
|  | binary; equals 1 if and only if tanker’s speed sailing on leg  of route  is ; 0 otherwise. | 
|  | integer; equals  if and only if tanker’s speed sailing on leg  of route  is ; 0 otherwise. | 
Then, Constraints (6) are replaced with the following constraints:
Finally, the nonlinear part in Objective (1), i.e., , can be first transformed to , which can be further transformed to  because of the existence of the newly defined variable . Then, a new variable  needs to be defined to substitute for the multiplication of variables  and , along with corresponding constraints.
|  | binary; equals 1 if and only if values of both  and  are 1; 0 otherwise. | 
Consequently, Model [M1] is transformed into its linear version:
        subject to Constraints (2), (3), (5), (7)–(26).
[M2] is a mixed-integer linear optimization model that can be solved by off-the-shelf linear optimization solvers.