Online Carpooling Using Expander Decompositions

Authors Anupam Gupta, Ravishankar Krishnaswamy, Amit Kumar, Sahil Singla

Thumbnail PDF


  • Filesize: 0.56 MB
  • 14 pages

Document Identifiers

Author Details

Anupam Gupta
  • Computer Science Department, Carnegie Mellon University, Pittsburgh, PA, USA
Ravishankar Krishnaswamy
  • Microsoft Research, Bengaluru, India
Amit Kumar
  • Department of Computer Science and Engineering, Indian Institute of Technology, Delhi, India
Sahil Singla
  • Department of Computer Science, Princeton University, NJ, USA


We thank Thatchaphol Saranurak for explaining and pointing us to [Aaron Bernstein et al., 2020]. The last author would like to thank Navin Goyal for introducing him to [Miklós Ajtai et al., 1998].

Cite AsGet BibTex

Anupam Gupta, Ravishankar Krishnaswamy, Amit Kumar, and Sahil Singla. Online Carpooling Using Expander Decompositions. In 40th IARCS Annual Conference on Foundations of Software Technology and Theoretical Computer Science (FSTTCS 2020). Leibniz International Proceedings in Informatics (LIPIcs), Volume 182, pp. 23:1-23:14, Schloss Dagstuhl – Leibniz-Zentrum für Informatik (2020)


We consider the online carpooling problem: given n vertices, a sequence of edges arrive over time. When an edge e_t = (u_t, v_t) arrives at time step t, the algorithm must orient the edge either as v_t → u_t or u_t → v_t, with the objective of minimizing the maximum discrepancy of any vertex, i.e., the absolute difference between its in-degree and out-degree. Edges correspond to pairs of persons wanting to ride together, and orienting denotes designating the driver. The discrepancy objective then corresponds to every person driving close to their fair share of rides they participate in. In this paper, we design efficient algorithms which can maintain polylog(n,T) maximum discrepancy (w.h.p) over any sequence of T arrivals, when the arriving edges are sampled independently and uniformly from any given graph G. This provides the first polylogarithmic bounds for the online (stochastic) carpooling problem. Prior to this work, the best known bounds were O(√{n log n})-discrepancy for any adversarial sequence of arrivals, or O(log log n)-discrepancy bounds for the stochastic arrivals when G is the complete graph. The technical crux of our paper is in showing that the simple greedy algorithm, which has provably good discrepancy bounds when the arriving edges are drawn uniformly at random from the complete graph, also has polylog discrepancy when G is an expander graph. We then combine this with known expander-decomposition results to design our overall algorithm.

Subject Classification

ACM Subject Classification
  • Theory of computation → Online algorithms
  • Online Algorithms
  • Discrepancy Minimization
  • Carpooling


  • Access Statistics
  • Total Accesses (updated on a weekly basis)
    PDF Downloads


  1. Miklós Ajtai, James Aspnes, Moni Naor, Yuval Rabani, Leonard J. Schulman, and Orli Waarts. Fairness in scheduling. J. Algorithms, 29(2):306-357, 1998. Google Scholar
  2. Ryan Alweiss, Yang P. Liu, and Mehtaab Sawhney. Discrepancy minimization via a self-balancing walk. CoRR, abs/2006.14009, 2020. Google Scholar
  3. Nikhil Bansal, Haotian Jiang, Raghu Meka, Sahil Singla, and Makrand Sinha. Online discrepancy minimization for stochastic arrivals. CoRR, abs/2007.10622, 2020. Google Scholar
  4. Nikhil Bansal, Haotian Jiang, Sahil Singla, and Makrand Sinha. Online vector balancing and geometric discrepancy. In Proceedings of STOC, 2020. Google Scholar
  5. Nikhil Bansal and Joel H. Spencer. On-line balancing of random inputs. CoRR, abs/1903.06898, 2019. URL:
  6. Imre Bárány. On a Class of Balancing Games. J. Comb. Theory, Ser. A, 26(2):115-126, 1979. Google Scholar
  7. Aaron Bernstein, Jan van den Brand, Maximilian Probst Gutenberg, Danupon Nanongkai, Thatchaphol Saranurak, Aaron Sidford, and He Sun. Fully-dynamic graph sparsifiers against an adaptive adversary. CoRR, abs/2004.08432, 2020. URL:
  8. Bernard Chazelle. The discrepancy method: randomness and complexity. Cambridge University Press, 2001. Google Scholar
  9. Raaz Dwivedi, Ohad N. Feldheim, Ori Gurel-Gurevich, and Aaditya Ramdas. The power of online thinning in reducing discrepancy. Probability Theory and Related Fields, 174:103-131, 2019. Google Scholar
  10. G. H. Hardy, J. E. Littlewood, and G. Polya. Inequalities. Cambridge University Press, 2 edition, 1952. Google Scholar
  11. Haotian Jiang, Janardhan Kulkarni, and Sahil Singla. Online geometric discrepancy for stochastic arrivals with applications to envy minimization. CoRR, abs/1910.01073, 2019. Google Scholar
  12. Jiri Matousek. Geometric discrepancy: An illustrated guide, volume 18. Springer Science & Business Media, 2009. Google Scholar
  13. Yuval Peres, Kunal Talwar, and Udi Wieder. Graphical balanced allocations and the (1 + β)-choice process. Random Struct. Algorithms, 47(4):760-775, 2015. Google Scholar
  14. Joel Spencer. Balancing games. J. Comb. Theory, Ser. B, 23(1):68-74, 1977. Google Scholar
Questions / Remarks / Feedback

Feedback for Dagstuhl Publishing

Thanks for your feedback!

Feedback submitted

Could not send message

Please try again later or send an E-mail