Skip to main content
Log in

A genetic algorithm heuristic for solving the quay crane scheduling problem with time windows

  • Original Article
  • Published:
Maritime Economics & Logistics Aims and scope

Abstract

One of the most important operations in marine container terminals is quay crane scheduling. The quay crane scheduling problem (QCSP) involves scheduling groups of containers to be loaded and unloaded by each quay crane. It also requires addressing practical issues such as minimum spacing between quay cranes and precedence relationships between container groups. This study addresses the QCSP with one additional consideration: time availability of quay cranes. This problem is referred to as QCSP with time windows (QCSPTW) in the literature. This article discusses the genetic algorithm (GA) developed to solve the QCSPTW. It builds on a previously developed GA to solve the QCSP by the authors. The results of a large set of numerical experiments using benchmark instances highlight several key characteristics of the proposed solution approach: (i) the developed GA can provide near optimal solutions in a faster time for medium and large-sized instances (overall average gap is less than 3 per cent), and (ii) the developed GA leads to an improvement in the solution quality (lower vessel turnaround time) for instances with fragmented time windows (time windows that are broken up into two or more non-contiguous segments).

This is a preview of subscription content, log in via an institution to check access.

Access this article

Price excludes VAT (USA)
Tax calculation will be finalised during checkout.

Instant access to the full article PDF.

Figure 1
Figure 2
Figure 3
Figure 4

Similar content being viewed by others

