## 4 The Proposed Approach
### The Two-Stage Optimisation Model
#### 4.1.2 Stage 2: The Optimisation Model  
Once feasible loading configurations have been identified, the second stage involves an optimisation model that assigns these configurations to trucks. The model is shown in this section and takes into account a variety of criteria while adhering to the PI principles. Table 3 displays the sets, parameters, decision variables, and their particular expressions.  
\begin{table}
\begin{tabular}{l l} \hline \hline
**Component** & **Description** \\ \hline
**Sets** \\ \(I\) & Set of all containers available at the hub \\ \(J\) & Set of all trucks available for container assignment \\ \(D\) & Set of possible destinations for the containers \\ \(P\) & Set of potential PI-containers formed from combinations of \(I\) \\ \hline
**Parameters** \\ \(occupation_{i}\) & Occupation level of container \(i\), where \(i\in I\) \\ \(capacity_{j}\) & Capacity of truck \(j\), where \(j\in J\) \\ \(H\) & Standard size of the containers \\ \hline
**Decision Variables** \\ \(assign_{tp}\) & Binary variable; 1 if PI-container \(p\) is assigned to truck \(t\) and 0 \\  & otherwise, where \(t\in J\) and \(p\in P\) \\ \hline \hline \end{tabular}
\end{table}
Table 3: Model components: sets, parameters, and decision variables.  
Figure 2: An overview of the proposed approaches: 2 Stage-Opt and MASS models.  
Objective Function Formulation  
The objective function, as presented in Equation (1), aims to minimise the total non-utilised space within each truck by reducing the number of empty spaces across all assigned containers. This is achieved by penalising the unused capacity in each truck assignment, which directly impacts both efficiency and environmental sustainability. The function calculates the sum of all the container assignments to a truck, multiplying each assignment by the standardised size of the containers and the final occupation level within each PI-container. By doing so, the model prioritises filling trucks to their capacity as closely as possible, thereby reducing the number of trips required.  
\[\min\sum_{t\in T}\sum_{p\in P}\sum_{i\in I}assign_{tp}\cdot H\cdot(capacity_{ j}-occupation_{i}) \tag{1}\]  
Constraint of Truck Assignment  
To ensure logistical efficiency, each PI-container is assigned to exactly one truck, avoiding the complications of multiple assignments. Refer to Equation (2) for the formal constraint:  
\[\sum_{t\in T}assign_{tp}\leq 1\quad\forall p\in P \tag{2}\]  
Flow of Containers to PI-Containers  
The constraint in Equation (3) ensures that every container \(c_{i}\) is assigned exactly once by summing over PI-containers \(p\) that include \(c_{i}\). This formulation guarantees that no container \(c_{i}\) is either omitted or duplicated across different PI-containers, thereby ensuring that each container is correctly and efficiently included within one, and only one, PI-container. In this context, the index \(c_{i}\) denotes a specific container within set \(I\), where \(i\) represents the unique identifier for each container in the set of all available containers.  
\[\sum_{p\in P:c_{i}\in p}\sum_{t\in T}assign_{tp}=1\quad\forall c_{i}\in I \tag{3}\]  
The third key constraint ensures that the total occupation of containers assigned to any one truck does not exceed the vehicle's capacity. This is critical to prevent overloading, enhancing both safety and economic efficiency. See Equation (4) for details:  
\[\sum_{p\in P}assign_{tp}\cdot occupation_{p}\leq capacity_{t}\quad\forall t\in T \tag{4}\]  
Here, \(assign_{tp}\) is the binary decision variable indicating whether PI-container \(p\) is assigned to truck \(t\). The variable \(occupation_{p}\) represents the total space occupied by PI-container \(p\), and \(capacity_{t}\) is the maximum allowable capacity of truck \(t\). This equation ensures that the sum of the occupations of all PI-containers assigned to a truck does not exceed the truck's capacity. It applies to every truck \(t\) in the set \(T\), safeguarding against overutilisation and promoting the optimal logistical efficiency.