# A Cost-Optimized Model for Dynamic Port Hinterland
## 3 Methodology
### Hinterland Vector  
Following the proposed model, the calculation of the hinterland from the perspective of logistics chain cost can be accomplished through a three-step problem-solving process.  
Step 1: Resolve the calculation of the minimum logistics chain cost for a product (\(p\)) and an origin (\(o\)) to a specific point (\(x,y\)) in the calculation area. By performing this process for any product and any origin, it is possible to obtain a two-dimensional matrix as follows:  
\[\begin{pmatrix}H(x,y)|_{(p_{1},\rho_{1})}&\cdots&H(x,y)|_{(p_{1},\rho_{n})}\\ \vdots&\ddots&\vdots\\ H(x,y)|_{(p_{n},\rho_{1})}&\cdots&H(x,y)|_{(p_{n},\rho_{n})}\end{pmatrix}, \tag{16}\]  
\begin{table}
\begin{tabular}{l c c c c c c c} \hline \hline  & & \multicolumn{6}{c}{**Destination Station**} \\ \cline{2-9}
**Origin Station** & **San Roque** & **Silla** & **Silla** & **Barcelona** & **Vigo** & **Bilbao** & **Madrid** & **Zaragoza** \\  & **(Algeciras)** & **(Valencia)** & **Barcelona** & **Vigo** & **Bilbao** & **Madrid** & **Zaragoza** \\ \hline \hline \multirow{2}{*}{Cordoba—El Higuerón} & - & 434.61 & 631.06 & - & 647.62 & 303.91 & 484.78 \\  & 669.60 & 512.52 & 674.97 & - & - & 254.06 & 352.89 \\  & - & - & - & - & - & 334.96 & - \\  & Madrid—Abroriagal & 453.99 & 381.41 & 489.56 & 459.65 & 491.75 & & 301.07 \\  & - & - & - & - & 742.87 & 254.06 & - \\  & - & 634.95 & 806.87 & - & 966.51 & 443.04 & 615.56 \\  & Sevilla—La Negrilla & - & 602.62 & 707.86 & 649.42 & 750.70 & 389.34 & 561.58 \\  & 537.12 & - & - & 612.98 & 515.88 & 331.41 & - \\  & Tarragona & 713.90 & - & - & 630.18 & 540.64 & 336.74 & - \\  & Zaragoza & 576.74 & - & 331.46 & 507.07 & 404.43 & 269.50 & 125.00 \\  & Barcelona & 727.51 & - & 0 & 669.26 & 581.17 & 352.70 & 281.46 \\  & Vigo & - & 671.81 & 806.40 & 0 & - & 399.22 & 552.87 \\ \hline \hline \end{tabular}
\end{table}
Table 6: \(Cont.\)where \(H(x,y)|_{(p_{n},o_{n})}\) is the hinterland value in the point \((x,y)\) of the product \(i\) and the origin \(i\). The value of \(H(x,y)|_{(p_{n},o_{n})}\) represents the port where the logistics chain is most economically efficient for this point, product, and origin.  
Step 2: A weight matrix can be constructed by assessing total import and export data for a given area, along with their respective origins, to determine the significance of each product and origin within the area's overall traffic. These weights may be calculated from two distinct perspectives: economic (based on import and export value) and volumetric (based on import and export tonnage). Given that volume is the standard metric in logistics for port throughput, this study selects the volumetric approach as the preferred measure.  
Thus, the volume matrix should be:  
\[\begin{pmatrix}\rho(p_{1},o_{1})&\cdots&\rho(p_{1},o_{n})\\ \vdots&\ddots&\vdots\\ \rho(p_{n},o_{1})&\cdots&\rho(p_{n},o_{n})\end{pmatrix}, \tag{17}\]  
where \(\rho\) is the height matrix for the area and \(\rho(p_{i},o_{i})\) is the height matrix for the product \(i\) and origin \(i\), calculated as:  
\[\rho(p_{i}.o_{i})=\frac{\sum\omega(p_{i},o_{i})}{\sum\omega}, \tag{18}\]  
where  
* \(\sum\omega(p_{i},o_{i})\) is the sum of all the traffic in this area for the product \(i\) and the origin \(i\);
* \(\sum\omega\) is the total traffic moved in this area.  
It should be noted that this matrix remains constant for any point in the calculation area.  
Step 3: Once both matrices are obtained, the calculation of the hinterland for a point can be computed as a normal n-dimensional vector as follows:  
\[(x,y)=\left[\sum_{H(p_{i},o_{i})=Port1}\rho(p_{i}.o_{i}),\sum_{H(p_{i},o_{i})= Port\ 2}\rho(p_{i}.o_{i}),\ \ldots,\sum_{H(p_{i},o_{i})=Port\ n}\rho(p_{i}.o_{i}),\ \right], \tag{19}\]  
where each position of this vector indicates the weight of the hinterland of port \(n\) at this point \((x,y)\) in the area.