References

  • Bierwirth, C. and Meisel, F. (2009) A fast heuristic for quay crane scheduling with interference constraints. Journal of Scheduling 12 (4): 345–360.

    Article  Google Scholar 

  • Chang, D., Jiang, Z., Yan, W. and He, Z. (2010) Integrating berth allocation and quay crane assignments. Transportation Research Part E 46 (6): 975–990.

    Article  Google Scholar 

  • Chung, S.H. and Choy, K.L. (2012) A modified genetic algorithm for quay crane scheduling operations. Expert Systems with Applications 39 (4): 4213–4221.

    Article  Google Scholar 

  • Daganzo, C.F. (1989) The crane scheduling problem. Transportation Research Part B 23 (3): 159–175.

    Article  Google Scholar 

  • Golias, M.M. (2011) A bi-objective berth allocation formulation to account for vessel handling time uncertainty. Journal of Maritime Economics and Logistics 13 (4): 419–441.

    Article  Google Scholar 

  • Golias, M.M. and Haralambides, H.E. (2011) Berth scheduling with variable cost functions. Journal of Maritime Economics and Logistics 13 (2): 174–189.

    Article  Google Scholar 

  • Golias, M.M., Saharidis, G.K., Boile, M., Theofanis, S. and Ierapetritou, M.G. (2009) The berth allocation problem: Optimizing vessel arrival time. Maritime Economics & Logistics 11 (4): 358–377.

    Article  Google Scholar 

  • He, J., Chang, D., Mi, W. and Yan, W. (2010) A hybrid parallel genetic algorithm for yard crane scheduling. Transportation Research Part E 46 (1): 136–155.

    Article  Google Scholar 

  • Kaveshgar, N., Huynh, N. and Khaleghi Rahimian, S. (2012) An efficient genetic algorithm for solving the quay crane scheduling problem. Expert Systems with Applications 39 (18): 13108–13117.

    Article  Google Scholar 

  • Kim, K.H. and Park, Y.M. (2004) A crane scheduling method for port container terminals. European Journal of Operations Research 156 (3): 752–768.

    Article  Google Scholar 

  • Lee, D.H., Wang, H.Q. and Miao, L. (2008) Quay crane scheduling with non-interference constraints in port container terminals. Transportation Research Part E 44 (1): 124–135.

    Article  Google Scholar 

  • Legato, P., Trunfio, R. and Meisel, F. (2011) Modeling and solving rich quay crane scheduling problems. Computers & Operations Research 39 (9): 2063–2078.

    Article  Google Scholar 

  • Lim, A., Rodrigues, B. and Xu, Z. (2007) An m-parallel crane scheduling problem with a non-crossing constraint. Naval Research Logistics 54 (2): 115–127.

    Article  Google Scholar 

  • Liu, J., Wan, Y.-W. and Wang, L. (2006) Quay crane scheduling at container terminals to minimize the maximum relative tardiness of vessel departures. Naval Research Logistics 53 (1): 60–74.

    Article  Google Scholar 

  • MATLAB Users Guide. (2011) Version 7.13.0.564 (R2011b). The MathWorks, Inc.

  • Meisel, F. (2011) The quay crane scheduling problem with time windows. Naval Research Logistics 58 (7): 619–636.

    Article  Google Scholar 

  • Meisel, F. and Bierwirth, C. (2006) Integration of berth allocation and crane assignment to improve the resource utilization at a seaport container terminal. In: Operations Research Proceedings 2005, Springer-Verlag, pp. 105–110, http://link.springer.com/chapter/10.1007%2F3-540-32539-5_17.

  • Meisel, F. and Bierwirth, C. (2011) A unified approach for the evaluation of quay crane scheduling models and algorithms. Computers and Operations Research 38 (3): 683–693.

    Article  Google Scholar 

  • Moccia, L., Cordeau, J.F., Gaudioso, M. and Laporte, G. (2006) A branch-and-cut algorithm for the quay crane scheduling problem in a container terminal. Naval Research Logistics 53 (1): 45–59.

    Article  Google Scholar 

  • Monaco, M.F. and Sammarra, M. (2011) Quay crane scheduling with time windows, one-way and spatial constraints. International Journal of Shipping and Transport Logistics 3 (4): 454–474.

    Article  Google Scholar 

  • Ng, W.C. and Mak, K.L. (2006) Quay crane scheduling in container terminals. Engineering Optimization 38 (6): 723–737.

    Article  Google Scholar 

  • Ng, W.C., Mak, K.L. and Zhang, Y.X. (2007) Scheduling trucks in container terminals using a genetic algorithm. Engineering Optimization 39 (1): 33–47.

    Article  Google Scholar 

  • Peterkofsky, R.I. and Daganzo, C.F. (1990) A branch and bound solution method for the crane scheduling problem. Transportation Research Part B 24 (3): 159–172.

    Article  Google Scholar 

  • Sammarra, M., Cordeau, J.F., Laporte, G. and Monaco, M.F. (2007) A tabu search heuristic for the quay crane scheduling problem. Journal of Scheduling 10 (4–5): 327–336.

    Article  Google Scholar 

  • Tavakkoli-Moghaddam, R., Makui, A., Salahi, S., Bazzazi, M. and Taheri, F. (2009) An efficient algorithm for solving a newmathematical model for a quay crane scheduling problem in container ports. Computers & Industrial Engineering 56 (1): 241–248.

    Article  Google Scholar 

  • Zhu, Y. and Lim, A. (2006) Crane scheduling with non-crossing constraint. Journal of the Operational Research Society 57 (12): 1464–1471.

    Article  Google Scholar 

Download references

Acknowledgements

The authors would like to thank the two reviewers for their careful review of our manuscript. We truly appreciate their suggested changes and corrections. Our manuscript has been greatly enhanced by their efforts.

Author information

Authors and Affiliations

Authors

Appendix

Appendix

Proposed genetic algorithm

GA is based on the process of natural evolution such as inheritance, mutation, selection and crossover for finding solutions to optimization problems. Several studies have successfully used GA and proved its effectiveness for solving different planning problems in container terminals including QCSP (for example, Lee et al, 2008), yard crane scheduling (for example, He et al, 2010) and yard truck scheduling (for example, Ng et al, 2007). In this study, the GA provided in the MATLAB, 2011 Global Optimization Toolbox is modified and used.

