Skip to main content
Log in

Minimizing the Maximum Flow Time in the Online Food Delivery Problem

  • Published:
Algorithmica Aims and scope Submit manuscript

Abstract

We study a common delivery problem encountered in nowadays online food-ordering platforms: Customers order dishes online, and the restaurant delivers the food after receiving the order. Specifically, we study a problem where k vehicles of capacity c are serving a set of requests ordering food from one restaurant. After a request arrives, it can be served by a vehicle moving from the restaurant to its delivery location. We are interested in serving all requests while minimizing the maximum flow-time, i.e., the maximum time length a customer waits to receive his/her food after submitting the order. The problem also has a close connection with the broadcast scheduling problem with maximum flow time objective. We show that the problem is hard in both offline and online settings even when \(k = 1\) and \(c = \infty \): There is a hardness of approximation of \(\Omega (n)\) for the offline problem, and a lower bound of \(\Omega (n)\) on the competitive ratio of any online algorithm, where n is number of points in the metric. We circumvent the strong negative results in two directions. Our main result is an O(1)-competitive online algorithm for the uncapaciated (i.e, \(c = \infty \)) food delivery problem on tree metrics; we also have a negative result showing that the condition \(c = \infty \) is needed. Then we consider the speed-augmentation model, in which our online algorithm is allowed to use \(\alpha \)-speed vehicles, where \(\alpha \ge 1\) is called the speeding factor. We develop an exponential time \((1+\epsilon )\)-speeding \(O(1/\epsilon )\)-competitive algorithm for any \(\epsilon > 0\). A polynomial time algorithm can be obtained with a speeding factor of \(\alpha _{\textsf{TSP}}+ \epsilon \) or \(\alpha _{\textsf{CVRP}}+ \epsilon \), depending on whether the problem is uncapacitated. Here \(\alpha _{\textsf{TSP}}\) and \(\alpha _{\textsf{CVRP}}\) are the best approximation factors for the traveling salesman (TSP) and capacitated vehicle routing (CVRP) problems respectively. We complement the results with some negative ones.

This is a preview of subscription content, log in via an institution to check access.

Access this article

Price excludes VAT (USA)
Tax calculation will be finalised during checkout.

Instant access to the full article PDF.

Fig. 1
Algorithm 1
Fig. 2
Algorithm 2
Algorithm 3

Similar content being viewed by others

Notes

  1. In FDP, we could define the completion time of a request as the time the vehicle returns to the depot after serving the request. The maximum flow time objective for the two versions differs by an O(1) factor.

  2. Equivalently we could use a metric (Vd) to describe the travel times, but for many of our results it is more convenient to use the graph G with edge lengths.

  3. Notice that the algorithm can easily check if the optimum maximum flow time is 0 or not.

  4. Recall that in the notation \({\textsf{mst}}_e\), we can view requests as vertices by ignoring their arrival times.

  5. By the definition of \(\alpha _{\textsf{TSP}}\) (resp. \(\alpha _{\textsf{CVRP}}\)), we do not know if an \(\alpha _{\textsf{TSP}}\)- (resp. \(\alpha _{\textsf{CVRP}}\)-) approximation for TSP (resp. CVRP) exists or not. So, we need to include an \(\epsilon \) term in the definition of \(\alpha \) in the the second and third cases.

