An Improved Discrete PSO for Tugboat Assignment Problem under a Hybrid Scheduling Rule in Container Terminal

In container terminal, tugboat plays vital role in safety of ship docking. Tugboat assignment problem under a hybrid scheduling rule (TAP-HSR) is to determine the assignment between multiple tugboats and ships and the scheduling sequence of ships to minimize the turnaround time of ships. A mixed-integer programming model and the scheduling method are described for TAP-HSR problem.Then an improved discrete PSO (IDPSO) algorithm for TAP-HSR problem is proposed to minimize the turnaround time of ships. In particular, some new redefined PSO operators and the discrete updating rules of position and velocity are developed. The experimental results show that the proposed IDPSO can get better solutions than GA and basic discrete PSO.


Introduction
Nowadays, more and more people have recognized the importance of world trade via container terminals.Ship docking is one important operation having an influence on the productivity of container terminal which includes two types of operations.One is the berth allocation often described as the problem in which the berthing time and the berthing position are specified to each ship [1].The other is the tugboat assignment described as a decision problem to find the best assignment of tugboats and scheduling sequence of ships which minimizes the turnaround time of ships subject to the assignment rules.Tugboat is one kind of small ships with large engine used to move ships in and out of berth [2].With the steadily growing size and rapidly increasing number of entry ships, safe and efficient docking operation of ships is one of the most important issues in container terminals [3].Because container terminal has finite tugboats with different service abilities, it is very important to develop effective tugboat assignment method to reduce turnaround time of ships and maintain high productivity of container terminal.
When a ship arrives at the container terminal, the ship should be assigned an available berth for unloading and loading containers.However ships cannot dock by themselves to the berths because the port lane is narrow and the port water is shallow.The specified equipment called tugboat is used to help ships dock safely.Due to the strong structure and large power, tugboat can pull large-sized ships.If a ship is so large that one tugboat cannot tug, two or more tugboats can be used together to tow the ship.It is considered that, only with an available berth and proper tugboats, a ship can dock safely and prepare for unloading or loading operation.Otherwise, it has to wait at the anchorage outside the container terminal.
Several studies have been conducted for equipment assignment or scheduling problem in container terminals, such as berth assignment [4,5], quay crane scheduling [6][7][8], yard crane scheduling [9,10], truck scheduling [11], and storage space assignment [12].However, little research work on tugboat assignment problem can be found.Mori [3] outlined tugboat development situation and tugboat business in Asian countries, especially in Japan.Liu and Wang introduced tugboat allocation simulation [13] and then Liu studied the tugboat scheduling problem and employed a hybrid evolutionary algorithm to solve this problem [14].However, it only focused on the tugboat scheduling rules without mathematical model.Furthermore, the study did not cover the optimization of the assignment plan between tugboats and ships.
Tugboat assignment is a typical kind of assignment optimization problem.The existing approaches for solving the assignment problems can be divided into two categories.The traditional methods are mathematical programming approaches using Branch and Bound [15] and Lagrangian Relaxation [16] to get the best solution efficiently, but only for small-sized problem.Besides, metaheuristic algorithms involving genetic algorithms (GA) [17][18][19], ant colony optimization [20,21], simulated annealing (SA) [22], Tabu search (TS) [23,24], and variable neighborhood search (VNS) [25] are fast and efficient algorithms to get approximate solutions with reasonable computational time for solving large scale and more difficult combination optimization problem.
Recently, particle swarm optimization (PSO) is a novel evolutionary algorithm presented by Kennedy and Eberhart [26].Due to easy implementation and fast convergence, PSO has proved to be an effective and competitive algorithm for a wide variety of optimization problems.However, most of the published studies have concentrated on the continuous optimization problems.Recently, some work has been done to the discrete optimization problem.In order to extend the application to discrete space, Kennedy and Eberhart [27] proposed a discrete binary version of PSO where a particle moved in a state space restricted to zero and one on each dimension.Yin et al. [28] embedded a hill-climbing heuristic in PSO to assign application tasks to processors such that the resource demand of each task was satisfied and the system throughput was increased.Lin et al. [29] implemented a hybrid PSO (HPSO) to solve the biobjective personnel assignment problem.The HPSO algorithm was combined with the random-key (RK) encoding scheme and individual enhancement (IE) scheme.Similar hybrid PSO algorithms are proposed by introducing operations of GAs into PSO systems by Robinson et al. [30].Lian et al. [31] proposed some new valid PSO operators for permutation job-shop scheduling to minimize makespan.Prescilla and Immanuel Selvakumar [32] applied the modified binary particle swarm optimization algorithm to solve the real-time task assignment in heterogeneous multiprocessor.
To the best of our knowledge, there is no published work for dealing with tugboat assignment using PSO.In this paper, we introduce the tugboat assignment problem under a hybrid scheduling rule (TAP-HSR) and give the mathematical model.Then, an improved discrete PSO algorithm for TAP-HSR problem is proposed to minimize the turnaround time of ships.In particular, a new method for redefining PSO operators is developed.The experimental results show that the proposed method is effective and efficient compared to GA.
The rest of this paper is organized as follows.In the next section, tugboat assignment problem under a hybrid scheduling rule (TAP-HSR) and the mathematical model are described.Section 3 proposes the improved discrete PSO (IDPSO) for TAP-HSR problem.Section 4 discusses the experimental results.Finally, Section 5 provides some conclusions and the future work.