Figure A1 shows the proposed GA framework. As shown, a preprocessing step involves calculating the lower and upper bounds for the decision variables: the minimum and maximum number of tasks that can be assigned to a quay crane and the lowest and highest task number that can be processed by each crane. Step 1 of the GA involves generating an initial solution, based on the S-LOAD rule proposed by Sammarra et al (2007). The S-Load rule divides the workload equally among the cranes, but to make it work for the QCSPTW a modification is required. This study adopts the modification proposed by Meisel (2011) in which the initial solution only considers quay cranes with an open-ended time window and the workload is divided only among the open-ended quay cranes. This modification ensures that the set of tasks assigned to a quay crane would not violate its capacity. The initial solution is used as one of the individuals of the initial population. The remaining ones are generated randomly, but the specified lower and upper bounds are applied when generating them.

Figure A1
figure 5

Flowchart of methodology using GA (Kaveshgar et al, 2012).

Step 2 of the GA involves evaluating the objective function value of every individual. This is accomplished by calling the MATLAB GA function which accepts as input the number of cranes and tasks, task locations, safety margin, and so on and returns the objective function value. Step 3 determines when to stop the GA procedure. This could occur by either reaching the specified number of generations, stall generations or the functional tolerance. Until one of the stopping criteria is met, the GA procedure continues with creating the next generation (Step 4) via crossover and mutation and repeating the process (starting at Step 2).

The four key steps of the GA algorithm mentioned here are explained below.

Random initial population (Step 1 in Figure A1)

The GA creates a random initial population. The population size is adjustable and could be set in the population options.

Objective function evaluation (Step 2 in Figure A1)

One of the key parameters in MATLAB GA is the objective function. This function must be developed for each particular problem according to its unique characteristics. The objective function receives the input data (number of cranes and tasks, QC locations, safety margin, and so on) and returns the objective function value.

Stopping criteria (Step 3 in Figure A1)

  1. 1

    Generations – stops the algorithm after reaching a predefined number of generations.

  2. 2

    Stall generations – stops the algorithm if the weighted average change in the objective function value over Stall generations is less than Function tolerance.

  3. 3

    Function Tolerance – stops the algorithm when the cumulative change in the objective function value over Stall generations is less than or equal to the Function tolerance (1e–6) over the stall generations limit.

Next Generation (Step 4 in Figure A1)

GA uses the current population to create the children (that is, next generation). A group of individuals in the current population with better fitness values would contribute their genes to their children. GA creates three types of children: (1) elite children who have the best fitness values; (2) crossover children who are created by combining the parents’ genes and (3) mutation children who are created by introducing random changes (mutations) to a single parent.

The following command is used to execute the GA function in MATLAB:

[x fga]=ga(objfunc,N,[],[],[],[],LB,UB,[],intcon, options);

The input includes: the objective function (objfunc), total number of decision variables (N), lower bound and upper bound (LB and UB) and the GA parameters like population size, mutation and crossover operations and return two outputs, x (that is, quay cranes’ work schedule) and fga (that is, the objective function value).

Different parameters could be used in GA and not all of them are used for a particular problem (set to []).

Chromosome representation

Each solution in GA is called a chromosome and each gene represents a decision variable.

The chromosome shown in equation (A.1) consists of three kinds of genes: Xs are the sequence of tasks assigned to the quay cranes, Ks represent the number of tasks assigned to the quay cranes, and finally Hs represent the movement direction of each quay crane (ascending or descending).

By defining the lower and upper bound on the decision variables we can further reduce their number. These lower and upper bound procedures have been used and explained in our previous work (Kaveshgar et al, 2012). The upper bound would set a limit on the maximum number of jobs assigned to a QC and also on the further task location that could be served by a particular QC. If the precedence relationship between tasks is not satisfied, then the tasks will be swapped. The GA could create identical values for two genes in the first section of the chromosome. To overcome this shortcoming, we coded a function to validate the chromosomes.

Additional details about the developed GA can be found in Kaveshgar et al (2012). The following section describes the key modifications made to the GA to solve the QCSPTW.

Evaluating the GA objective function

The following describes the methodology used for calculating the objective function.

Avoiding interference

The location of each quay crane, the starting and finishing time of each task, and where each quay crane is working are tracked and saved. Each time a quay crane needs to start processing a new task on a bay different from the crane’s current location, it would first check the tasks on adjacent bays. If there are tasks being performed by a different quay crane that are not complete yet, the quay crane needs to wait; otherwise, it may move to the next task’s location and start its operation. The waiting time is forced in order to avoid interference; it increases the makespan of the solutions that cause QC interference and acts as a penalty for these types of solutions.

