Skip to Main content Skip to Navigation
Journal articles

The Alternating Stock Size Problem and the Gasoline Puzzle

Alantha Newman 1 Heiko Röglin 2 Johanna Seif 3
1 G-SCOP_OC - Optimisation Combinatoire
G-SCOP - Laboratoire des sciences pour la conception, l'optimisation et la production
3 MC2 - Modèles de calcul, Complexité, Combinatoire
LIP - Laboratoire de l'Informatique du Parallélisme
Abstract : Given a set S of integers whose sum is zero, consider the problem of finding a permutation of these integers such that: (i) all prefix sums of the ordering are nonnegative, and (ii) the maximum value of a prefix sum is minimized. Kellerer et al. referred to this problem as the "Stock Size Problem" and showed that it can be approximated to within 3/2. They also showed that an approximation ratio of 2 can be achieved via several simple algorithms. We consider a related problem, which we call the "Alternating Stock Size Problem", where the number of positive and negative integers in the input set S are equal. The problem is the same as above, but we are additionally required to alternate the positive and negative numbers in the output ordering. This problem also has several simple 2-approximations. We show that it can be approximated to within 1.79. Then we show that this problem is closely related to an optimization version of the gasoline puzzle due to Lov\'asz, in which we want to minimize the size of the gas tank necessary to go around the track. We present a 2-approximation for this problem, using a natural linear programming relaxation whose feasible solutions are doubly stochastic matrices. Our novel rounding algorithm is based on a transformation that yields another doubly stochastic matrix with special properties, from which we can extract a suitable permutation.
Complete list of metadata
Contributor : Stéphan Thomassé <>
Submitted on : Friday, December 13, 2019 - 6:24:25 PM
Last modification on : Saturday, September 11, 2021 - 3:19:38 AM

Links full text




Alantha Newman, Heiko Röglin, Johanna Seif. The Alternating Stock Size Problem and the Gasoline Puzzle. ACM Transactions on Algorithms, Association for Computing Machinery, 2018, 14 (2), pp.1-23. ⟨10.1145/3178539⟩. ⟨hal-01994671⟩



Record views