Building Fences Straight and High: An Optimal Algorithm for Finding the Maximum Length You Can Cut k Times from Given Sticks
Given a set of n sticks of various (not necessarily different) lengths, what is the largest length so that we can cut k equally long pieces of this length from the given set of sticks? We analyze the structure of this problem and show that it essentially reduces to a single call of a selection algorithm; we thus obtain an optimal linear-time algorithm. This algorithm also solves the related envy-free stick-division problem, which Segal-Halevi et al. (ACM Trans Algorithms 13(1):1–32, 2016. ISSN: 15496325. https://doi.org/10.1145/2988232) recently used as their central primitive operation for the first discrete and bounded envy-free cake cutting protocol with a proportionality guarantee when pieces can be put to waste.
KeywordsEnvy-free stick division Envy-free allocations Fair division Building fences Stick cutting Cake cutting with waste proportional apportionment
Erel Segal-Halevi (http://cs.stackexchange.com/users/1342/) posed the original question  on Computer Science Stack Exchange. Our approach is based on observations in the answers by Abhishek Bansal (user1990169(http://cs.stackexchange.com/users/19311/)), InstructedA (http://cs.stackexchange.com/users/20169/) and FrankW (http://cs.stackexchange.com/users/13022/). Hence, even though the eventual algorithm and its presentation have been developed and refined offline with the use of a blackboard and lots of paper, the result has been the product of a small “crowd” collaboration made possible by the Stack Exchange platform. We thank Chao Xu for pointing us towards the work by Cheng and Eppstein , and for providing the observation we utilize in Sect. 4.1.
- 1.Aziz, H., Mackenzie, S.: A discrete and bounded envy-free cake cutting protocol for any number of agents. In: Annual Symposium on Foundations of Computer Science (FOCS), pp. 416–427. IEEE (2016). https://doi.org/10.1109/FOCS.2016.52
- 3.Brandt, F., Conitzer, V., Endriss, U., Lang, J., Procaccia, A.D. (eds.): Handbook of Computational Social Choice. Cambridge University Press, Cambridge (2016). ISBN: 978-1-107-06043-2Google Scholar
- 4.Brams, S.J., Taylor, A.D.: Fair Division. Cambridge University Press, Cambridge (1996). ISBN: 978-0-521-55644-6Google Scholar
- 5.Balinski, M.L., Young, H.P.: Fair Representation: Meeting the Ideal of One Man, One Vote, 2nd edn. Brookings Institution Press, Washington (2001). ISBN: 978-0-81-570111-8Google Scholar
- 6.Cheng, Z., Eppstein, D.: Linear-time algorithms for proportional apportionment. In: International Symposium on Algorithms and Computation (ISAAC) 2014. Springer (2014). https://doi.org/10.1007/978-3-319-13075-0_46
- 7.Graham, R.L., Knuth, D.E., Patashnik, O.: Concrete Mathematics: A Foundation for Computer Science. Addison-Wesley (1994). ISBN: 978-0-20-155802-9Google Scholar
- 8.Morland, T.: Building Fences (Programming Exercise from the IDI-Open 2016 Programming Contest) (2016). https://open.kattis.com/problems/fence2 (visited on 02/13/2017)
- 9.Pukelsheim, F.: Proportional Representation. Apportionment Methods and Their Applications, 1st edn. Springer, Berlin (2014). https://doi.org/10.1007/978-3-319-03856-8. ISBN: 978-3-319-03855-1
- 10.Reitzig, R., Wild S.: A Practical and Worst-Case Efficient Algorithm for Divisor Methods of Apportionment (2015). arXiv: 1504.06475
- 11.Segal-Halevi, E.: Cutting equal sticks from different sticks (2014). http://cs.stackexchange.com/q/30073 (visited on 02/16/2015)
- 12.Segal-Halevi, E., Hassidim, A., Aumann, Y.: Waste makes haste: bounded time protocols for envy-free cake cutting with free disposal. In: The 14th International Conference on Autonomous Agents and Multiagent Systems (AAMAS), May (2015)Google Scholar
- 13.Segal-Halevi, E., Hassidim, A., Aumann, Y.: Waste makes haste: bounded time algorithms for envy-free cake cutting with free disposal. ACM Trans. Algorithms 13(1), 1–32 (2016). ISSN: 15496325. https://doi.org/10.1145/2988232