Quay crane’s destinations

Each quay crane has to maintain its initial and final position for its time windows, and each time a quay crane performs a task it has to reevaluate its position and set a destination according to its work schedule. The travel time is determined according to the positions and destinations of the quay crane. Based on the current location of the quay crane, the location of the task it will perform next and the location of other quay cranes, five different destinations are possible: (1) quay crane travels to its assigned task and processes that task, (2) quay crane needs to wait to avoid a collision with another crane and then traverses to its next task location, (3) quay crane has completed its schedule or has reached the end of the time window and therefore, needs to travel to its final position, (4) quay crane remains idle and will stay at its current position, and (5) quay crane remains idle, but needs to move in order to avoid a collision with adjacent quay cranes (Kaveshgar et al, 2012).

Quay crane’s completion time

The quay crane’s completion time is calculated based on the processing time of the tasks (P i ), and the travel time according to one of the five different possibilities stated above. The following example illustrates how the completion time is calculated.

The example shown in Figure A2 has three quay cranes and six tasks. Tasks 1, 3 and 5 are currently being loaded or unloaded by cranes 1, 2 and 3, respectively. Cranes’s 1 and 3 next tasks are tasks 2 and 6 and the second quay crane is done with its assigned tasks after completing task 3. Assuming that QC 1 finishes its task earlier than cranes 2 or 3, because of the one bay safety margin, it cannot start performing task 2 until task 3 is finished as well as task 5. The total completion time of crane 1 after processing task 2 is computed as follows:

Figure A2
figure 6

Illustration of how quay crane’s completion time is determined.

The objective function is the maximum completion time among all quay cranes.

Time window

In the QCSPTW, cranes may have multiple time windows. These time windows enforce temporal restrictions on quay cranes. In this study, if a quay crane schedule involves a time window, two situations may occur. In the first situation the quay crane temporarily leaves the vessel and would come back to resume its work schedule. In this case, the remaining tasks, if any, will be completed by the same quay crane in the next time window. In the second situation, the quay crane will leave the vessel and will not come back. Thus, the remaining tasks will need to be assigned to the nearest quay crane that will continue to work on the vessel. Reassignment of the tasks to another quay crane is a part of the chromosome validation procedure and ensures that a quay crane’s schedule would not violate its time window constraints. If a quay crane will process a departing neighboring crane’s remaining tasks, these tasks need to be rearranged in order to decrease the travel time. An example is illustrated in Figure A3.

Figure A3
figure 7

Illustration of how reassignment of tasks is performed.

Consider a situation in Figure A3 in which the set of tasks that should be done by crane 2 is 3, 4, 5 and 6. After processing task 3, the crane has reached the end of its time window and, along with crane 1, it leaves the vessel. Tasks 4, 5 and 6 are the set of remaining tasks that will be assigned to crane 3. The original set of tasks for crane 3 is 7, 8 and 9. In order to reduce the travel time of crane 3, the new set of tasks needs to be rearranged. That is, we want to arrange the tasks such that crane 3 would continue to travel in the ascending direction to finish tasks 8 and 9, and then move to task 6, and move in the descending direction to finish tasks 5 and 4. In situations when a quay crane takes on a neighboring crane’s tasks, our GA heuristic will rearrange tasks such that it will result in the crane traveling fewer numbers of bays to finish all of its assigned tasks and, if necessary, change movement direction.

Rights and permissions

Reprints and permissions

About this article

Check for updates. Verify currency and authenticity via CrossMark

Cite this article

Kaveshgar, N., Huynh, N. A genetic algorithm heuristic for solving the quay crane scheduling problem with time windows. Marit Econ Logist 17, 515–537 (2015). https://doi.org/10.1057/mel.2014.31

Download citation

  • Published:

  • Issue Date:

  • DOI: https://doi.org/10.1057/mel.2014.31

Keywords

Navigation