Problem Formulation and Scheduling Rules
2.1.Problem Description.The tugboat assignment problem under a hybrid scheduling rule is an essential decisionmaking problem in container terminal.The tugboat assignment operation has two procedures.One is to find the assignment plan under the assignment rules.The other is to generate the scheduling sequence of ships based on the assignment plan and some scheduling rules.
Container terminal assigns tugboats to ships based on some assignment rules.Firstly, each tugboat can serve at most one ship and each ship can be assigned one or more ships at any time.Secondly, the assigned number of tugboats is determined by ship length.The ship with length equal to or less than 100 meters needs one tugboat at least.Otherwise, the ship with the length more than 100 meters needs two tugboats at least.Finally, it is required to assign tugboat with proper horsepower (ps).Horsepower is a common unit to measure tugboat power.The tugboat with higher horsepower has more service capacity to tug longer ship.The assignment rules between ships and tugboats are shown in Table 1.
Assignment plan only describes the matching relationship of multiple tugboats and multiple ships.It is required to use some scheduling rules to determine a scheduling sequence of ships according to the assignment plan.This paper applies a hybrid scheduling rule combined with firstcome-first-served (FCFS) rule and first-fit rule.Based on the hybrid scheduling rule, the ship with earlier arriving time and the available assigned tugboats has the higher priority of docking.
The goal of TAP-HSR is to minimize the turnaround time of ships under the premise that all ships finish docking.With more and more ships arriving, it is impossible to make sure that ships can have available tugboats for docking immediately at arrival.Some ships will wait outside the terminal at the anchorage until available tugboats can work for them.Good assignment can decrease the waiting time of ships so that the container terminal can serve more ships and get more profits.

