# A Framework of Vehicle Usage Optimization for Tour Purposes
## 5 Methodology
### Database Model
If vacant seats are in \(K\) city buses, search for potential passengers in destination \(B\) city. 3. If potential passengers are found: 1. Check the passenger list \(P_{C}\) for the total number of passengers. 2. If the total number of passengers exceeds the total number of vacant seats in \(K\) city buses, add the passengers to the \(K\) city passenger list \(P_{K}\). 3. Otherwise, do nothing. 2. Return the updated passenger list \(P_{K}\). This mathematical model outlines the steps in searching for potential passengers in \(B\) city destinations to fill vacant seats in \(K\) city buses. In \(B\) city destination, we use the distance between routes to find the closest route, and we check the passenger list to ensure that the number of passengers is at most the number of vacant seats in \(K\) buses. \begin{table}
\begin{tabular}{l l} \hline \hline
**Symbol** & **Meaning** \\ \hline \(S_{K}\) & number of seats in \(K\) city buses \\ \hline \(S_{C}\) & number of seats in \(B\) city buses \\ \hline \(P_{C}\) & passenger list in \(B\) city destination \\ \hline \(P_{K}\) & passenger list in \(K\) city destination \\ \hline \(R_{K}\) & route list in \(K\) city destination \\ \hline \(R_{C}\) & route list in \(B\) city destination \\ \hline \(d(i,j)\) & distance between route \(i\) in \(K\) city and route \(j\) in \(B\) city \\ \hline \hline \end{tabular}
\end{table} 
Table 3: Symbol and notation. ### Matrix Representation

A matrix is a structured arrangement that consists of rows, columns, and individual elements. The size or dimensions of a matrix are determined by the number of rows and columns it possesses. We want to represent a matrix for optimization purposes [24; 25]:

\[X= \begin{bmatrix}a&b&c\\ d&e&f\\ g&h&i\end{bmatrix} \]

\(D\) is a matrix of distances between all routes in \(K\) city and \(B\) city, where \(D(i,j)\) represents the distance between route I in \(K\) and route \(i\) in \(B\) city. The size of \(D\) is \(RK\times RC\):

\[D= \begin{bmatrix}10&20&30\\ 15&25&35\\ 12&22&32\end{bmatrix} \]

\(PC\) is a row vector representing the passenger list in \(B\) city destination, where \(PC(j)\) represents the number of potential passengers on route \(j\) in \(B\). The size of the \(PC\) is \(1\times RC\):

\[PC= \begin{bmatrix}5&3&2\end{bmatrix} \]

\(PK\) is a row vector representing the passenger list in \(K\) city destination, where \(PK(i)\) represents the number of passengers on route \(I\) in \(K\). The size of \(PK\) is \(1\times RK\):

\[PK= \begin{bmatrix}2&1&3\end{bmatrix} \]

\(SK\) is a scalar representing the number of vacant seats in \(K\) city buses. Now, let us go through the algorithm steps using the given matrices:

**Step 1:** Find the closest route in \(B\) city to each route in \(K\) city using the distances in \(D\):

For Route 1 in \(K\) city: Closest route in \(B\) city is Route 3 (\(D(1,:)=[10,20,30]\), closest distance is 30). For Route 2 in \(K\) city: Closest route in \(B\) city is Route 3 (\(D(2,:)=[15,25,35]\), closest distance is 35). For Route 3 in \(K\) city: Closest route in \(B\) city is Route 1 (\(D(3,:)=[12,22,32]\), closest distance is 12). Thus, \(j^{*}=[3,3,1]\). **Step 2:** Check if there are vacant seats in \(K\) city buses (\(SK>0\)):

Assuming \(SK=4\) (4 vacant seats). **Step 3:** Search for potential passengers in \(B\) city destination:

For Route 1 in \(K\) city: \(PC(3)=2\) (potential passengers on Route 3 in \(B\) city). For Route 2 in \(K\) city: \(PC(3)=2\) (potential passengers on Route 3 in \(B\) city). For Route 3 in \(K\) city: \(PC(1)=5\) (potential passengers on Route 1 in \(B\) city). **Step 4:** Check the passenger list \(PC\) for the total number of passengers (sum(\(PC)>0\)):

\(\text{sum}(PC)=2+2+5=9\). **Step 5:** If the total number of passengers is greater than the total number of vacant seats in \(K\) city buses, then add the passengers to the \(K\) passenger list \(PK\):

Since sum(\(PC\)) = \(9>SK=4\), we add passengers to \(PK\). **Step 6:** Update the passenger list PK:

For Route 1 in \(K\) city: \(PK(1)+=PC(3)=2+2=4\).