## 2 Materials and Methods  
The DH-BPSO algorithm includes three key components--a minimum velocity parameter, a maximum velocity parameter, and a novel weighting factor. First, the minimum velocity parameter ensures at least one bit in a particle's position vector is flipped if the particle's velocity is calculated to be 0. The purpose of this is to encourage particles to continue searching if they reach the swarm's best location, so that nearby locations are also tested. Secondly, the maximum velocity parameter, originally proposed in [38], limits the maximum number of bits in the position vector that can change between iterations. Limiting particle velocities promotes a more granular exploration of the solution space. The third component is a dynamic weighting factor distinct to the DH-BPSO algorithm. To understand the third component, we must first distinguish the global best (Gbest) and local best (Lbest) approaches. In a Gbest approach, the velocity of each particle is calculated as a combination of the global best position and the personal best position. The global best position is the position with the lowest cost encountered by any particle in the swarm. The personal best position of a particle is the position of lowest cost encountered by that particular particle. In a Lbest approach, however, the global best position is replaced with the local best position, which refers to the lowest-cost position among a particle and its \(k\) neighboring particles. In the array of particles that represent the swarm, the \(k\) neighbors of particle of index \(i\) are those particles with indices ranging from \(i-k/2\) to \(i+k/2\) (array wraps if \(i+k/2\) is greater than the population size). In this case, \(k\) was chosen to be two, because this neighborhood size was found to be resistant to convergence to local minima in the original study by [PERSON] and [PERSON] [24]. An Lbest algorithm converges more slowly but is less likely to become trapped in local minima. The last and most important component of the DH-BPSO algorithm is the Dynamic Hybrid Weighting (DHW). The main purpose of the DHW is to provide a balance between the Lbest and Gbest approaches. In the early iterations, the particles will mostly move towards the Lbest position, but the weighting is introduced and shift towards the Gbest position after each iteration. The result is a search that explores many possibilities at the beginning but converges quickly after finding the best area. The process of the DH-BPSO algorithm is shown in Figure 1. In step 1, the DHW vector is pseudo-randomly generated. Each bit \(j\) of the DHW is determined by the following equations:  
\[p=1-\frac{\text{Iteration}}{\text{Max Iteration}} \tag{1}\]  
\[\text{DHW}[j]=(\text{rand}(0,1)>p) \tag{2}\]  
where rand(0,1) produces a pseudo-randomly generated decimal number between 0 and 1. The variable \(p\) in Equation (1) is the probability that the \(j\)th bit in the DHW will be 0, as shown in Equation (2). It varies linearly with iteration, starting at 1 at the first iteration and progressing to 0 as the iteration number approaches the max iteration. The logic used to produce the Swarm Vector from the proposed DHW is illustrated in steps 2 to 4 in the upper section of Figure 1. The logic takes the form of a multiplexer equation with the DHW bits serving as the select bit. Specifically,  
\[\text{Swarm Vector}=[(\
eg\text{DHW})\wedge\text{Lbest}]\vee(\text{DHW}\wedge \text{Gbest}), \tag{3}\]  
where \(\
eg\) is the negation (NOT) operator, \(\wedge\) is the conjunction (AND) operator, and \(\vee\) is the disjunction (OR) operator. Interpreting Equation (3), each bit of the Swarm Vector is copied from either the Lbest position vector or the Gbest position vector, depending on the value of the corresponding bit in the DHW vector. A 0 bit in the DHW vector means the corresponding bit in the Swarm Vector will be copied from the Lbest position vector. In the reverse case of a DHW bit of 1, the corresponding Gbest bit is copied into the corresponding bit position in the Swarm Vector.