# Data-Driven Modular Vehicle Scheduling in Scenic Areas
## 3 Problem Statement and Solution Method
### M1: Instant Response Model  
In this model, we assume that a vehicle is dispatched immediately upon receiving a transportation request. Figure 2 illustrates the schematic diagram of M1. In Figure 2, the miniature yellow portrait indicates a passenger, and the gray square indicates a modular vehicle. For M1, at any moment, as long as there is a passenger, we must send a vehicle, and the number of vehicles sent must meet the current moment of all passengers in the transport needs. If there is no passenger, the vehicle will not be dispatched. The formulation of M1 is given by  
\[\text{min}z_{1}=\sum_{t^{\prime}=1}^{\mathcal{T}_{2}}[x_{t^{\prime}}(k_{1}+k_{0 }(v_{t^{\prime}}-1)] \tag{1}\]  
subject to  
\[v_{t^{\prime}}\geq\frac{n_{t^{\prime}}}{c},\forall t^{\prime}\in\{1,2,\cdots, \mathcal{T}_{2}\} \tag{2}\]  
\[x_{t^{\prime}}\geq\|\big{(}(n_{t^{\prime}}\geq 1),\forall t^{\prime}\in\{1,2, \cdots,\mathcal{T}_{2}\}\big{)} \tag{3}\]  
\[x_{t^{\prime}}\in\{0,1\},\forall t^{\prime}\in\{1,2,\cdots,\mathcal{T}_{2}\} \tag{4}\]  
\[v_{t^{\prime}}\in\mathbb{N}_{0},\forall t^{\prime}\in\{1,2,\cdots,\mathcal{T} _{2}\}. \tag{5}\]  
Table 2 provides the specific definitions for each parameter used in M1. Since the scheduling strategy of M1 dispatches vehicles immediately upon passenger requests, there are no waiting costs. Consequently, the total cost, which consists solely of transport costs, can be calculated directly using function (1), \begin{table}
\begin{tabular}{c l} \hline \hline
**Notation** & **Meaning** \\ \hline \(\mathcal{T}_{2}\) & The number of periods in the testing set \(\mathcal{T}_{2}\) \\ \(t^{\prime}\) & The time index of the testing period, where \(t^{\prime}\in\{1,2,\cdots,\mathcal{T}_{2}\}\) \\ \(x_{t^{\prime}}\) & The binary decision variable, denoting whether to dispatch the fleet at period \(t^{\prime}\) or not \\ \(k_{1}\) & The cost of the leading vehicle in a fleet \\ \(k_{0}\) & The unit cost of the vehicles following the leading vehicle in a fleet \\ \(v_{t^{\prime}}\) & The sum of the vehicle requests accumulated before and at time \(t^{\prime}\) after the previous fleet sent \\ \(n_{t^{\prime}}\) & The number of travelers at time \(t^{\prime}\) \\ \(c\) & The load capacity of each vehicle \\ \hline \hline \end{tabular}
\end{table} 
Table 2: Definition of M1 parameters. Figure 2: The schematic diagram of M1. transportation costs across all times during the testing period. Constraint (2) specifies that the number of deployed vehicles, \(x_{t^{\prime}}\), must meet the transportation needs of all passengers. The indicator function \(\|\)\((*)\) in Constraint (3) is 1 if the condition within parentheses \(\|\)\((*)\) is satisfied, meaning that vehicles must be dispatched whenever there are passengers to transport at the time \(t^{\prime}\). When solving with the solver, Constraint (3) should be linearized: \(n_{t^{\prime}}\leq M\times x_{t^{\prime}},\ n_{t^{\prime}}\geq 1-M\times(1-x_{t^{ \prime}})\), where \(M\) is a huge constant. Constraints (4) and (5) define the domain of the decision variable. The pseudocode of the M1 algorithm is shown as Algorithm 1. ```
0:\(n_{t^{\prime}}\) (the number of customers at every period), \(T\) (the number of periods), \(k_{0}\) (the cost of the first vehicle), \(k_{1}\) (the unit cost of the following vehicles)
0:\(z_{1}\) (total cost)
1: Let \(z_{1}\gets 0\)
2:\(\mathcal{T}_{2}\gets 0.2T\)
3: For \(t^{\prime}\gets 1,2,\cdots,\ \mathcal{T}_{2}\) // Enumerate the possible values of the dispatch period
4: If \(v_{t^{\prime}}>0\)
5:\(x_{t^{\prime}}\gets 1\)
6:\(v_{t^{\prime}}\leftarrow\frac{n_{t^{\prime}}}{c}\)
7:\(z_{1}\gets z_{1}+x_{t^{\prime}}(k_{0}+k_{1}(v_{t^{\prime}}-1)\)
8: Else
9:\(z_{1}\gets z_{1}+0\)
10: End for
```  
**Algorithm 1**Solution process of M1  
While the instant response model effectively meets passenger travel needs on time, it also presents several drawbacks. First, frequent vehicle dispatches inevitably increase driver costs because each fleet requires a driver.