References

  1. Altinkemer, K., Gavish, B.: Technical note - heuristics for delivery problems with constant error guarantees. Transp. Sci. 24, 294–297 (1990)

    Article  Google Scholar 

  2. Haimovich, M., Rinnooy Kan, A.H.: Bounds and heuristics for capacitated routing problems. Math. Oper. Res. 10(4), 527–542 (1985)

    Article  MathSciNet  Google Scholar 

  3. Charikar, M., Raghavachari, B.: The finite capacity dial-a-ride problem. In: Proceedings 39th Annual Symposium on Foundations of Computer Science (Cat. No. 98CB36280), pp. 458–467 (1998). IEEE

  4. Gupta, A., Hajiaghayi, M., Nagarajan, V., Ravi, R.: Dial a ride from k-forest. ACM Transact. Algorithms (TALG) 6(2), 1–21 (2010)

    Article  MathSciNet  Google Scholar 

  5. Hwang, D., Jaillet, P.: Online scheduling with multi-state machines. Networks 71(3), 209–251 (2018)

    Article  MathSciNet  Google Scholar 

  6. Bienkowski, M., Kraska, A., Liu, H.-H.: Traveling repairperson, unrelated machines, and other stories about average completion times. In: International Colloquium on Automata, Languages and Programming (ICALP) (2021)

  7. Feuerstein, E., Stougie, L.: On-line single-server dial-a-ride problems. Theoret. Comput. Sci. 268(1), 91–105 (2001)

    Article  MathSciNet  Google Scholar 

  8. Ascheuer, N., Krumke, S.O., Rambau, J.: Online dial-a-ride problems: minimizing the completion time. In: Annual Symposium on Theoretical Aspects of Computer Science, pp. 639–650 (2000). Springer

  9. Krumke, S.O., de Paepe, W.E., Poensgen, D., Lipmann, M., Marchetti-Spaccamela, A., Stougie, L.: On minimizing the maximum flow time in the online dial-a-ride problem. In: International Workshop on Approximation and Online Algorithms, pp. 258–269 (2005). Springer

  10. Krumke, S.O., Laura, L., Lipmann, M., Marchetti-Spaccamela, A., de Paepe, W., Poensgen, D., Stougie, L.: Non-abusiveness helps: An \(o(1)\)-competitive algorithm for minimizing the maximum flow time in the online traveling salesman problem. In: APPROX, pp. 200–214 (2002). Springer

  11. Chekuri, C., Im, S., Moseley, B.: Minimizing maximum response time and delay factor in broadcast scheduling. In: European Symposium on Algorithms, pp. 444–455 (2009). Springer

  12. Chang, J., Erlebach, T., Gailis, R., Khuller, S.: Broadcast scheduling: algorithms and complexity. ACM Transact. Algorithms (TALG) 7(4), 1–14 (2011)

    Article  MathSciNet  Google Scholar 

  13. Guo, X., Luo, K., Tang, Z.G., Zhang, Y.: The online food delivery problem on stars. Theoret. Comput. Sci. (2022). https://doi.org/10.1016/j.tcs.2022.06.007

    Article  MathSciNet  Google Scholar 

  14. Karlin, A.R., Klein, N., Oveis Gharan, S.: A (slightly) improved approximation algorithm for metric tsp. In: Proceedings of the 53rd Annual ACM SIGACT Symposium on Theory of Computing, pp. 32–45 (2021)

  15. Blauth, J., Traub, V., Vygen, J.: Improving the approximation ratio for capacitated vehicle routing. In: International Conference on Integer Programming and Combinatorial Optimization, pp. 1–14 (2021). Springer

  16. Das, A., Mathieu, C.: A quasi-polynomial time approximation scheme for euclidean capacitated vehicle routing. In: Proceedings of the Twenty-first Annual ACM-SIAM Symposium on Discrete Algorithms, pp. 390–403 (2010). SIAM

  17. Khachay, M., Dubinin, R.: Ptas for the euclidean capacitated vehicle routing problem in \(r^d\). In: International Conference on Discrete Optimization and Operations Research, pp. 193–205 (2016). Springer

  18. Labbé, M., Laporte, G., Mercure, H.: Capacitated vehicle routing on trees. Oper. Res. 39(4), 616–622 (1991)

    Article  Google Scholar 

  19. Wu, Y., Lu, X.: Capacitated vehicle routing problem on line with unsplittable demands. J. Comb. Optim., 1–11 (2020)

  20. Mathieu, C., Zhou, H.: A ptas for capacitated vehicle routing on trees. arXiv preprint arXiv:2111.03735 (2021)

  21. Cohen-Addad, V., Filtser, A., Klein, P.N., Le, H.: On light spanners, low-treewidth embeddings and efficient traversing in minor-free graphs. In: 2020 IEEE 61st Annual Symposium on Foundations of Computer Science (FOCS), pp. 589–600 (2020). IEEE

  22. Jayaprakash, A., Salavatipour, M.R.: Approximation schemes for capacitated vehicle routing on graphs of bounded treewidth, bounded doubling, or highway dimension. In: Proceedings of the 2022 Annual ACM-SIAM Symposium on Discrete Algorithms (SODA), pp. 877–893 (2022). SIAM

  23. Gørtz, I.L., Nagarajan, V., Ravi, R.: Minimum makespan multi-vehicle dial-a-ride. In: European Symposium on Algorithms, pp. 540–552 (2009). Springer

  24. Krumke, S.O., De Paepe, W.E., Poensgen, D., Stougie, L.: News from the online traveling repairman. Theoret. Comput. Sci. 295(1–3), 279–294 (2003)

    Article  MathSciNet  Google Scholar 

  25. Gørtz, I.L.: Hardness of preemptive finite capacity dial-a-ride. In: Approximation, Randomization, and Combinatorial Optimization. Algorithms and Techniques, pp. 200–211 (2006). Springer

  26. Mastrolilli, M.: Scheduling to minimize max flow time: off-line and on-line algorithms. Int. J. Found. Comput. Sci. 15(02), 385–401 (2004)

    Article  MathSciNet  Google Scholar 

  27. Bansal, N., Cloostermans, B.: Minimizing maximum flow-time on related machines. Theory Comput. 12(1), 1–14 (2016)

    Article  MathSciNet  Google Scholar 

  28. Kellerer, H., Tautenhahn, T., Woeginger, G.J.: Approximability and nonapproximability results for minimizing total flow time on a single machine. In: Miller, G.L. (ed.) Proceedings of the Twenty-Eighth Annual ACM Symposium on the Theory of Computing, Philadelphia, Pennsylvania, USA, May 22-24, 1996, pp. 418–426 (1996). https://doi.org/10.1145/237814.237989. ACM

  29. Batra, J., Garg, N., Kumar, A.: Constant factor approximation algorithm for weighted flow time on a single machine in pseudo-polynomial time. In: 2018 IEEE 59th Annual Symposium on Foundations of Computer Science (FOCS), pp. 778–789 (2018). IEEE Computer Society

  30. Feige, U., Kulkarni, J., Li, S.: A polynomial time constant approximation for minimizing total weighted flow-time. In: Proceedings of the Thirtieth Annual ACM-SIAM Symposium on Discrete Algorithms, pp. 1585–1595 (2019). SIAM

  31. Rohwedder, L., Wiese, A.: A \((2+\varepsilon )\)-approximation algorithm for preemptive weighted flow time on a single machine. arXiv preprint arXiv:2011.05676 (2020)

  32. Bansal, N., Chan, H.-L.: Weighted flow time does not admit o(1)-competitive algorithms. In: Proceedings of the Twentieth Annual ACM-SIAM Symposium on Discrete Algorithms. SODA’09, pp. 1238–1244. Society for Industrial and Applied Mathematics, USA (2009)

  33. Bartal, Y., Muthukrishnan, S.: Minimizing maximum response time in scheduling broadcasts. In: Proceedings of the Eleventh Annual ACM-SIAM Symposium on Discrete Algorithms, pp. 558–559 (2000)

  34. Kalyanasundaram, B., Pruhs, K., Velauthapillai, M.: Scheduling broadcasts in wireless networks. In: European Symposium on Algorithms, pp. 290–301 (2000). Springer

  35. Bansal, N., Charikar, M., Khanna, S., Naor, J.: Approximating the average response time in broadcast scheduling. In: SODA, vol. 5, pp. 215–221 (2005). Citeseer

  36. Kalyanasundaram, B., Pruhs, K.: Speed is as powerful as clairvoyance. J. ACM (JACM) 47(4), 617–643 (2000)

    Article  MathSciNet  Google Scholar 

  37. Phillips, C.A., Stein, C., Torng, E., Wein, J.: Optimal time-critical scheduling via resource augmentation. In: Proceedings of the Twenty-ninth Annual ACM Symposium on Theory of Computing, pp. 140–149 (1997)

  38. Epstein, L., van Stee, R.: Optimal on-line flow time with resource augmentation. Discret. Appl. Math. 154(4), 611–621 (2006)

    Article  MathSciNet  Google Scholar 

  39. Bansal, N., Chan, H.-L., Khandekar, R., Pruhs, K., Schieber, B., Stein, C.: Non-preemptive min-sum scheduling with resource augmentation. In: 48th Annual IEEE Symposium on Foundations of Computer Science (FOCS’07), pp. 614–624 (2007). IEEE

  40. Im, S., Li, S., Moseley, B., Torng, E.: A dynamic programming framework for non-preemptive scheduling problems on multiple machines. In: Proceedings of the Twenty-sixth Annual ACM-SIAM Symposium on Discrete Algorithms, pp. 1070–1086 (2014). SIAM

  41. Lucarelli, G., Thang, N.K., Srivastav, A., Trystram, D.: Online non-preemptive scheduling in a resource augmentation model based on duality. In: European Symposium on Algorithms (ESA 2016), 57, 1–17 (2016)

  42. Choudhury, A.R., Das, S., Garg, N., Kumar, A.: Rejecting jobs to minimize load and maximum flow-time. In: Proceedings of the Twenty-Sixth Annual ACM-SIAM Symposium on Discrete Algorithms, pp. 1114–1133 (2014). SIAM

  43. Lucarelli, G., Moseley, B., Thang, N.K., Srivastav, A., Trystram, D.: Online non-preemptive scheduling on unrelated machines with rejections. In: Proceedings of the 30th on Symposium on Parallelism in Algorithms and Architectures, pp. 291–300 (2018)

  44. Lucarelli, G., Moseley, B., Thang, N.K., Srivastav, A., Trystram, D.: Online non-preemptive scheduling to minimize weighted flow-time on unrelated machines. arXiv preprint arXiv:1804.08317 (2018)

