Skip to main content
Log in

A fill-and-reduce greedy algorithm for the container pre-marshalling problem

  • Original Paper
  • Published:
Operational Research Aims and scope Submit manuscript

Abstract

We address the Container Pre-Marshalling Problem (CPMP). The CPMP consists in ordering containers in stacks such that the retrieval of these containers is carried out without additional movements. The ordering has to be done in a minimum number of steps. Target-guided constructive heuristics report very good results in a short time. At each step, they select one poorly located container and rearrange it to an adequate position by a sequence of movements. The sequence of movements is generally generated by following a set of rules. In this work, we propose a different and more direct approach. Whenever possible, ordered stacks are filled by directly moving badly placed containers into them such that the containers become well placed. If it is not possible, then a stack is emptied or reduced to have more available slots, and the process is repeated. Unlike target-guided algorithms which rigidly adhere to a predefined sequence of movements for each badly placed container, our fill-and-reduce approach maintains the capacity to adapt to the evolving situation making choices based on the current state of the container stacks. The algorithm has shown superior performance compared to traditional target-guided heuristics, particularly in larger instances of classical benchmark sets. Furthermore, when embedded in a beam search algorithm, it reports the best results compared to traditional techniques that do not use machine learning.

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.

Fig. 1
Fig. 2
Fig. 3
Fig. 4
Fig. 5
Fig. 6
Fig. 7
Fig. 8
Fig. 9

Similar content being viewed by others

Notes

  1. It is assumed that the retrieval order is known beforehand, and no container arrives at or leaves the layout during premarshalling.

  2. All the bad-placed containers of the example are unblocked; for that reason, they can be placed in the empty stack by only performing BG moves.

  3. It is commonly assumed that the available slots in a layout always allow for the emptying of any stack in the bay, i.e., \(N \le (S-1)H\).

  4. Groups 3–3, 4–4, 5–4, 5–5, 6–6, 10-6, and 10–10 do not meet this condition.

  5. Considering that a container c is placed above a container \(c'\), if the related move is XB and \(g(c)\ge g(c')\), then \(ub_c \leftarrow ub_{c'}+1\); if the move is XB and \(g(c) < g(c')\), then \(ub_c\leftarrow 1\); and if the move is XG, then \(ub_c\leftarrow 0\).

