1. INTRODUCTION
International trade largely depends on maritime transportation since ships are the most costeffective means of transportation of a large volume of goods in long distances. Container ship routing has been one of the most important issues of transport companies and shipping lines, since, as mentioned, a significant volume of transportation includes sea transportation. In general, there are three types of maritime transportation (ship routing problem), which are presented below.

1) Industrial transportation: this type of transportation aims to minimize product transfer costs, and is often used to transfer petroleum and minerals. It is notable that the owner of the ship and the cargo is one person.

2) Irregular transportation: this type of transportation occurs with the goal of maximizing profits with no special rules and preset time. In addition, different ports are visited and their demands are met.

3) Regular transportation: in this type of transportation, which includes container ships, the goal is to maximize profits, in a way that the ship visits different ports in fixed routes at the same time intervals, and loading and unloading are carried out in each port. Regular transportation shipping companies provide services in the form of longterm, shortterm, and spot contracts.
It is notable that the current research focused on regular transportation. The ship routing problem has been assessed in many studies, most of which can be considered as specific applications of the vehicle routing problem, where cargo is transferred between several loading and unloading ports. One of the most comprehensive studies in this area was conducted by Christiansen et al. in 2004 and 2013 (Christiansen et al., 2013). Moreover, while there are uncertainties in maritime transportation, the majority of studies in this field have evaluated the ship routing problem in a definitive environment. There are some interesting exceptions in ship routing and planning in studies performed by Iswanto (2019) and Kisialiou et al. (2019). In fact, these researchers focused on the topic of uncertain demand and changing climatic conditions at oil and gas platforms (Kisialiou et al., 2018, 2019). Korsvik and Fagerholt (2012) and Kosmas and Vlachos (2012) considered irregular ship routing problems along with other important decisions. Moreover, they developed several heuristic approaches to solve the proposed problem (Korsvik et al., 2010;Kosmas and Vlachos, 2012). Norstad et al. (2011) assessed the topic of ship speed and route optimization in an integrated manner (Wang et al., 2019). The foregoing research was expanded in 2019 by Wang et al., who evaluated the effects of measures taken to decrease pollutant emission on operational decisions of transportation companies, as well as their environmental and economic outcomes (Wu et al., 2021). Both of these studies applied the local search heuristic method with several start points. Wu et al. (2021) evaluated bulk carrier routing by selecting batched cargo. These scholars presented a combined problem of three subproblems in irregular transportation (irregular ship routing problem) including: 1) fleet adjustment, 2) batched cargo selection, and 3) ship routing. In the end, a tailored branchand priceandcut algorithm was developed to solve the compact mixedinteger linear programming formulation. According to the results, the robust algorithm of the research led to the production of optimal or nearoptimal solutions in a short computational time (logical) for real samples (Brønmo et al., 2010).
Brønmo et al. (2010) applied the “column generation algorithm” to solve the ship routing problem with flexible cargo sizes. In the end, the algorithm had a better performance, compared to the method in which all columns are generated from the beginning (Meng et al., 2015). Stålhane et al. (2012) proposed a branchpriceandcut method to solve a ship routing problem, where cargos were picked up and delivered (Hwang et al., 2008). Meng et al. (2015) solved the fuel and ship routing problem using a branchand price (B&P) approach (Homsi et al., 2020). Considering an unstable maritime market, Hwang et al. (2008) proposed a ship routing problem, in which profit difference was minimized. The model was solved using the B&P method (Tirado et al., 2013). Homsi et al. (2020) proposed an exact B&P algorithm to solve the ship routing problem. These scholars presented a set of acceleration techniques to optimize the algorithm. In the end, algorithm performance was tested using a set of small data, the results of which demonstrated the algorithm’s ability to solve largerscale samples (HalvorsenWeare et al., 2013).
Most studies in the field of ship routing have focused on definitive parameter tuning, a small number of authors and researchers have taken uncertainty into account. An example is a research by Hwang et al. (2008), who considered uncertainties in revenue from renting ships and transporting instant market cargo. They aimed to maximize the expected revenue of a shipping company under defined profit variance limits (Tirado et al., 2013). Tirado et al. (2013) addressed a dynamic ship routing problem, in which new cargos were randomly entered into the decision making space. They adopted three heuristics to solve their proposed model (Agra et al., 2013). Halvorsen et al. (2013) investigated a ship routing and scheduling problem in liquefied natural gas (LNG) industry. In their proposed problem, LNG was transported from a single producer to a set of customers over a period of time (planning horizon). In this study, the researchers took uncertainties in travel time and the rate of daily LNG generation into account. They developed a simulationoptimization framework to solve the proposed model and presented several approaches to improve the results at the end (Huang and Han, 2021). Agra et al. (2013) considered uncertainty in travel time in a ship routing problem. In the end, a robust columnandrow generation optimization algorithm was introduced (Liu et al., 2020). Huang and Han (2021) optimized the route of containers in urban areas. They proposed a multiobjective mathematical model and ranked its solutions by the Topsis method (Li et al., 2020). Liu et al. (2020) scheduled the train route using an optimization mathematical model. They divided demand into several sections using a variable neighborhood search algorithm (Zorarpacı and Özel, 2016).
Today, the efficient solving of many hybrid optimization problems known as NPhard problems is one of the main challenges of mathematicians, scientists, and engineers. In the present study, we aimed to evaluate one of these problems known as the container ship routing problem while assuming certain time windows and demands of destination porters. In the ship routing problem, the main focus was on scheduling and routing a fixed fleet of ships in order to transport a set of cargoes under certainty. Another innovation of the present study was using novel metaheuristic methods (differential evolution and grey wolf algorithms) to solve the container ship routing problem. The remainder of the study is described as follows: section 2 presents the research problem, as well as the necessary definitions and assumptions related to the ship routing problem. Section 3 expresses the final mathematical model and symbols, and section 4 introduces the differential evolution and grey wolf algorithms. Section 5 shows the numerical results and model implementation using the mentioned algorithms, and section 5 concludes. Moreover, approaches are proposed for future studies in section 6.
2. STATEMENT OF THE PROBLEM AND KEY DEFINITIONS
It is better for the customers of a container terminal to minimize the returned time. In other words, the waiting time is minimized and container loading and unloading are carried out as fast as possible to save on terminal costs. To reduce the time spent on container ships, terminal officials place particular emphasis on allocating resources and docks to ships. In the maritime industry, container terminal managers know that customers will seek another port if they are dissatisfied with port performance. Therefore, many of them tend to decrease (minimize) the returned time of ships with the existing resources (incurring the lowest costs) (Wu et al., 2021). The following are definitions of the three essential terms used in this study:

