## 4 Hybrid Dispatching Scheme  
### Manual Dispatching Scheme  
In this work, manual dispatching is a macro dispatching method and can be applied primarily to the situation where the number of bicycles in a travel station \(num_{i}(t)\geq Max\). The number of bicycles in manual dispatching can be defined as \(\mathbf{k}=\left\lceil\frac{num_{i}(\mathbf{t})-Max}{k_{0}}\right\rceil\), where \(\mathbf{k_{0}}\) refers to the most bicycles each manual dispatching can handle. When \(k>k_{0}\), \(\left\lceil\frac{k}{k_{0}}\right\rceil\) times dispatching is needed. There are two difficulties in manual dispatching:  
* The first is to select a better dispatching endpoint in the dispatching region;
* The second is to choose the optimal route between the start and end of dispatching. We transform the manual dispatching scenario into the following mathematical problem as shown in Figure 2. The weight \(w_{ij}\) between station \(i\) and \(j\) which represented by edges in Figure 2 is defined as Formula (4):  
\[w_{ij}=\frac{l_{ij}}{imb_{i}+imb_{j}}+\beta \tag{4}\]  
where \(l_{ij}\) is the distance between station \(i\) and \(j(i\
eq j)\); \(imb_{i}\) or \(imb_{j}\) is respectively the imbalance of station \(i\) or \(j\), which has been defined in the previous Section 3. The parameter \(\beta\) is set to a constant value to ensure that the weight \(w_{ij}\) is always greater than 0. In Figure 2, when the manual dispatching starts to work, the system will firstly scan the global trip station and select the optimal dispatching destination according to the strategy proposed in this paper. Then, the path with the minimum cost is selected based on the weight \(w_{ij}\) between the start and end of dispatching. In the dispatching process, according to the disequilibrium and other parameters of the station, the allocation of bicycles to each station in the route is carried out. (1) **The selection of dispatching endpoint:** As mentioned earlier in our work, we use greedy idea to ensure that the total imbalance of station at the next moment in the future within IoSB is minimized. Therefore, when selecting the endpoint in each manual dispatching, we can select the station with the most imbalance in IoSB, in order to achieve a rebalancing of the station. However, there is still a problem that needs to be considered in which bicycles in a single station will randomly move in the \(R\) field of the station, which makes it difficult to select the endpoint for manual dispatching. In the paper, we choose the sum of the imbalances of all stations in the range  
Figure 2: Manual dispatching scheme. of \(R\) at time \(t\) from a station as the basis for selecting the endpoint of manual dispatching, which is \(\mathbf{imb_{i}^{R}(t)}\) and its definition is shown in Formula (5): \[imb_{i}^{R}(t)=\sum_{R}imb_{i}(t)\] (5)
2. **The determination of dispatching path:** After solving the problem of dispatching endpoints, we need to figure out the route within manual dispatching. The truth is that the cost of manual dispatching is mainly related to the dispatching distance and the farther dispatching distance bring higher dispatching cost. Therefore, when seeking the optimal path, we give priority to the imbalance and distance of the stations. The weight \(w_{ij}\) in the undirected graph that is related to distance and imbalance of station is defined as the basis for route optimization. Finally, the Dijkstra algorithm is used to figure out the optimal path of manual dispatching. The details of manual dispatching are shown in Algorithm 1. ```
0: The state information of all nodes in STG right moment \(S(t)\), the station number to be dispatched \(start\_station\), the number of bicycles to be dispatched \(k\). 0: Dispatching path \(Path\), bicycles assignment \(Alloc\).