Model Formulation.
In this paper, TAP-HSR is based on the following assumptions.
(1) The expected arriving time and the length of all ships are known.
(2) The docking operation time of ship depends on the length of ship and is independent of tugboat.
(3) Each ship has an available berth for unloading and loading containers.
(4) Tugboat can work for only one ship at the same time.
(5) The preparation time of tugboat is zero which means one tugboat can start to serve the next ship immediately after it finishes the previous ship.
(6) All tugboats are available when the first ship starts to berth.
(7) The operation of tugboat requires an uninterrupted period of time.This paper describes TAP-HSR problem with the following notations.This paper gives the following definitions.
Definition 1 (assignment matrix).  is the decision matrix which describes the assignment between ships and tugboats.The decision variable   ∈ {0, 1} denotes whether or not tugboat  is assigned to ship : Definition 2 (conflict ship).If tugboat  is assigned to both ship  and ship  and ship  is scheduled for docking before ship , ship  is called the conflict ship of ship .Let   denote the conflict ship set of ship : = ⌀ represents that all of the assigned tugboats to ship  are available when ship  arrives.In that condition, the ship can dock immediately at arriving time.Otherwise, if the assigned tugboats are working for the conflict ships of ship , ship  has to wait until all the conflict ships finish docking.
Let   denote the start docking time of the first ship and let   denote the completion docking time of the last ship.The objective function of TAP-HSR problem is to minimize the turnaround time of ships described as where   = 0 according to assumption ( 6) and   is the maximum completion docking time of ships defined as The objective function is min   represented by the following formula: To find the maximum completion docking time of ships, it is required to calculate the completion docking time of each ship   ( = 1, 2, 3, . . ., ) represented as the start docking time of ship   plus the operation time of ship   : In TAP-HSR problem, let   denote ship .According to Definition 2, the maximum completion time of the conflict ships of   is max   ∈    .The start docking time   is calculated by Equation (7) states that if ship arrives after the time when all the conflict ships have done the docking operation, the start docking time is the arriving time.Otherwise, the start docking time of this ship is the maximum completion docking time of the conflict ships.
The constraints in TAP-HSR problem are as follows: Constraints in (8) ensure that the total number and horsepower of tugboats assigned to each ship should meet the assignment rules to make sure that the tugboats have enough horsepower to tug the ship.

The Scheduling Method.
The assignment matrix only describes the assignment plan between ships and tugboats.It is required to generate the scheduling sequence of ships based on the assignment matrix and scheduling rules.The scheduling sequence is generated as in the following steps.
Step 1. Order the ships by the arriving time.Initialize   = 0,   = 0, the number of finished ships  = 0, and the initial scheduling order  flag = 1.
Step 2. Check the assignment matrix whether it is a feasible solution which satisfies constraints in (8).If it is a feasible solution, go to Step 3.
Step 3. Find the conflict ships of each ship and generate the scheduling sequence based on first-fit rule.The pseudocode of generating scheduling sequence is described in Pseudocode 1.
Step 4. Output the scheduling sequence, the start docking time and completion docking time of each ship, and the turnaround time of ships.
We give one example of scheduling ships based on assignment plan.Table 2 shows the tugboat allocation.Table 3 shows the arriving ships.
One assignment matrix between tugboats and ships is as follows:   satisfies constraints in (8) so that it is a feasible assignment.According to the scheduling method, the scheduling sequence  = ( 1 ,  3 ,  4 ,  2 ,  5 ) and turnaround time of ships is 135 minutes.The scheduling Gant graph is as in Figure 1.

Discrete PSO Algorithm for TAP-HSR Problem
TAP-HSR is in one kind of NP-hard problem and difficult for human schedulers.The goal of our research is to achieve as good as possible results in reasonable computational time.following the best location of itself and the best particle of the whole swarm.The position of th particle is represented by -dimensional vector denoted by   = ( 1 ,  2 , . . .,   ) ( = 1, 2, . . ., ).The velocity for the th particle can be described as   = (V 1 , V 2 , . . ., V  ) ( = 1, 2, . . ., ).A particle's movement is based on (10): where  is called inertia weight [33],  1 and  2 are two constant numbers which are often called social or cognitive confidence coefficients, the functions rand 1 ( ) and rand 2 ( ) can generate a random number in [0, 1],    is the position of th particle at the iteration , V   is the velocity of th particle at the iteration ,    is the local best position that th particle has reached at the iteration , and    is the global best position that all the particles have reached at the iteration .

The Improved Discrete PSO.
Because of the continuous position space of particles, standard encoding method of PSO cannot be directly adopted for discrete optimization problems.It is a challenge to employ the algorithm in combinatorial optimization problems, especially for assignment problem.In this paper, we exploit a new redefining PSO operator method and discrete updating rules of position and velocity to get the solutions for TAP-HSR problem.

