# A Framework of Vehicle Usage Optimization for Tour Purposes
## 5 Methodology
### Database Model
**Step 3:** For each neighboring route vs. u  
```
distance_through_u=dist[u]+d(u,v) (distance_through_u<dist[v]) Update dist[v] = distance_through_u Update prev[v] = u Return prev
```  
**Algorithm 2** Pseudo-code for tentative distance from the starting route to v  
We can also use the Bellman-Ford algorithm. Below, we describe a standard implementation of the Bellman-Ford algorithm for finding the closest route in RC to route i using the distance function d(i,j). **Step 1:** Initialize  
Create a list 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 list of previous nodes prev, where prev[i] represents the previous route on the shortest path from the starting route to route i. **Step 2:** Repeat the following steps for RC -1 times  
For each route u in RC. For each neighboring route vs. u. ```
distance_through_u=dist[u]+d(u,v) (distance_through_u<dist[v]) Update dist[v] = distance_through_u Update prev[v] = u
```  
**Algorithm 3** Pseudo-code for distance from the starting route vs. u  
``` step 3: Check for negative-weight cycles

Repeat the following steps for each route u in RC. For each neighboring route vs. u. ### Mathematical Model

We have defined several variables to represent different aspects of the transportation system (Table 3). Firstly, \(SK\) represents the total number of seats available in the city buses operating in \(K\) city. In \(K\) city, this variable enables us to determine the maximum number of passengers buses can accommodate at any given time, helping us understand their capacity. Secondly, \(SC\) represents the total number of seats available in the city buses operating in \(B\) city. Similarto \(SK\), this variable provides us with information about the seating capacity of the buses in \(B\) city. This variable lets us determine the maximum number of passengers buses can transport in \(B\) city, helping us gauge their ability. _PC_ represents the passenger list for the destination in \(B\) city. This variable contains the details of the passengers who intend to travel to \(B\) city. It may include passenger names, contact details, and specific travel requirements. By referencing the passenger list, transportation authorities can efficiently manage passenger bookings and ensure a smooth travel experience for everyone. Next, \(PK\) represents the passenger list for the destination in \(K\) city. Similar to \(PC\), this variable comprises the details of passengers planning to travel to \(K\) city. It assists in organizing and coordinating passenger information for a seamless journey. Then, \(RK\) represents the route list for the destination in \(K\) city. This variable encompasses the various routes available within \(K\) city, along with specific information, such as bus stops, schedules, and distances. The route list is crucial for bus operators and passengers alike, as it provides essential guidance and aids in planning the most efficient and convenient travel routes within \(K\) city. _RC_ represents the route list for the destination in \(B\) city. This variable contains information about the available routes within \(B\) city, including bus stops, schedules, and distances. It helps both bus operators and passengers in planning the most efficient and convenient travel routes within \(B\) city. Lastly, \(d(i,j)\) represents the distance between route \(I\) in \(K\) city and route \(j\) in \(B\) city. This variable quantitatively measures the distance between specific routes in \(K\) and \(B\) cities. It allows transportation authorities to assess and compare the distances between different routes, aiding in decision-making processes related to route planning and optimization. Then, the algorithm can be represented as follows:

1. For each route \(i\) in \(R_{K}\): 1. Find the closest route \(j\) in \(R_{C}\) to route \(i\) using \(d(i,j)\). 2.