Download references

Acknowledgements

The extended abstract of this paper has been published in Proceedings of the 33rd International Symposium on Algorithms and Computation (ISAAC 2022). KL Luo is supported by the National Natural Science Foundation of China, Grant No. 72071157. YH Zhang is supported by the National Natural Science Foundation of China, Grant No. 62102251.

Author information

Authors and Affiliations

Authors

Corresponding authors

Correspondence to Xiangyu Guo, Shi Li, Kelin Luo or Yuhao Zhang.

Ethics declarations

Conflict of interest

The authors declare no competing interests.

Additional information

Publisher's Note

Springer Nature remains neutral with regard to jurisdictional claims in published maps and institutional affiliations.

Rights and permissions

Springer Nature or its licensor (e.g. a society or other partner) holds exclusive rights to this article under a publishing agreement with the author(s) or other rightsholder(s); author self-archiving of the accepted manuscript version of this article is solely governed by the terms of such publishing agreement and applicable law.

Reprints and permissions

About this article

Check for updates. Verify currency and authenticity via CrossMark

Cite this article

Guo, X., Li, S., Luo, K. et al. Minimizing the Maximum Flow Time in the Online Food Delivery Problem. Algorithmica 86, 907–943 (2024). https://doi.org/10.1007/s00453-023-01177-1

Download citation

  • Received:

  • Accepted:

  • Published:

  • Issue Date:

  • DOI: https://doi.org/10.1007/s00453-023-01177-1

Keywords

Navigation