Discrete Particle Representation.
The most important problem in applying PSO to TAP-HSR problem is to find a suitable particle representation method.In assignment problem, each particle represents a candidate assignment matrix with  ×  elements [34].Each element is an integer value in {0, 1}.For example, in ( 12)   denotes one assignment that assigns four tugboats to five ships.Tugboat 1 is assigned to ship 1. Tugboats 2 and 3 are assigned to ship 2. Tugboats 1 and 2 are assigned to ship 3. Tugboat 4 is assigned to ship 4. Tugboats 3 and 4 are assigned to ship 5.

Operators Redefinition
Definition 3. The position subtraction operator   ⊟   : the subtraction of two positions can be defined as XOR (exclusive OR) operation of binary matrix: Equation ( 14) gives one example of the subtraction of positions    and  +1  .
It can be seen that the subtraction of positions is to find the different elements between two positions [34].According to (11), the velocity is the subtraction of positions that can be represented by a set of the numerical pairs.(V  ) length denotes the element number of V  : Definition 4. The velocity addition operator V  ⊞ V  : the addition of velocities is considered as a union of the elements in V  or in V  : Definition 5.The velocity subtraction operator V  ⊟V  : the subtraction of velocities is considered as the relative complement elements of V  with respect to V  .V  ⊟ V  is denoted by the set of elements in V  but not in V  : ∈ (0, 0.5]  One example of the addition and subtraction of two velocities is as follows: (3,3) , (4, 2)} , (3,3) , (4, 2) , (1, 5)} , (3,3) , (4, 2)} .
(18) Definition 6.The multiply operator of coefficient and velocity  ⊠ V: let  be coefficient and let V be velocity. is a random real number in (0, 1): where  and  are random integers and ,  ∈ [1, (V) length ]. ‖V‖   represents a subelement string of V 2 from the th element to the th element in (20).
Based on Definitions 3-7, the new discrete movements of particles are followed by the following equations: 3.2.3.The Procedure of IDPSO for TAP-HSR.The pseudocode of the improved discrete PSO is listed in Pseudocode 2.

