## 4 The Proposed Problem Formulations
### Problem Variant #1: Offset Optimization  
The first problem variant focuses on optimizing the offsets (i.e., the departing time of the first trip of each line). Subsequent departing times are fixed by the reference value defined by the city administration (\(F^{i}\)). Thus, the control variables of the problem are the offset of each line (\(X_{1}^{i}\)), which defines the whole set of departing times for all trips of each line. Auxiliary variables are needed to capture the synchronization events in each transfer zone. Binary variables \(Z_{rsb}^{ij}\) take a value 1 when trip \(r\) of line \(i\) and trip \(s\) of line \(j\) are synchronized in node \(b\) (i.e., trip \(r\) of line \(i\) arrives before trip \(s\) of line \(j\) and allows passengers to complete the transfer, i.e., walk between the corresponding bus stops and wait less than the waiting threshold for that transfer, \(W_{b}^{ij}\)). To guarantee that all lines perform the required number of trips in the planning period, possible values for the offset are limited to the interval \([0,T\;(\text{mod}\;F^{i})]\) (see a graphical description in Figure 2). The mathematical model of BSP variant #1 as a mixed integer programming (MIP) problem is formulated in Equations (1)-(5). maximize \[\sum_{b\in B}(\sum_{r=1}^{f_{i}}\sum_{s=1}^{f_{j}}Z_{rsb}^{ij}) \cdot\frac{p_{b}^{ij}\times F^{i}}{T}\] (1) subject to \[Z_{rsb}^{ij}\leq 1+\frac{(A_{rb}^{i}+d_{b}^{ij}+W_{b}^{ij})-A_{sb} ^{j}}{M}, \forall b=<i,j,d_{b}^{ij}>\in B,\] (2) \[Z_{rsb}^{ij}\leq 1+\frac{A_{sb}^{i}-(A_{rb}^{i}+d_{b}^{ij})}{M}, \forall b=<i,j,d_{b}^{ij}>\in B,\] (3) \[\text{with }A_{rb}^{i}=X_{1}^{i}+(r-1)F^{i}+TT_{b}^{i}\text{ and }A_{sb}^{j}=X_{1}^{i}+(s-1)F^{i}+TT_{b}^{j}\] \[0\leq X_{1}^{i}\leq\min(H_{i},T\;(\text{mod}\;F^{i})), \forall i\in I\] (4) \[Z_{rsb}^{ij}\in\{0,1\},\;\forall i\in I\] (5)  
The optimization problem formulates the maximization of the number of successful transfers completed in the planning period in every transfer zone (the objective function in Equation (1)). The expression \(\sum_{r=1}^{f_{i}}\sum_{s=1}^{f_{j}}Z_{rsb}^{ij}\) is the total number of successful connections between trips of each pair of lines \(i\) and \(j\) in each transfer zone \(b\). Assuming a uniform demand hypothesis, the number of transfers from a trip of line \(i\) to a trip of line \(j\) in the planning period is \(p_{b}^{ij}\times F^{i}/T\). Equations (2)-(5) define the problem constraints. Equation (1) states that the optimization will seek to activate synchronization variables \(Z_{rsb}^{ij}\)--as many as possible. Constraints determine that variables \(Z_{rsb}^{ij}\) only take the value  
Figure 2: Graphical representation of BSP variant #1. The offset (in blue) is the control variable, and subsequent departures are separated by a fixed time \(F^{i}\). if the corresponding transfer is synchronized. In Equations (2) and (3), the arrival time of trip \(r\) of line \(i\) to transfer zone \(b\) is \(A^{i}_{rb}\), and the arrival time of trip \(s\) of line \(j\) to transfer zone \(b\) is \(A^{j}_{sb}\). For an interpretation of constraint (2), consider that the limit time \(A^{i}_{r}+d^{ij}_{b}+W^{ij}_{b}\) defines the maximum time passengers are willing to wait for a transfer between trip \(r\) of line \(i\) and trip \(s\) of line \(j\) at transfer zone \(b\). Whenever the arrival time of trip \(s\) of line \(j\) does not surpass that limit, the right-hand side of Equation (2) is greater (or equal) to 1, so this is the only case when \(Z^{ij}_{rsb}\) (the synchronization variable) is allowed to take the value 1. Furthermore, it is also necessary for passengers adapting from trip \(r\) of line \(i\) to walk to the transfer point (arriving at time \(A^{i}_{rb}+d^{ij}_{b}\)) before trip \(s\) of line \(j\) arrives (at time \(A^{j}_{sb}\)). Otherwise, passengers will not complete the transfer on time. This second condition, when met, also allows \(Z^{ij}_{rsb}\) to be set to 1, as the right term of constraints in Equation (3) is positive.