References

  • Al-Rfou R, Alain G, Almahairi A, Angermueller C, Bahdanau D, Ballas N, Bastien F, Bayer J, Belikov A, Belopolsky A et al. (2016) Theano: a Python framework for fast computation of mathematical expressions, arXiv e-prints arXiv–1605

  • Ansótegui C, Sellmann M, Tierney K (2009) A gender-based genetic algorithm for the automatic configuration of algorithms. In: International conference on principles and practice of constraint programming, Springer, pp 142–157

  • Boge S, Goerigk M, Knust S (2020) Robust optimization for premarshalling with uncertain priority classes. Eur J Oper Res 287(1):191–210

    Article  Google Scholar 

  • Bortfeldt A, Forster F (2012) A tree search procedure for the container pre-marshalling problem. Eur J Oper Res 217(3):531–540

    Article  Google Scholar 

  • Caserta M, Voß S, Sniedovich M (2011) Applying the corridor method to a blocks relocation problem. OR Spectrum 33(4):915–929

    Article  Google Scholar 

  • da Silva MM, Toulouse S, Calvo RW (2018) A new effective unified model for solving the pre-marshalling and block relocation problems. Eur J Oper Res 271(1):40–56

    Article  Google Scholar 

  • Expósito-Izquierdo C, Melián-Batista B, Moreno-Vega M (2012) Pre-marshalling problem: Heuristic solution method and instances generator. Expert Syst Appl 39(9):8337–8349

    Article  Google Scholar 

  • Gheith M, Eltawil AB, Harraz NA (2016) Solving the container pre-marshalling problem using variable length genetic algorithms. Eng Optim 48(4):687–705

    Article  Google Scholar 

  • Gheith MS, Eltawil AB, Harraz NA (2014) A rule-based heuristic procedure for the container pre-marshalling problem. In: 2014 IEEE international conference on industrial engineering and engineering management, IEEE, pp 662–666

  • Gupta N, Nau DS (1992) On the complexity of blocks-world planning. Artif Intell 56(2–3):223–254

    Article  Google Scholar 

  • Hottung A, Tanaka S, Tierney K (2020) Deep learning assisted heuristic tree search for the container pre-marshalling problem. Comput Oper Res 113:104781

    Article  Google Scholar 

  • Hottung A, Tierney K (2016) A biased random-key genetic algorithm for the container pre-marshalling problem. Comput Oper Res 75:83–102

    Article  Google Scholar 

  • Jiménez-Piqueras C, Ruiz R, Parreño-Torres C, Alvarez-Valdes R (2023) A constraint programming approach for the premarshalling problem. Eur J Oper Res 306(2):668–678

    Article  Google Scholar 

  • Jovanovic R, Tuba M, Voß S (2017) A multi-heuristic approach for solving the pre-marshalling problem. CEJOR 25(1):1–28

    Article  Google Scholar 

  • Ketkar N (2017) Introduction to keras. In: Deep learning with Python, Springer, pp 97–111

  • Lee Y, Hsu N-Y (2007) An optimization model for the container pre-marshalling problem. Comput Oper Res 34(11):3295–3313

    Article  Google Scholar 

  • Mallows CL (1963) Patience sorting. SIAM Rev 5(4):375

    Article  Google Scholar 

  • Parreño-Torres C, Alvarez-Valdes R, Ruiz R (2019) Integer programming models for the pre-marshalling problem. Eur J Oper Res 274(1):142–154

    Article  Google Scholar 

  • Prandtstetter M (2013) A dynamic programming based branch-and-bound algorithm for the container pre-marshalling problem, Technical Report

  • Tanaka S, Tierney K (2018) Solving real-world sized container pre-marshalling problems with an iterative deepening branch-and-bound algorithm. Eur J Oper Res 264(1):165–180

    Article  Google Scholar 

  • Tanaka S, Tierney K, Parreño-Torres C, Alvarez-Valdes R, Ruiz R (2019) A branch and bound approach for large pre-marshalling problems. Eur J Oper Res 278(1):211–225

    Article  Google Scholar 

  • Tierney K, Pacino D, Voß S (2017) Solving the pre-marshalling problem to optimality with A* and IDA. Flex Serv Manuf J 29(2):223–259

    Article  Google Scholar 

  • van Brink M, van der Zwaan R (2014) A branch and price procedure for the container premarshalling problem. In: European symposium on algorithms, Springer, pp 798–809

  • Wang N, Jin B, Lim A (2015) Target-guided algorithms for the container pre-marshalling problem. Omega 53:67–77

    Article  Google Scholar 

  • Wang N, Jin B, Zhang Z, Lim A (2017) A feasibility-based heuristic for the container pre-marshalling problem. Eur J Oper Res 256(1):90–101

    Article  Google Scholar 

  • Zhang R, Jiang Z-Z, Yun WY (2015) Stack pre-marshalling problem: a heuristic-guided branch-and-bound algorithm. Int J Ind Eng 22(5):509–523

    Google Scholar 

Download references

Acknowledgements

This work is supported by the Fondecyt Project 1200035.

Author information

Authors and Affiliations

Authors

Corresponding author

Correspondence to Ignacio Araya.

Ethics declarations

Conflict of interest

All authors declare that they have no conflict of interest.

Additional information

Publisher's Note

Springer Nature remains neutral with regard to jurisdictional claims in published maps and institutional affiliations.

Appendix A: Lemmas and proofs

Appendix A: Lemmas and proofs

Lemma 1

The method select_destination runs in time O(S).

Proof

In our implementation, stacks are implemented by using arrays and maintaining an auxiliary counter variable for storing the number of ordered items in each stack (i.e., the number of consecutive items with nonincreasing group values from the bottom to the top of the stack). Each time a move involving the stack is done, the related counter is accordingly updated in O(1) execution time. Using this variable, knowing if a stack is ordered is also performed in O(1) time (we only need to compare the counter with the number of items currently in the stack; if it is equal, then the stack is ordered; otherwise, it is unordered). Taking this into account, we note that the method select_destination has a time complexity of O(S) because each set (i.e., V,\(X\!G_d\), \(X\!B_d^1\), and \(X\!B_d^2\)) can be generated in linear time in the number of stacks and the calls to the method \(\text {arg}\,\text {min}\) can also be performed in linear time in the size of these sets. \(\square\)

