# A Framework of Vehicle Usage Optimization for Tour Purposes
## 5 Methodology
### Database Model  
Figure 2 illustrates the backend database design in our system, highlighting the vital interaction between the \(K\) city package and the database table. When \(K\) city initiates a request, it includes crucial package details and passenger information, starting the \begin{table}
\begin{tabular}{p{56.9 pt} p{56.9 pt} p{56.9 pt} p{56.9 pt} p{56.9 pt} p{56.9 pt} p{56.9 pt}} \hline \hline
**Feature/-Similar Work** & \begin{tabular}{c} **Anzzing** \\ **Tour BD [9]** \\ \end{tabular} & **Paribah-an.com [10]** & **Shooz [11]** & \begin{tabular}{c} **Travelers of** \\ **Bangladesh [12]** \\ \end{tabular} & \
\begin{tabular}{c} **Chologburi** \\ **Bangladesh [13]** \\ \end{tabular} &
\begin{tabular}{c} **Bus Ticket** \\ **BD [14]** \\ \end{tabular} & **Our Work** \\ \hline Tour Package & Yes & No & No & No & No & No & Yes \\ \hline Booking System & Yes & Yes & Yes & Yes & Yes & Yes \\ \hline Blog & Yes & No & No & No & No & Yes \\ \hline Description & Yes & No & Yes & Yes & No & No \\ \hline Solo Trip & No & No & No & Yes & Yes & No & No \\ \hline Optimal Vehicle Usage & No & No & No & No & No & No & Yes \\ \hline Available Transportation & No & Yes & Yes & No & No & No & No \\ \hline \hline \end{tabular}
\end{table} 
Table 2: Comparative analysis of related works  
Figure 1: Client–server communication. bus allocation optimization process. The database processes this request, providing \(K\) city's knowledge and data on two other potential packages for bus optimization. The optimization component (OP) also uses a \"like search query\" to find similar routes, and the database responds with matching packages. This interaction streamlines bus allocation and route optimization within our system. Algorithm 1 shows the pseudo-code for single package data. This code initializes two arrays: \"\(K\) city\" and \"closeout\", which contain objects. It then filters the \"closest route\" array and assigns the result to a new collection called \"RelevantRoute\". ```
single package data const \(K\) city = [ ] const closeRoute = [ ] const RelevantRoute = closest route.filter () (RelevantRoute.Passengers.length \(>\) RelevantRoute.Seat) (RelevantRoute.Passengers.map(P)= \(>\)) (IP.group) \(K\).passenger.push(p)) break
```  
**Algorithm 1** Pseudo-code for seat optimization  
The code then checks if the number of passengers in the \"RelevantRoute\" array exceeds the available seats. If this condition is true, it proceeds to iterate through each passenger in the \"Passengers\" array and checks if they belong to a group. If a passenger does not belong to a group, it adds the passenger to the \"\(K\) city\" array and breaks out of the loop. In summary, this code filters a \"closest route\" array to find a relevant route, and then checks for enough available seats to accommodate all the passengers. If there are not enough seats, it adds individual passengers who are not part of a group to the \"\(K\) city\" array. Another problem arises, i.e., the distance mapping problem. We have used [PERSON]'s and [PERSON]'s algorithms to solve this problem. [PERSON]'s algorithm is commonly used to find the shortest path in a graph. In this case, we need to modify the algorithm slightly to find the closest route in the RC to route I using the distance function d(i, j) (Algorithms 2-4). **Step 1:** Initialize  
Figure 2: Back-end database table design. Create a set of unvisited nodes U and set it to contain all the routes in RC. Create a map of distances dist, where dist[i] represents the distance from route i to the starting route. Set dist[i] = infinity for all routes i, except the starting route, where dist[starting route] = 0. Create a map of previous nodes prev, where prev[i] represents the previous route on the shortest path from the starting route to route i. **Step 2:** While U is not empty  
Find the route u in U with the smallest distance dist[u]. Remove u from U.