## 1 Introduction  
Recent container shortage and port congestion scenarios have shown us that maritime port operations can no longer operate as separate fieldoms but as part of an integrated system. The ship sizes and the global maritime demands continue to increase, demanding properly coordinated operations between ships and ports [1, 2]. A port receives containers transported by trucks, trains, and ships. These cargoes are usually temporarily stored in yards and then dispatched. When a ship arrives, there are unloading and loading activities. Several factors influence the port and ship productivity, such as the way the containers are stored in yards, the sequence in which they are removed from stacks, the scheduling of vehicles to transport them to the loading area, the number of otay cranes used, their operation to load the cargo into the vessel, and the way the containers are positioned on the ship. Most of these steps require a complex decision process, which is a common and accepted practice in port operations, and the related literature to treat these tasks separately and sequentially. In the maritime transport of containers, the ships usually have a circular route, spending a long time at ports [3]. The multi-port stowage planning problem (MPSP) consists of determining how to stow a given set of containers of different types into a set of available locations on a container ship [4, 5]. The containers may have different port destinations. The containers are stored in stacks so they can be removed only by the top. If a given container must be unloaded in a port, but it is not on the top, then the containers above it must be removed first. This movement is called reshuffling, and it must be minimized to improve port efficiency. To avoid such inconvenience, it is necessary to elaborate on a suitable stowage plan. Meanwhile, in the port yard, due to space constraints, yard containers are also organized in stacks. Given this, the container relocation problem (CRP) seeks an optimal operation plan that leads into a retrieval sequence with the fewest relocations to save time and money. However, the multi-port stowage planning problem (MPSP) impacts the container relocation problem (CRP) [6] for all port yards visited along a ship's route, requiring an integrated plan of both problems to achieve better quality solutions for the shipowner and all the container terminals along the ship's route [1; 7]. Nevertheless, there are two alternatives to solve the integrated planning binary model: a sequential resolution of mathematical models or solving one monolithic mathematical model [8; 9]. Both approaches suffer from an increase in the number of binary variables and constraints that makes them impractical to obtain in an affordable time even feasible solutions. Therefore, an alternative to overcome such a difficulty is to apply heuristic approaches to solve this integrated problem. The genetic algorithm has been one interesting technique to solve combinatorial decision-making problems, because it obtains quality solutions with a reasonable computation time. In particular, this paper adapts an approach used for the joint problem of multi-port stowage planning and quay crane scheduling [9]. The paper's contributions are the following:  
1. We show the importance of developing an integrated plan for the MPSP and CRP problems to provide a better solution than the one obtained by performing isolated or simplified plans, as reported in the literature. 2. We extend the methodology employed for the MPSP in a manner that enables a fast solution to the MPSP and CRP, thus avoiding the high computational burden required by the exact approaches to solving such large-scale problems. 3. Our approach guarantees that the multi-port stowage plan obtained is executable by the port terminal and the sequence of retrieved containers from the yard is also good for the ship, thereby making the solution advantageous for all port terminals and the shipping company by reducing the total number of container movements. This paper is organized as follows.