Lemma 2

The method select_BG_move has an execution time of \(O(S^2)\).

Proof

The method has an execution time of \(O(S^2)\) because it needs to compare group values for each valid BG move (which are at most \(S^2\)), and identifying BG moves is O(1) for each move because we simply need to verify that \(s_o\) is unordered and \(s_d\) is ordered (which is O(1) according to the proof of Lemma 1). \(\square\)

Lemma 3

The method reduction_move is performed in O(S) time.

Proof

Computing the height h(s) of a stack is O(1). Considering that each stack maintains the up-to-date sum of group values of its containers, computing the average group values is also O(1). Then, the selection of the stack is performed in O(S). As the method select_destination performs in O(S) time (according to Lemma 1), then the method reduction_move also has a time complexity of O(S). \(\square\)

Lemma 4

The method stopping_reduction_criterion runs in time O(S).

Proof

Consider that each container c stores the number \(ub_c\) of unblocked bad-placed containers of its corresponding stack without taking into account the containers above c. This number can be updated in O(1) time each time a move is performed.Footnote 5 Then, ub(s), i.e., \(ub_c\) of the top container of s, can also be retrieved in O(1). Finally, each condition of the method stopping_reduction_criterion has an execution time of O(S) because they are required to perform O(1) instructions on, at most, each stack in the layout. \(\square\)

Proof of Theorem 1

The execution time of each iteration of the FRG algorithm is dominated by the procedure select_BG_move, which, according to Lemma 2, is \(O(S^2)\). \(\square\)

Lemma 5

The method genSeq runs in time \(O(h \log h)\), with \(h=|C|\)

Proof

Note that the time complexity of the while-loop of the method is linear in h. The method LDS is \(O(h \log h)\), and if we use a classical \(O(h \log h)\) sorting algorithm for generating \(C'\), then the whole method also runs in \(O(h \log h)\) time. \(\square\)

Lemma 6

The amortized time of assigning (or not) one container by using the method unblocking_assignment is \(O(S+H\log H)\).

Proof

The method unblocking_assignment , in the worst case, performs \(|C|=h\) calls to the method genSeq (each one resulting in a sequence of size \(m=1\)), which, according to Lemma 5, is \(O(h \log h)\). As \(m=1\), the execution time of the if-block in the method unblocking_assignment (Lines 7-15) is dominated by the method select_destination_seq, which, similar to the method select_destination (Lemma 1), runs in time O(S). Thus, the while-loop runs in worst-case time \(O(h\cdot (S+h\log h))\le O(h\cdot (S+H\log H))\), with h being the number of elements to be assigned (or not). Finally, the amortized time of assigning (or not) one container is \(O(S+H\log H)\). \(\square\)

Lemma 7

Each reduction move is performed by the method reduction_move_v2 in \(O(S+H\log H)\) amortized time.

Proof

The method reduction_move_v2, in the worst case, calls unblocking_assignment first and, in further iterations, places the containers of \(s_r\) in other stacks by using the method select_destination. According to Lemma 6, assigning (or not) one container runs in amortized time \(O(S+H\log H)\). According to Lemma 1, selecting its destination runs in time O(S). Thus, each reduction move is performed in \(O(S+H\log H)\) amortized time. \(\square\)

Proof of Theorem 2

The execution time of the FRG algorithm is dominated by the methods select_BG_move, which is \(O(S^2)\) (Lemma 2), and reduction_move_v2, which is \(O(S+H\log H)\) (Lemma 7). \(\square\)

Rights and permissions

Springer Nature or its licensor (e.g. a society or other partner) holds exclusive rights to this article under a publishing agreement with the author(s) or other rightsholder(s); author self-archiving of the accepted manuscript version of this article is solely governed by the terms of such publishing agreement and applicable law.

Reprints and permissions

About this article

Check for updates. Verify currency and authenticity via CrossMark

Cite this article

Araya, I., Toledo, M. A fill-and-reduce greedy algorithm for the container pre-marshalling problem. Oper Res Int J 23, 51 (2023). https://doi.org/10.1007/s12351-023-00791-9

Download citation

  • Received:

  • Revised:

  • Accepted:

  • Published:

  • DOI: https://doi.org/10.1007/s12351-023-00791-9

Keywords

Navigation