# Optimal Integrated Single-Framework Algorithm for the Multi-Level School Bus Network Problem
## 3 Model
\right.\\ \textbf{D}^{s}_{ik}=distance\ travelled\ up\ to\ student\ i\ of\ school\ s\ by\ bus\ k\\ \textbf{TotalD}_{k}=total\ distance\ travelled\ by\ bus\ k\\ \textbf{AT}^{s}_{i}=Vehicle\ arrival\ time\ to\ the\ student\ i\ of\ school\ s\ home\\ \textbf{WT}^{s}_{i}=In\ vehicle\ travel\ time\ of\ student\ i\ of\ school\ s\\ \textbf{UC}_{k}=\text{used\ capacity\ of\ bus\ k}\]  
**Objective function**  
\[z=\text{min}{\sum}_{s=1}^{n^{t}}\sum_{i=1}^{t_{i}}C_{T}\ *WT^{s}_{i}+{\sum}_{k=1}^{K}C_{O}*TotalD_{k} \tag{1}\]  
**Constraints**  
\[{\sum}_{k=1}^{K}y^{s}_{ik}=1 i=1,2,\ldots,I^{t}_{s}s=1,\ \ldots,\ n^{t} \tag{2}\]  
\[{\sum}_{i=1}^{t_{i}}y^{s}_{ik}\leq Mv^{s}_{k} k=1,2,\ldots.K,\ s=1,\ \ldots,\ n^{t} \tag{3}\]\[\sum_{s=1}^{n^{t}}v_{k}^{s}\leq 1\hskip 56.905512 ptk=1,2.\ldots,K \tag{4}\]  
\[2*(\alpha_{ijk}^{s}\ +\alpha_{jik}^{s})\leq\ \left(y_{k}^{s}+y_{jk}^{s}\right) \hskip 14.226378 pti,j=1,2,\ \ldots.I_{s}^{t};i\
eq j.\ k=1,2\ldots,K,\ s=1,\ \ldots,n_{t} \tag{5}\]  
\[\sum_{k=1}^{K}\sum_{j=1}^{l_{s}^{t}}\alpha_{ijk}^{s}+\sum_{k=1}^{K}\alpha_{i0k }^{s}\geq 1\hskip 56.905512 pti=1,\ \ldots,l_{s}^{t}\ \ s=1,2,\ldots,n^{t} \tag{6}\]  
\[\sum_{k=1}^{K}\sum_{i=1}^{l_{s}^{t}}\alpha_{ijk}^{s}+\sum_{k=1}^{K}\alpha_{0 jk }^{s}\geq 1\hskip 56.905512 pts=1,2,...,n^{t},j=1,2,\ldots,l_{s}^{t} \tag{7}\]  
\[\sum_{j=1}^{l_{s}^{t}}\alpha_{0 jk}^{s}\ =v_{k}^{s}\hskip 56.905512 pts=1,\ \ldots,n_{t}\hskip 28.452756 ptk=1,2\ldots,K \tag{8}\]  
\[\sum_{i=1}^{l_{s}^{t}}\alpha_{i0k}^{s}\ =v_{k}^{s}\hskip 56.905512 pts=1,\ \ldots,n_{t} \hskip 28.452756 ptk=1,2\ldots,K \tag{9}\]  
\[D_{jk}^{s}\geq D_{ik}^{s}-M\Big{(}1-\alpha_{ijk}^{s}\Big{)}+d_{ij}^{s}\hskip 28.452756 pt s=1,\ldots,n_{t},\ \ i\&j=1,2,\ldots,l_{s}^{t};i\
eq jk=1,2\ldots,K \tag{10}\]  
\[{\sum}_{k=1}^{K}y^{s}_{ik}=1 i=1,2,\ldots,I^{t}_{s}s=1,\ \ldots,\ n^{t} \tag{2}\]0  
\[{\sum}_{k=1}^{K}y^{s}_{ik}=1 i=1,2,\ldots,I^{t}_{s}s=1,\ \ldots,\ n^{t} \tag{2}\]1  
\[{\sum}_{k=1}^{K}y^{s}_{ik}=1 i=1,2,\ldots,I^{t}_{s}s=1,\ \ldots,\ n^{t} \tag{2}\]2  
\[{\sum}_{k=1}^{K}y^{s}_{ik}=1 i=1,2,\ldots,I^{t}_{s}s=1,\ \ldots,\ n^{t} \tag{2}\]3  
\[{\sum}_{k=1}^{K}y^{s}_{ik}=1 i=1,2,\ldots,I^{t}_{s}s=1,\ \ldots,\ n^{t} \tag{2}\]4  
\[{\sum}_{k=1}^{K}y^{s}_{ik}=1 i=1,2,\ldots,I^{t}_{s}s=1,\ \ldots,\ n^{t} \tag{2}\]5  
\[{\sum}_{k=1}^{K}y^{s}_{ik}=1 i=1,2,\ldots,I^{t}_{s}s=1,\ \ldots,\ n^{t} \tag{2}\]6  
\[{\sum}_{k=1}^{K}y^{s}_{ik}=1 i=1,2,\ldots,I^{t}_{s}s=1,\ \ldots,\ n^{t} \tag{2}\]7  
\[{\sum}_{k=1}^{K}y^{s}_{ik}=1 i=1,2,\ldots,I^{t}_{s}s=1,\ \ldots,\ n^{t} \tag{2}\]8  
\[{\sum}_{k=1}^{K}y^{s}_{ik}=1 i=1,2,\ldots,I^{t}_{s}s=1,\ \ldots,\ n^{t} \tag{2}\]9  
Formula (1) is the objective function of the problem. It tries to minimize the waiting time for all students and the total driving distance. Constraint (2) specifies that each student at each school is served by exactly one bus. Constraint (3) ensures that if a student is assigned to a bus, the related bus is considered as a used bus for that school. Equation (4) makes sure that each bus is only assigned to one school. Equations (5)-(7) define the path of each bus. Equations (6) and (7) ensure that each passenger is assigned a path. Also, zero is the index used for the origin/destination. Each path starts from an origin and ends at the destination (in the morning, the destination of the bus is the related school). Equations (8) and (9) ensure that every route starts from the origin and ends at the school (for the morning), and multiple trips on the bus are not allowed. Equations (10) and (11) calculate the total traveled distance up to student i of school s. For the first student picked up, the total traveled distance of the bus is the direct distance from the bus's origin to the student's home. Equation (12) defines the arrival time of the bus for students. Equation (13) calculates the bus waiting time for students, and Equation (14) is a time ratio constraint. It ensures that the total waiting time of each student is less than the direct travel time of the student to the school multiplied by the direct index.