## 3 Problem Definitions and Formulation  
### The Definitions of BAP, QCAP, and QCSP  
**Definition 1**. : _The problem P1 is defined as a berth allocation problem (BAP), which includes 6-tuple:_  
\[P1=(S,B,C_{1},\xi,f_{1},X^{t}_{ij})\ \forall\ i\in S,\ j\in B,\ t\in T\]  
_where_ \begin{tabular}{l l} \(i\) & a ship number \\ \(j\) & a berth number \\ \(m\) & the total number of ships \\ \(n\) & the total number of berths \\ \(t\) & a time period (\(t\in T\)) \\ \(S\) & a set of ships; \(S=\{1,\ldots,m\}\) \\ \(B\) & a set of berths; \(B=\{1,\ldots,n\}\) \\ \(Df_{i}\) & the draft of ship \(i\) \\ \(L_{i}\) & the length of ship \(i\) \\ \(BL_{j}\) & the length of berth \(j\) \\ \(BD_{j}\) & the depth of berth \(j\) \\ \(C_{1}\) & a set of constraints \\ \(T\) & the planning horizon in units of hours \(T=\{1,\ldots,H\}\); \(H=168\) h for 1 week \\ \(X^{t}_{ij}\) & a decision variable; if ship \(i\) is assigned to berth \(j\) at time period \(t\) then \(X^{t}_{ij}=1\); Otherwise, \(X^{t}_{ij}=0\). \\ \(\xi\) & a collection of sets of solutions with ship-to-berth assignments; \\ \(\forall\ \xi_{g}\in\xi,\ \xi_{g}=\{\cup_{i=1}^{m}(i,j):X^{t}_{ij}=1,\ i\in S,\ j\in B,\ t\in T\}\). \\ \(f_{1}\) & an objective function maps \(\xi_{g}\) to a time/cost value \\ \end{tabular}   
The objective of \(P1\) is to find a \(\xi_{g}\) or \(\xi^{*}\) (\(\xi_{g},\ \xi^{*}\in\xi\)), where the \(\xi_{g}\) is a feasible solution while \(\xi^{*}\) is an optimal solution. Both \(\xi_{g}\) and \(\xi^{*}\) are subject to \(C_{1}\). In \(\xi_{g}\) and \(\xi^{*}\) each ship \(i\) is assigned with a berth \(j\), denoted as \((i,j)\), and as a result of this assignment, the corresponding decision variable \(X^{t}_{ij}=1\). Finding \(\xi^{*}\) is a NP-hard problem ([PERSON] et al., 2014). The assignment of ships to berths is restricted by constraints such as berth length, berth depth, ship length, and ship draft. **Definition 2**. : _The problem P2 is defined as a quay crane assignment problem (QCAP), which includes 7-tuple:_  
\[P2=(S,B,C_{2},Q,\rho,f_{2},Y^{t}_{iqk})\ i\in S,\ q\in Q,\ k\in K_{i},\ t\in T\]  
_where_  
\[\rho=(S,B,C_{2},Q,\rho,f_{2},Y^{t}_{iqk})\ i\in S,\ j\in B,\ t\in T\]  
_where_  
\[\rho=(S,B,C_{2},Q,\rho,f \begin{tabular}{l l} \(I\) & a ship number (\(i\in S\)) \\ \(K\) & a task number (\(k\in K_{i}\)) \\ \(Q\) & a quay crane number (\(q\in Q\)) \\ \(m\) & the total number of ships \\ \(n\) & the total number of berths \\ \(t\) & a time period (\(t\in T\)) \\ \(K_{i}\) & the total number of tasks of ship \(i\) \\ \(l\) & the total number of QCs \\ \(S\) & a set of ships; \(S=\{1,\ldots,m\}\) \\ \(B\) & a set of berths; \(B=\{1,\ldots,n\}\) \\ \(C_{2}\) & a set of constraints \\ \(Q\) & a set of quay crane; \(Q=\{1,\ldots,l\}\) \\ \(T\) & the planning horizon in units of hours \(T=\{1,\ldots,H\}\); \(H=168\) h (10,080 min) for 1 week. \\ \(Y^{t}_{i\eta k}\) & a decision variable; if quay crane \(q\) is assigned to process the task \(k\) of ship \(i\) at time \(t\) then \\ \(Y^{t}_{i\eta k}=1\); otherwise \(Y^{t}_{i\eta k}=0\). \\ \(\rho\) & a collection of sets of QC-to-task assignments for ships \(i=1,\ldots,m\); \\ \(\forall\ \rho_{g}\in\rho,\ \exists\ \rho_{g}=\{U^{t=m}_{i=1}(i,q,k):Y^{t}_{i\eta k }=1,q\in Q,\ k\in K_{i},\ t\in T\}\) \\ \(f_{2}\) & an objective function that maps \(\rho_{g}\) to a time/cost value \\ \end{tabular}   
The objective of \(P2\) is to find a \(\rho_{g}\) or \(\rho^{*}\) (\(\rho_{g},\rho^{*}\in\rho\)), where \(\rho_{g}\) is a feasible solution and \(\rho^{*}\) is an optimal solution. Both \(\rho_{g}\) and \(\rho^{*}\) are subject to \(C_{2}\). In \(\rho_{g}\) and \(\rho^{*}\) each task \(k\) of ship \(i\) is handled by a specific QCs \(q\), denoted as (\(i\),\(\rho\),\(k\)). As a result, the corresponding decision variable \(Y^{t}_{i\eta k}\) equals 1 (i.e., \(Y^{t}_{i\eta k}=1\)).