Solving the Container Pre-Marshalling Problem using

Solving the Container Pre-Marshalling Problem
using Artificial Bee Colony algorithm
Ricardo Soto∗ , Broderick Crawford∗ , Cristian Galleguillos∗ , Christopher Montiel∗ ,
Rodrigo Olivares∗,¶ and Guillermo Cabrera∗,∥
∗ Pontificia
Universidad Católica de Valparaı́so, Chile
{ricardo.soto, broderick.crawford, guillermo.cabrera}@pucv.cl, {cristian.galleguillos.m, christopher.montiel.m}@mail.pucv.cl
¶ Universidad de Valparaı́so, Chile
∥ University of Auckland, New Zealand
Abstract—In a container terminal occurs the Container PreMarshalling Problem (CPMP), which deals with the necessity of
the container reshuffling in order to reduce the later movements
when containers must be retrieved. Then, CPMP is a minimization problem for finding a reshuffling sequence from an initial
bay layout (disordered) to a final bay layout (ordered) according
to certain conditions that must satisfy the retrieve preferences
of containers. This problem is known to be NP-Hard, therefore
solving such as problem could be a very hard task and extremely
complex, with high execution time and use of computational
resources. Thus using metaheuristics approaches could be a good
choice for tackling this problem. We have selected the Artificial
Bee Colony algorithm for tackling the CPMP, showing good
results that competes the state of the art works in regards of
its solution qualities.
I. I NTRODUCTION
Today in the international commerce, the majority of goods
are transported by sea using containers, and after its arrival
in the destination port, the containers are stored in the container yards. The stored containers affects different seaport
operations and resources utilization such as the waiting time
of moored vessels, transporting trucks, and worse either, the
limited storage area where containers are kept until its deliver.
When a container arrives to a storage yard, it is stacked in
a bay as they arrive, being very difficult later for following
the retrieval plan for loading these to vessels or trucks for
carrying to its final destination. Then, for ease the retrieval
plan the containers in bays, the containers must be ordered.
This problem is known as Container Pre-Marshalling Problem
(CPMP or simply PMP), which is a combinatorial optimization
problem with the aim of reshuffling the containers in a bay
in the storage yard of a seaport terminal, minimizing the
relocation moves to achieve a final layout of the bay. For
establishing the final layout, each container belongs to a
specific group determining the priority of retrieval for sending
these to the final destination.
Finding an efficient sequence for reshuffling a bay is a
hard task, but it is a improvement in the container terminal
performance for reducing the working crane times.
The difficulty and complexity of the problem depends on
the bay configuration, resulting in high computing work for
achieving optimal solutions. Therefore, an alternative for solv-
ing this kind of problem is using non traditional optimization
techniques, such as metaheuristics.
Metaheuristics (MHs) do not guarantee finding the global
optimum, but these are capable to find an acceptable solution
in a reasonable time. This techniques are convenient when
finding the optimal solution requires a high computing cost.
Is worth mentioning that algorithms based on swarm intelligence have become a topic of interest to many researchers
in artificial intelligence field. Swarm intelligence is a metaheuristic technique based on the study of collective behavior
systems present in nature.
In this paper, we have used the metaheuristic Artificial
Bee Colony algorithm (ABC algorithm), which belongs to
the Swarm Intelligence field, for solving several instances of
the CPMP, and we have compared the obtained results with
others authors. This work focuses primarily on investigating
the adaptive capacities of ABC for resolving the PMP.
The document is organized as follows. In Section II, we
provide information about related work. In Section III, the
PMP is described and its considered assumptions. Then, Section IV presents the Artificial Bee Colony algorithm, and in the
following section the implemented solution. The experiments
are analyzed and compared with different authors in Section
VI. Finally, in Section VII, we conclude and give some
guidelines for future work for this problem.
II. R ELATED WORK
For maritime container terminals a complete literature review is presented in [15], [14] and [2], these works give a
general literature review of seaport container terminal operations, including an overview of CPMP.
Distinct approaches, from approximate to exact algorithms,
has been proposed for tackling the Container Pre-Marshaling
Problem, since it is a NP-hard [3], it has attracted the attention
by researchers to improve the performance of seaports.
In [13] was presented an integer linear programming model,
considering variations of the model and also distinct heuristics
are discussed. This approach is suitable only with minimal size
instances. In [4] the Corridor Method is used, which combines
mathematical programming techniques with heuristics strategies.
And more common is the use of specific heuristics, i.e.
in [12], a heuristic that controls a neighborhood search process,
an integer programming model and three subroutines is used.
In [5], another heuristic called Lowest Priority First Heuristic
was presented which significantly outperforms other proposed
methods, also it is presented an instance generator for the
CPMP. A tree search based approach improved with specific
heuristics is specified in [1].
A more recent research using metaheuristics was presented
in [6], the classic Genetic Algorithm is modified based on a
variable chromosome length and proposing new procedures,
the experimental results shows good results but taking much
time in relation with the previous mentioned techniques.
In this research work, we present a metaheuristic approach
based on Artificial Bee Colony Algorithm for solving the
Container Pre-Marshaling Problem. As difference with other
approximate methods, we remark that our approach take less
time in finding good results, competing with the most known
techniques for tackling the CPMP.
performed subject to specific constraints, and resulting in a
final valid configuration.
Containers are stacked in bays, and a Rail-Mounted Gantry
Crane (RMGC), Figure 2, moves the containers between
stacks. The RMGCs can only access to the top container on
each stack, therefore if a container has to be removed from
the bay and is not on the top, all the other containers above of
it must be relocated to another stack. A relocation movement
is made when a container is moved from a initial stack to a
final stack, and these stacks are distinct.
III. C ONTAINER P RE -M ARSHALING P ROBLEM
The maritime transportation is the most important way for
international exchange of goods, in seaports million of containers annually are manipulated through specialized machinery.
For covering the market demands, the seaport storage (an
example of a storage yard is depicted in Figure 1), the handling
capacities has to be increased, thus the management of human
and material resources has to be improved, also the investment
in new infrastructures.
An efficient seaport will keep the vessels only the enough
time for container loading or unloading. So for reducing
the time for these activities a stowage plan is carried out.
Therefore an ordered storage yard is a good starting point,
because it has an important role in the productivity, where
occurring the principal container flows between vessels and
land transports, such as trucks and trains.
Fig. 2. RMCG working in a bay
Then, the aim in the Container Pre-Marshaling Problem is
to order a bay, which has an initial layout and reaching a final
layout with a minimal sequence of relocation movements and
subject to certain constraints that meet the container removal
order. The removal order, is guided by a priority index, where
a lowest number indicates the highest priority. Therefore, the
containers with the high priority index must be above with the
lowest ones, an example is depicted in Figure 3.
1
3
2
2
1
2
3
3
1
Initial layout
Relocation
movements
2
1
3
3
3
Final valid
layout
Fig. 3. From an initial bay layout to final valid layout
Stack
Bay
Tier
Fig. 1. Storage yard of containers
Rarely containers are stacked in the same order they will
be removed, so relocation operations are necessary for a bay
ordering. If a bay is not ordered, the extraction of containers
from a bay may delay the departure of vessels, having a
negative effect on the efficiency of the seaport, to avoid this,
pre-marshalling operations could be done. Therefore, for a
given initial layout of containers, relocation movements are
From an optimization point of view, the objective function
is to minimize the relocation movements for reaching a
valid layout of a bay. An estimator for remaining relocation
movements for reaching a valid layout is presented in [1], and
it will be used for our fitness evaluation of our solutions.
IV. A RTIFICIAL B EE C OLONY ALGORITHM
The Artificial Bee Colony (ABC) algorithm is a metaheuristic proposed in [7] by Dervis Karaboga for solving
optimization problems [8]–[11], which is inspired in the swarm
behavior of honey bees for foraging.
When the bee behavior is observed in nature, an important
concept is highlighted such as the information exchange for the
knowledge swarm formation. When a bee finds a food source
while out exploring, it returns to its hive to communicate
the food source location. The position of the food source
is communicated to other bees through the waggle dance,
which is performed in the dance area inside the hive. But,
two situations could occur in the dance area:
1) Food source incorporation: According to all dances
about food sources, it is determined which one is the
most profitable for its incorporation.
2) Food source desertion: Through the dancing for a food
source, it is determined when it is no longer profitable
and it has to be abandoned.
These concepts has been incorporated in the Artificial Bee
Colony algorithm. The ABC algorithm is a population based
metaheuristic, in this case a swarm of bees, where the solutions
of the problem are represented as food sources, these food
sources are modified by the artificial bees which act as
variation operators and it principal aim is to discover the food
source with the major quantity of nectar, which means the best
solution and near the optimal solution or optimal solution in
best case.
In this algorithm, the honey bees move into a multidimensional search space. Honey bees are classified in three groups
of bees: employed bees associated with specific food sources,
onlooker bees watching the dance of employed bees within
the hive to choose a food source; and scout bees searching for
food sources randomly. Both onlookers and scouts are also
called unemployed bees.
For a theoretical background, we give more detail in the
previous concepts:
1) Employed bees: Bees which store and share information
about their neighborhood, and these bees are associated
in particular to one food source.
2) Unemployed bees: The principal activity is exploring
the search space. Unemployed bees are sub-classified
into:
a) Scout bees: They seek new food sources around
the hive.
b) Onlooker or curious bees: They remain in the
hive, and wait for information that is provided by
employed bees, the aim is going out to search
for a potential food source based on the retrieved
information.
3) Colony: Corresponds to the swarm that belongs to the
search process, i.e. employed bees + onlooker bees.
4) Food sources: A possible solution is represented by
a food source, and the solution fitness is called the
nectar amount. Since the relation between food sources
and employed bees are equals, each employed bee is
associated with one and only one food source.
The ABC Algorithm, depicted in Algorithm 1, is composed
by 4 phases, Initialization phase, Employed bee phase, On-
looker bee phase and Scout bee phase; and these are executed
until a stop condition is reached.
Algorithm 1 Artificial Bee Colony Algorithm
Algorithm initialization
repeat
Employed Bees Phase
Onlooker Bees Phase
Scout Bees Phase
Update best solution found
until (Stop condition)
The definition of each phase is presented below:
1) Initialization phase: All food sources, X
=
{x1 , . . . , xm }, are initialized by scout bees. Each xi ∈
X holds n variables, which must be optimized, minimizing or maximizing the objective function. In general,
each food source xi could be randomly generated as in
Eq. 1, where li is the lower bound and ui the upper
bound of the j th variable in the solution vector xi .
{
}
xji = lij + (uji − lij ) ∗ rand(0, 1) ∀j = {1, . . . , n}
(1)
2) Employed bee phase: These bees have the duty of
searching new food sources with more nectar within the
neighborhood of the xi food source. The neighbor food
source is determined using the Eq. 2.
vij = xji + ϕji (xji − xjk )
(2)
The xk food source is randomly selected and ϕji ∈
[−a, a]. To evaluate a food source, the fitness value is
calculated using Eq. 3.
{
1
if (fi (xi ) ≥ 0)
1+fi (xi )
f iti (xi ) =
1 + abs (fi (xi ))
if (fi (xi ) < 0)
(3)
3) Onlooker bee phase: The onlooker bees wait in the
hive for information from the employed bees, then they
must choose their food sources. Each food source has
a probability of being selected, using a fitness based
selection technique, i.e. roulette wheel selection. After
selecting a food source, the solution is updated with the
equation 2.
4) Scout bee phase: These bees choose their food sources
randomly. Employed bees are converted in scout bees,
when their solutions cannot be improved after a number
of trials, and their solutions are abandoned. The scout
bees start to search randomly for new solutions.
V. I MPLEMENTED ALGORITHM FOR SOLVING THE CPMP
For solving the Container Pre-Marshaling Problem, we
define as a solution a vector of a movement set. This vector
is composed by (o, d) pairs with a length of k depending on
the solution sequence size. On each pair o index is the origin
configuration. But in CV3 test case, there is no valid solution
for all instances achieving the required movements.
In Table V, we compare the average of all instances in
each test case with the algorithm proposed by Caserta and
Voß (CV) [4] and Bortfeldt and Forster (BF) [1]. Since not
all instances in CV2 and CV3 could be solved, we cannot
compare our results with CV and BF. At least, CV1 solutions
are competing with BF proposal and outperformed the results
by the algorithm proposed by CV.
(3, 1)
1
2
3
stacks
Fig. 4. (3,1) container movement
stack and d index is the destination stack. E.g. a relocation
movement is depicted in Figure 4.
Therefore, the solution of the problem will be a set of
relocation movements represented in a unidimensional vector,
where even index numbers are the origin stack and odd ones
the destination stacks. An example is depicted in Figure 5,
which is a solution of Figure 3, and the solution is (3, 1); (3,
1) and (2, 3).
3
1
3
1
2
3
0
1
2
3
4
5
Fig. 5. Example of vector movements.
VI. R ESULTS AND DISCUSSIONS
In this section, experimental results are presented. The
benchmarks are obtained from [4]. There are three test cases
(CV1, CV2 and CV3), each one has 10 instances with features
presented in Table I. Each bay layout of any instance have
square shape, i.e., the positioned containers in stacks are equal
to the number of occupied tiers. The maximum height (highest
tier) is the square size of the occupied tiers, therefore there is
enough empty space for performing the relocation.
The implemented ABC algorithm was executed 10 times for
each instance of test cases, with a population size of 400 bees
and a limit of 10,000 iterations. Acceptable results are obtained
for test case CV1, but in CV2 and CV3 not all instance could
be solved (achieving a final ordered layout). In Table II, III
and IV detailed results for each instance are shown. The min
z column represents how many relocation movements could
be needed for achieving a final valid layout for the bay, also
the z̄ column shows the average of the required relocation
movements. Whether z = 0 in the min. z column, a final valid
layout has been achieved, therefore the sequence is valid, and
in the min. sequence column shows the minimum relocation
movements found for achieve a valid configuration.
In CV1 test case, all instances were properly solved and
the average of the minimal sequence for achieving a valid
configuration for all instances was 11.5.
In CV2 test case, only one instance was properly solved
and all remaining instances were close to a valid layout
Test case
CV1
CV2
CV3
CV
21.30
28.27
49.61
avg. sequence length
BF
ABC
10.50
10.80
19.10
30.40
-
TABLE V
AVERAGE SEQUENCE COMPARISON OF PROPOSED APPROACH (ABC)
AGAINST STATE - OF - THE - ART ALGORITHMS .
VII. C ONCLUSIONS AND FUTURE WORK
The Container Pre-Marshalling Problem is a combinatorial
optimization problem which could be found in any container
terminal in seaports of the world, it is for this reason that
solving and trying to reach optimal solutions, it is an exciting
and engaging challenge which has been faced throughout the
development of this research.
The ABC algorithm has shown good results for the instances
in the smallest test case, then improvements could be made
for solving the other test cases. Therefore, for future work, we
think that a good improve is a correct parameter tuning of the
MH. Correcting the proper values for parameters could lead
to improve the efficiency of algorithm, because satisfactory
results are obtained and there still some issues that can be
addressed with the correct configuration.
More specific and considering the mentioned above, we
emphasize that although not achieved optimal results in
some test cases with experimental results, and based on
observations and findings obtained during this research, we
can improve the results by combining complete search with
incomplete search techniques applied on ABC and on-line
control of the metaheuristic parameters.
ACKNOWLEDGMENT
Cristian Galleguillos and Rodrigo Olivares are supported
by Postgraduate Grant Pontificia Universidad Católica de Valparaı́so 2016. Ricardo Soto is supported by Grant CONICYT
/ FONDECYT / REGULAR / 1160455. Broderick Crawford
is supported by Grant CONICYT / FONDECYT / REGULAR
/ 1140897.
R EFERENCES
[1] Andreas Bortfeldt and Florian Forster. A tree search procedure for the
container pre-marshalling problem. European Journal of Operational
Research, 217(3):531–540, 2012.
Test case
Stacks
Stack Height
Containers
CV1
CV2
CV3
3
4
5
9
16
25
9
16
25
Priority
indexes
9
16
25
Avg. badly
placed containers
5.4
10.6
17.5
TABLE I
F EATURE OF BENCHMARK INSTANCES OF PMP
Test case
Instance
CV1
CV1 1
CV1 2
CV1 3
CV1 4
CV1 5
CV1 6
CV1 7
CV1 8
CV1 9
CV1 10
min.
z
0
0
0
0
0
0
0
0
0
0
min.
sequence
14
8
15
13
16
9
9
12
10
9
TABLE II
D ETAILED RESULTS FOR INSTANCES FROM
Test case
Instance
CV2
CV2 1
CV2 2
CV2 3
CV2 4
CV2 5
CV2 6
CV2 7
CV2 8
CV2 9
CV2 10
min.
z
2
0
0
2
2
1
1
1
1
2
min.
sequence
34
26
9
24
19
22
37
30
40
33
TABLE III
D ETAILED RESULTS FOR INSTANCES FROM
Test case
Instance
CV3
CV3 1
CV3 2
CV3 3
CV3 4
CV3 5
CV3 6
CV3 7
CV3 8
CV3 9
CV3 10
min.
z
6
4
5
5
6
7
7
5
8
5
min.
sequence
39
36
42
41
38
42
66
42
39
35
TABLE IV
D ETAILED RESULTS FOR INSTANCES FROM
avg.
z
0.3
0
0.2
0.3
0
0
0
0
0
0.1
TEST CASES
Execution
time (secs)
207.4
195.3
206.8
2065
213.6
201.8
198.8
205.3
196.7
197.7
CV1.
avg.
z
3.5
1
0
3.5
2.8
2.4
2.8
2.2
2.4
4.8
TEST CASES
Execution
time (secs)
290.0
296.9
242.7
289.2
293.7
280.4
303.6
296.6
329.4
300.8
CV2.
avg.
z
7.9
6.8
6.1
6.5
7.3
8.4
8.3
7.3
8.9
5.2
TEST CASES
Execution
time (secs)
447.0
429.0
434.1
457.4
483.8
467.0
580.6
462.8
463.0
464.1
CV3.
[2] Héctor J. Carlo, Iris F.A. Vis, and Kees Jan Roodbergen. Storage
yard operations in container terminals: Literature overview, trends,
and research directions. European Journal of Operational Research,
235(2):412 – 430, 2014. Maritime Logistics.
[3] Marco Caserta, Silvia Schwarze, and Stefan Voß. Handbook of Terminal Planning, volume 49 of Operations Research/Computer Science
Interfaces Series, chapter Container Rehandling at Maritime Container
Terminals, pages 247–269. Springer New York, 2011.
[4] Marco Caserta and Stefan Voß. Applications of Evolutionary Computing,
volume 5484 of Lecture Notes in Computer Science, chapter A Corridor
Method-Based Algorithm for the Pre-marshalling Problem, pages 788–
797. Springer Berlin Heidelberg, 2009.
[5] Christopher Expósito-Izquierdo and Belén Melián-Batista Marcos
Moreno-Vega. Pre-marshalling problem: Heuristic solution method and
instances generator. Expert Systems with Applications, 39(9):8337–8349,
2012.
[6] Mohamed Gheith, Amr B. Eltawil, and Nermine A. Harraz. Solving
the container pre-marshalling problem using variable length genetic
algorithms. Engineering Optimization, 48(4):687–705, 2016.
[7] Dervis Karaboga. An idea based on honey bee swarm for numerical
optimization. Technical report, Technical report-tr06, Erciyes university,
engineering faculty, computer engineering department, 2005.
[8] Dervis Karaboga and Bahriye Akay. A comparative study of artificial bee
colony algorithm. Applied Mathematics and Computation, 214(1):108–
132, 2009.
[9] Dervis Karaboga and Bahriye Akay. A survey: algorithms simulating
bee swarm intelligence. Artif. Intell. Rev., 31(1-4):61–85, 2009.
[10] Dervis Karaboga and Bahriye Basturk. A powerful and efficient
algorithm for numerical function optimization: artificial bee colony
(ABC) algorithm. J. Global Optimization, 39(3):459–471, 2007.
[11] Dervis Karaboga and Bahriye Basturk. On the performance of artificial
bee colony (ABC) algorithm. Appl. Soft Comput., 8(1):687–697, 2008.
[12] Yusin Lee and Shih-Liang Chao. A neighborhood search heuristic for
pre-marshalling export containers. European Journal of Operational
Research, 196(2):468–475, 2009.
[13] Yusin Lee and Nai-Yun Hsu. An optimization model for the container pre-marshalling problem. Computers & Operations Research,
34(11):3295–3313, 2007.
[14] Robert Stahlbock and Stefan Voß. Operations research at container
terminals: a literature update. OR Spectrum, 30(1):1–52, 2007.
[15] Dirk Steenken, Stefan Voß, and Robert Stahlbock. Container terminal
operation and operations research - a classification and literature review.
OR Spectrum, 26(1):3–49, 2004.