## 3 Methodology
### Formulation of Optimisation Problem  
Buffer allocation in queueing networks offers the potential to optimise multiple objectives by considering various performance measures such as throughput, waiting time, resource utilisation, and system stability. However, achieving a harmonious equilibrium among these objectives poses challenges due to their inherent trade-offs. The complexity of the buffer allocation problem arises from the need to determine the optimal allocation of finite buffer resources across different nodes within the network. The task involves striking a delicate balance in buffer sizes to maximise overall system performance while simultaneously addressing multiple objectives. For instance, increasing buffer sizes can alleviate congestion and enhance throughput, but it may also lead to prolonged waiting times. Conversely, reducing buffer sizes may enhance responsiveness but elevate blocking probabilities and diminish overall throughput. In order to address the buffer allocation problem in a finite queueing network, an optimisation framework is formulated with a carefully designed objective function and constraints [83]. \[Maximise\;\Theta\;(K,\mu) \tag{6}\]  
\[Maximise\;\Theta\;(N,K) \tag{7}\]  
Constraints  
\[\sum_{i=1}^{M}K_{i}\cdot C_{i}\leq\beta \tag{8}\]\[L_{i}\leq K_{i}\;\forall\;i=1,2,..M \tag{9}\]  
\[1\leq K_{i}\in\mathbb{Z}+\forall i=1,2,..M \tag{10}\]  
Equation (6) presents the system throughput as a function of arrival rates and buffer sizes in the QQN context. Similarly, Equation (7) demonstrates the throughput as a function of network population and buffer sizes in CQN. In this study, we will maintain constant arrival rates for QQN and network population for CQN to determine the optimal buffer allocation for each node, aiming to maximise throughput. However, we will conduct various scenarios in both cases, considering different arrival rates, network populations, and compositions to assess their impacts on the system's overall throughput. It is important to note that the objective function in both cases is subject to constraints. For instance, Equation (8) establishes an upper bound on the total number of buffers allocated due to budget limitations. Additionally, in a steady state, the average queue length should not exceed the buffer sizes of a given node (Equation (9)), and the number of buffers allocated must always be a positive integer with a minimum value of one (Equation (10)). The optimisation problem of buffer allocation, known for its NP-Hard nature, poses a significant challenge in finding an optimal solution in a reasonable computation time [26; 84]. Over the years, various solution approaches have been developed to tackle this intricate problem. Traditional methods, such as mathematical modelling and optimisation algorithms, have been widely employed to derive optimal buffer allocation strategies. However, due to the complexity and combinatorial nature of the problem, these approaches often require more computation and may only sometimes yield optimal solutions. As a result, simulation optimisation approaches have gained prominence in recent years. By combining the power of simulation and optimisation techniques, these approaches provide robust solutions with high accuracy, making them increasingly popular for addressing the buffer allocation optimisation problem. The buffer allocation problem in this study was optimised using the built-in optimisation engine of AnyLogic software. The authors utilised a personal computer with 8 GB of RAM and a core i3 7 th Gen processor to execute the simulation experiments. The maximum iteration count was set to 5000 runs to ensure convergence towards optimal results. Figure 4 comprehensively illustrates the sequential steps in this study's AnyLogic optimisation solution approach. The OptQuest optimisation engine in AnyLogic simulation software solves larger combinatorial problems by efficiently navigating search trees and identifying fruitful directions towards optimal solutions.