• Ship routing problem: is one of the most important elements in the assessment of the performance of a shipping company. Finding the best route is one of the important issues in maritime transportation. However, the most suitable route is not necessarily the shortest route in this industry, and several other factors, including fuel consumption, demand of destination ports, and safety, are taken into account in decisionmaking with different degrees of importance.

• Main port: are ports that are on the international routes of container ships (intercontinental), and large container ships travel there with a large container volume. Main ports must have suitable equipment, draft, geographical location, and communication lines in order to attract customer satisfaction.

•Loading capacity of a ship: the difference between the amount of heavy handling and the amount of light handling is called cargo carrying capacity. The unit of container transport volume is TEU and represents a 20foot container.
Ship routing includes ship distribution with several goods that cannot be integrated and combined. In addition, the cost and time of travel or transportation of cargo are different in routing for the distribution of ships with different capacities. The ships are also different in terms of number and type of compartments. It means that each compartment can be loaded with a certain type of goods, but only one type of product is loaded and delivered each time. The ship can pass several ports and even the start port on the route of transportation and delivery of cargo. However, it is assumed that all goods are unloaded by the end of travel, and the only ship with empty compartments is returned to start ports. Therefore, it could be said that when a ship's compartment is loaded with different goods, it will not lead to higher cost or longer time. Each port can load a large number of goods through the distribution of ships. It could be mentioned that each product has a limited supply level. In addition, each demand route receives and uses certain goods. Each product has an average level of daily consumption. Goods must be stored separately in port warehouses based on their specific conditions and characteristics. These warehouses have a maximum capacity. A group of ships sails between ports to ensure that there is sufficient warehouse capacity. A ship may load one or several goods from supply warehouses and unload them in a demand point or port. The present study determined the exact number of companies that arrived at a port and the number of loading and unloading. It is notable that loading and unloading are collectively specified. It is assumed that more than one ship can berth at a port simultaneously. In addition, several ships can load or unload different goods at the same time. However, a ship cannot simultaneously load and unload different goods. Waiting time is also allowed at the port. In supply ports, a ship may start its travel with delay due to the high volume of products. However, the time to reach the destination ports must be taken into account in this delay so that cargo deficit should not occur in these ports. In demand points (destination), the ship can wait until there is room in the warehouse for further unloading. The equipment and items in the ship’s compartment are identified at the beginning of scheduling and routing. A ship’s compartments may be empty, or there may be one or more goods in the compartment. The location of a ship is in the port or a point in the sea. In this problem, we deal with shortterm and longterm operational planning and design. The number of ships and their overall capacity is considered to be fixed and specified for loading at ports during the planned period. Therefore, we overlooked the fixed cost of ships, such as the cost of renting and investment since the products in the production and consumption warehouses were owned by a single company. In this case, we only focused on the transportation cost and ship movement. Moreover, a total of 100 kilogallons per nautical mile of fuel was considered for all ships. Distances between ports are also calculated from a uniform distribution of between 10 and 200 nautical miles. Based on the mentioned conditions, we must determine the capacity of each ship and its primary location, the number of products that must be loaded or unloaded at each port, and the time window related to each port. The purpose of the problem is to determine the route for each ship so that the maximum volume of goods is moved with a minimum travel distance and to choose a route that has all the optimal conditions mentioned above (e.g., safety) or the majority of effective factors. In this study, however, we only considered destination port demand, ship capacity, and time window.
3. MATHEMATICAL MODELING
In this study, we proposed an optimization mathematical model to minimize the total variable shipping costs, including travel costs (fuel + personnel), toll fees, and port tariffs, while taking the limitations of delivery, carrying capacity, and time windows into account. The elements of the model are presented below:
The input variables used in the above formula were:
Now, for each i, j ∈ P: i ≠ j, k ∈ V, ϕ ∈ Φ, and α ∈ C, we have:

