## 4 The Algorithms
### The DSR-Fle Variant Algorithm
#### 4.2.3 Improvement on the Spl-DSR-Fle Algorithm
For example, in the scenario of high order demand, the OSR of Ite-DSR-Fle(#1) is 0.435, while the OSR of Ite-DSR-Fle(#5) increases to 0.484, where #1 and #5 indicate that the lengths of time windows are 1 and 5, respectively. This can be explained by the fact that, the longer the time window, the more feasible routing plans can be generated, and the more orders can be finished. In summary, in the DSR-Fle variant, the proposed Ite-DSR-Fle can achieve nearly the optimal OSR, while the running time is significantly reduced over the optimal solution. ### Validate the DSS-Fle Variant Algorithm

In this section, we will validate the DSS-Fle variant algorithm, such as the advantage of order sharing over DSR variant algorithms, the advantage of flexible time selection mechanism over traditional fixed time selection heuristics, and the scalability on city-scale applications. **Experimental Setup. ** We consider that the city-scale network consists of 1000 regions, connected by a small-world like network, and each node has on average six neighbors. We consider that there are 1000 couriers with uniformly distributed depot regions. Each customer order has a fixed time window of three periods around their preferred drop-off period. The other settings are similar to that in Section 5.1. #### 5.2.1 Validate the Advantage of Order Sharing and Scalability

**Comparison Methods and Metrics. ** We compare the proposed **DSS-Fle**, **Ite-DSS-Fix**, **Ite-DSR-Fle** and **DSR-Fix** algorithms on running time and OSR. **Experimental Results. ** Table 3 shows the OSR and running time of these algorithms with varying customer order demands. From Table 3, we can observe that (1) the DSS-Fle can always produce the highest OSR, which is followed by Ite-DSR-Fle, Ite-DSS-Fix, and DSR-Fix. This result is consistent with the theoretical analysis that DSS-Fle \(\succ\) Ite-DSS-Fix, and Ite-DSR-Fix \(\succ\) DSR-Fix. This can be explained by the fact that taking the flexible time windows and order sharing (though 2-order sharing) into consideration is beneficial for improving OSRs. The experimental order-sharing advantage is consistent with the theoretical results of Lemma 3. (2) For the large-scale instances with 10,000 orders, although DSS-Fle will take about 2 min to return the delivery plans, considering its benefit of improving \(\sim\)200 orders over DSR-Fix, DSS-Fle is still a good option for food ordering apps. In food-ordering apps, customers are more concerned with whether their food can be dropped off in time or not, and the response time is tolerable within several minutes [20]. (3) With the constant couriers (e.g., 1000 in this experiment), the more customer order demands, the more number orders that can be served. For example, in the case of 2000 orders, 1140 (= 2000 \(\times\) 0.572) orders are served on average, while, in the case of 10,000 orders, nearly 1720 (= 10,000 \(\times\) 0.172) orders will be served. This can be explained by the fact that more customers will generate more feasible delivery plans, thereby improving the number of orders served. \begin{table}
\begin{tabular}{c c c c c c c c} \hline \hline \multirow{2}{*}{**Time Window**} & \multirow{2}{*}{**Demand**} & \multicolumn{4}{c}{**Order Service Rate (OSR)**} & \multicolumn{4}{c}{**Runtime (Second)**} \\ \cline{3-8}  & & **IPopt** & **Ite-DSR-Fle** & **Greedy** & **IPopt** & **Ite-DSR-Fle** & **Greedy** \\ \hline \multirow{3}{*}{One period} & Low & 0.528 & 0.502 & 0.459 & 26.4 & 0.21 & 0.05 \\  & Medium & 0.471 & 0.451 & 0.405 & 44.4 & 0.34 & 0.07 \\  & High & 0.451 & 0.435 & 0.385 & 60.1 & 0.44 & 0.09 \\ \hline \multirow{3}{*}{Three periods} & Low & 0.530 & 0.506 & 0.473 & 27.8 & 0.30 & 0.06 \\  & Medium & 0.514 & 0.487 & 0.437 & 43.8 & 0.55 & 0.07 \\  & High & 0.481 & 0.454 & 0.389 & 63.4 & 0.64 & 0.07 \\ \hline \multirow{3}{*}{Five periods} & Low & 0.576 & 0.543 & 0.488 & 33.0 & 0.45 & 0.07 \\  & Medium & 0.534 & 0.500 & 0.442 & 54.0 & 0.90 & 0.07 \\ \cline{1-1}  & High & 0.529 & 0.484 & 0.433 & 80.4 & 1.07 & 0.08 \\ \hline \hline \end{tabular}
\end{table}