Experimental Results
In this section, we present the computational experiments to evaluate the performance of the improved discrete PSO algorithm in this paper.The algorithms are coded in Java language with the environment of Eclipse and simulated on a PC with a 2.80 GHz Intel CPU and 4 G RAM.In the experiments, three algorithms are implemented for TAP-HSR problems, including GA, the basic discrete PSO (BDPSO), and the improved discrete PSO (IDPSO) in Section 3. The basic discrete PSO is implemented without the multiple operator of coefficient and velocity  ⊠ V.The movements of particles are followed by the following equations: In IDPSO, there are two important parameters: the max iteration  max and swarm size .Through the experiments, it can be seen that when the max iteration is fixed, the optimal solution is improved with the growth of swarm size because more particles have stronger space search capabilities.However, if swarm size is excessive, the optimal solution quality can be decreased so that it is required to increase the max iteration to get a better solution.The reason is that too many particles cause the solution dispersion so that it is difficult to converge to an optimal solution.On the other hand, the program running time will increase with the increasing of the max iteration and swarm size.Therefore, it is important to select the proper max iteration and swarm size according to the problem size shown in Table 5.
Step 1. (Initializing) Initialize the parameters: the max iteration  max , the no-improvement iteration  max , swarm size , each particle's location and velocity, the local best location   and the global best location   .
Step 2. (Updating and Fitness Calculation) Set the iteration number t = 1 Repeat For each particle, generate random parameter: 1, 2, 1, 2, 1, 2 Update the velocity of each particle according to (22) Update the position of each particle according to ( To compare the performance of IDPSO, BDPSO, and GA, the experiments consisted of 12 small-sized problems and 10 middle-sized problems that are conducted.In both IDPSO and BDPSO, we use a swarm of 100 particles for smallsized experiments.The max iteration is 2000 and the noimprovement iteration is 1000.In middle-sized experiment, we use a swarm of 200 particles.The max iteration is 3000 and the no-improvement iteration is 1500.In GA, population size is 100.The max iteration is 3000 and the no-improvement iteration is 1500.The probability of crossover is 0.8.The probability of mutation is 0.01.For the three algorithms, two stopping rules are adopted.One is max-iteration rule and the other is no-improvement rule [34].The comparative experimental results obtained by the IDPSO, BDPSO, and GA on the different size problems are shown in Tables 6 and  7. Since PSO and GA algorithms are stochastic algorithms, each separate run of the program could result in a different result.We run each algorithm 20 times for each problem case.The values of   min represent the minimum turnaround time of 20 runs.The values of  avg min are the average turnaround time of the 20 runs.The values of mean time are the computational time of average computational time.
Through this comparison it is observed that the quality of solutions obtained by IDPSO is always better than that obtained using BDPSO and GA in terms of the best turnaround time and the average turnaround time.Furthermore, the improvement of solutions actually becomes greater as the size of the problems increases.The results obtained by GA are bit better than BDPSO in most of the instances.The proposed IDPSO can obtain the optimal or near-optimal solutions in all cases.
As far as computational efficiency is concerned, it is worth mentioning that GA requires less time when compared to BDPSO and IDPSO.On the other hand, IDPSO reports solutions for all problem sizes within reasonable time.Therefore, IDPSO is recommended for use in TAP-HSR problem, as it yields satisfactory results with reasonable computational time.All these experiments showed that the improved discrete PSO in this paper is an effective mechanism for solving the tugboat assignment in container terminals.

Conclusions
Although there is a huge amount of literature on discrete PSO, the PSO algorithm for tugboat assignment problem does not have rich literature.In this paper, we present a mathematic model of tugboat assignment problem under a hybrid scheduling rule to minimize the turnaround time of ships.Moreover, the improved discrete PSO is proposed to get solutions with good quality in a reasonable computational time.Some new redefined PSO operators and discrete updating rules of position and velocity are described in detail.The proposed IDPSO algorithm in this paper can be considered as more effective approach for TAP-HSR problem compared with GA.The proposed IDPSO in this paper for small-sized and middle-sized TAP-HSR is very effective but for large-size it is not approving.It needs to be improved in the future work such as combining heuristic rule with IDPSO.Furthermore, applying IDPSO to other discrete combinatorial optimization problems is also possible in further research.
: the number of tugboats : the number of ships   : the ship ,  ∈ {1, 2, 3, . . ., } ℎ  : the horsepower of tugboat    : the state of tugboat  (  = 0 denotes tugboat  is available.Otherwise,   = 1)   : the state of ship  (  = 1 denotes ship  finished docking.Otherwise,   = 0)   : the scheduling order of ship    : the length of ship  ℎ  : the horsepower of tugboat . ∈ {1, 2, 3, . . ., }   : the operation time of ship    : the arriving time of ship    : the start docking time of ship    : the completion of docking time of ship    : the least required horsepower of ship    : the least required tugboat number of ship    : decision variable denotes tugboat  assigned to ship .

Table 1 :
Assignment rules between ships and tugboats.
(6) the state of each tugboat   = 0 For  = 1 to  If (  = 0 and the state of each assigned tugboat   = 0)   =  flag Set the state of each assigned tugboat   = 1 Calculate the conflict ship set   Calculate the start docking time   according to(7)Calculate the completion docking time   according to(6) While ( < )

Table 2 :
One example of tugboat allocation.

Table 3 :
One example of arriving ships.

Table 5 :
Untill  >  max or c flag =  max Step 3. (Final stage) Output the best tugboat assignment, the ship scheduling sequence, the start docking time and the completion docking time of eachship, the turnaround time of the best assignment.The max iteration  max and swarm size .

Table 6 :
The compared results for small-sized problem.

Table 7 :
The compared results for middle-sized problem.