d_{ij} Length of the edge (I, j) corresponding to the distance from the ith port to the jth port in nautical miles

vel_{k} Ship velocity (knot)

Q_{k} The capacity of the kth ship

a_{α} Time of receiving the ath container

o_{α}, e_{α} The origin and destination ports of the ath container

f_{ik} Tariffs of the ith port for the kth ship

b_{i} Loading or unloading time of each container at the ith port

c_{k} Travel costs (fuel consumption in kilogallon) for the kth ship in dollars per nautical mile

${s}_{ik\varphi}$ When the kth ship arrives at the ϕth port in the ith travel

Start_{i} Work start time of the ith port

Finish_{i} Work finish time of the ith port

M A large fixed number
The model has two binary decisionmaking variables and seven constraints, as follows:

${x}_{ijk\varphi}$ : 1, if the kth ship travels from the ith port to the jth port in the ith travel; otherwise, 0.

${\gamma}_{ik\varphi \alpha}$ : 1, if the kth ship loads the ath container after leaving the ith port in the ϕth travel.

Constraints 1: ensure that the ship will leave any port it enters and will travel to another port.

Constraints 2: prevent the start of port operations before the arrival of the ship.

Constraints 3: guarantee that the container delivery deadline does not exceed the determined time.

Constraints 4: ensure that the total weight of containers loaded into the ship does not exceed the ship’s capacity.

Constraints 5: guarantee that each container is delivered to the port by one and only one ship.

Constraints 6: integrates ship routing problem and container loading problem with each other. For instance, if a container is loaded on a ship, then that ship must travel to the port of destination of the container.

Constraints 7: is related to time windows of start and finish of the work in each port
4. IMPLEMENTATION AND PROBLEMSOLVING
In this study, the differential evolution metaheuristic and grey wolf algorithms were used to solve the model. Before solving, a brief description was provided to learn about the algorithms, followed by the assessment and comparison of the efficiency of the two algorithms in solving ship routing problems using a numerical example.
4.1 Differential Evolution Algorithm
Differential evolution algorithm (DE) was first introduced by Storn and Price in 1995 (Zorarpacı and Özel, 2016). According to these scholars, the algorithm can properly optimize nonlinear nondifferentiable functions and can be used as a rapid and robust method to optimize problems in continuous spaces. The DE algorithm was presented to deal with the main problem of the genetic algorithm (GA), which is the lack of local search. In fact, the main difference between the GA and the DE algorithm is the selection operator. In the GA selection operator, the chance of choosing a solution as a parent depends on its level of competence. In DE algorithm, however, all solutions have an equal chance of being chosen. In other words, their chances of being selected do not depend on their degree of competence. After the generation of a new solution using a selftuning mutation operator and a crossover operator, the new solution is replaced by the previous amount. Contrary to other algorithms, the crossover operator is used first in this algorithm, followed by the mutation algorithm in order to create a new generation. Moreover, no certain distribution is used to apply the mutation operator. In fact, the length of the mutation step is determined based on the distance between the current members. The evolution process of the algorithm is based on gradual and constant improvement in the initial guess (candid response), there is a need for a fitness function to compare the responses based on the principles of all evolutionary algorithms. Compared to other real equation solution methods (e.g., Newton method), one of the strengths of the DE algorithm is its lack of need for function gradients. Therefore, a relatively optimal response is hoped to be obtained for different irregular multidimensional continuous/noncontinuous functions without any information about the type of function. Complementary information about the DE algorithm was provided by Li et al. (2020).
4.2 Grey Wolf Algorithm
Optimization is a vital part of humans’ lives. Therefore, various optimization algorithms with a metaheuristic approach have been introduced. The GWO is one of the most recent metaheuristic algorithms, presented by Mirjalili et al. in 2014 and generalized into a multiobjective one in 2016. This algorithm belongs to the group of collective intelligence algorithms and, similar to many other metaheuristic algorithms, is inspired by nature and is based on a hierarchical structure that models the social behavior of gray wolves during hunting. In the implementation of the GWO algorithm, four types of gray wolves of a tribe, such as alpha (α), beta (β), delta (δ) and omega (ω), are used to model the hierarchical leadership of gray wolves, the three main hunting steps of which include chasing, approaching, and tracking prey. The results of different benchmark functions indicate the optimal performance of the algorithm compared to similar algorithms.
As observed in Figure 1, wolves live in packs and have a precise and linear social hierarchy in their community. The first group is the Alpha wolves, which are the leaders of the wolf pack. Alpha wolves make decisions of the community such as choosing the prey, where to sleep, and habitat. However, Alpha wolves respect others’ decisions in some cases. The second level of the hierarchy includes beta wolves, which act as advisers to Alphas. They receive orders from Alpha wolves but they give orders to lowerranking wolves. They take care of Alpha wolves’ orders and give feedback to them. The other group includes Delta wolves, which receive orders from Alpha and Beta wolves. Delta wolves are responsible for guarding and preying. Omega wolves have the lowest rank and surrender to the orders of other groups.
5. NUMERICAL RESULTS
5.1 Presentation of a Sample Problem
This section provides a numerical example to illustrate how the model works. In this routing example, 15 ships with different capacities and similar fuel consumption, as well as 45 ports with different demand and time windows were considered. Ships were in their ports of origin at the moment of zero. To quantify the parameters (tuning the parameters of the proposed algorithms), Taguchi method was used in Minitab software. Table 1 shows the level of parameter tuning in the presented algorithms.
5.2 Algorithm Performance Measurement
In order to measure the efficiency of the proposed algorithms, an example of the problem was presented and solved. Tables 2 and 3 show information about the sample. All calculations were performed in MATLAB software.
Tables 4 and 5 show the numerical results of 30 consecutive implementations of each algorithm. In addition, three important quantities were obtained for each algorithm. F shows the value of the objective function, T is time (seconds) and GAP is the percentage of difference in the response obtained by each algorithm with the best response. In fact, if F* is the optimal amount obtained from each algorithm, the value of GAP is obtained from ${\text{F}}^{\text{*}}\frac{F}{{F}^{*}}$. The fourth to eighteenth rows represent the optimal route for each ship, and the nineteenth and twentieth rows show the total distance traveled and the total container handled by each of the 15 existing ships. According to the output tables, the ED algorithm had a better performance since it presented the best solution in rational time. While the GWO was solved in a shorter time, the ED algorithm yielded a more optimal response, and this difference may increase at larger scales. In fact, the optimal solution in the ED algorithm led to a higher utility of carrying capacity (3954 TEU displacement in a distance of 4451 nautical miles).
6. CONCLUSION
The present study aimed to solve a ship routing problem while minimizing the total carrying costs, including travel costs (fuel + personnel), toll fees, and port tariffs, while taking the limitations of delivery, carrying capacity, and time windows into account. Given the complexity of the problem, we used two metaheuristic algorithms of ED and GWO. The results were indicative of proper performance of the two algorithms in terms of closeness to accurate response and short solution period. It is recommended that adding environmental target functions, analyzing the sensitivity of time windows in ship fuel consumption, comparing the solution approaches with other novel metaheuristic algorithms, integrating the proposed model with other problems of container terminals be taken into consideration in future studies.