# Priority Scheduling in the Bamboo Garden Trimming Problem

Conference paper
Part of the Lecture Notes in Computer Science book series (LNCS, volume 11376)

## Abstract

We consider the Bamboo Garden Trimming (BGT) problem introduced in [Gąsieniec et al., SOFSEM’17]. The problem is NP-hard due to its close relationship to Pinwheel scheduling. The garden with n bamboos is an analogue of a system of n machines which have to be attended (e.g., serviced) with different frequencies. During each day, bamboo $$b_i$$ grows an extra height $$h_i,$$ for $$i=1,\dots ,n$$ and, on the conclusion of the day, at most one bamboo is cut all its current height. The goal is to design a perpetual schedule of cuts to keep the height of the tallest ever bamboo as low as possible.

Our contribution is twofold, and is both theoretical and experimental. In particular, we focus on understanding what we call priority schedulings, i.e. cutting strategies where priority is given to bamboos whose current height is above a threshold greater than or equal to $$H=\sum _{i=1}^n h_i$$. Value H represents the total daily growth of the system and it is known that one cannot keep bamboos in the garden below this threshold indefinitely.

We prove that for any distribution of integer growth rates $$h_1,\dots ,h_n$$ and any priority scheduling, the system stabilises in a fixed cycle of cuts. Then, we focus on the so-called $$\mathtt {ReduceMax}_{}$$ strategy, a greedy priority scheduling which each day cuts the tallest bamboo, regardless of the growth rates distribution. $$\mathtt {ReduceMax}_{}$$ is known to provide a $$O(\log n)$$-approximation, w.r.t. the lower bound H. We prove that, if $$\mathtt {ReduceMax}_{}$$ stabilises in a round-robin type cycle, then it guarantees 2-approximation. We conjecture that $$\mathtt {ReduceMax}_{}$$ is 2-approximating for the BGT problem, hence we conduct an extended experimental evaluation, on all bounded in size integer instances of BGT, to support our conjecture and to compare $$\mathtt {ReduceMax}_{}$$ with other relevant scheduling algorithms. Our results show that $$\mathtt {ReduceMax}_{}$$ provides 2-approximation in such instances, and it always outperforms other considered strategies, even those for which better worst case approximation guarantees have been proven.

## Notes

### Acknowledgments

Authors deeply thank Leszek Gąsieniec for introducing them to the problem and for very useful discussions.

## References

1. 1.
Alshamrani, S., Kowalski, D.R., Gąsieniec, L.: How reduce max algorithm behaves with symptoms appearance on virtual machines in clouds. In: Proceedings of the IEEE International Conference CIT/IUCC/DASC/PICOM, pp. 1703–1710 (2015)Google Scholar
2. 2.
Baruah, S.K., Cohen, N.K., Plaxton, C.G., Varvel, D.A.: Proportionate progress: a notion of fairness in resource allocation. Algorithmica 15(6), 600–625 (1996)
3. 3.
Baruah, S.K., Lin, S.-S.: Pfair scheduling of generalized pinwheel task systems. IEEE Trans. Comput. 47(7), 812–816 (1998)
4. 4.
Baruah, S., Rosier, L., Tulchinsky, I., Varvel, D.: The complexity of periodic maintenance. In: Proceedings of the 1990 International Computer Symposium, pp. 315–320 (1990)Google Scholar
5. 5.
Bender, M.A., et al.: The minimum backlog problem. Theoret. Comput. Sci. 605, 51–61 (2015)
6. 6.
Bodlaender, M.H.L., Hurkens, C.A.J., Kusters, V.J.J., Staals, F., Woeginger, G.J., Zantema, H.: Cinderella versus the wicked Stepmother. In: Baeten, J.C.M., Ball, T., de Boer, F.S. (eds.) TCS 2012. LNCS, vol. 7604, pp. 57–71. Springer, Heidelberg (2012).
7. 7.
Chan, M.Y., Chin, F.Y.L.: General schedulers for the pinwheel problem based on double-integer reduction. IEEE Trans. Comput. 41(6), 755–768 (1992)
8. 8.
Chan, M.Y., Chin, F.: Schedulers for larger classes of pinwheel instances. Algorithmica 9(5), 425–462 (1993)
9. 9.
Chrobak, M., Csirik, J., Imreh, C., Noga, J., Sgall, J., Woeginger, G.J.: The buffer minimization problem for multiprocessor scheduling with conflicts. In: Orejas, F., Spirakis, P.G., van Leeuwen, J. (eds.) ICALP 2001. LNCS, vol. 2076, pp. 862–874. Springer, Heidelberg (2001).
10. 10.
Chuangpishit, H., Czyzowicz, J., Gąsieniec, L., Georgiou, K., Jurdziński, T., Kranakis, E.: Patrolling a path connecting a set of points with unbalanced frequencies of visits. In: Tjoa, A.M., Bellatreche, L., Biffl, S., van Leeuwen, J., Wiedermann, J. (eds.) SOFSEM 2018. LNCS, vol. 10706, pp. 367–380. Springer, Cham (2018).
11. 11.
Collins, A., et al.: Optimal patrolling of fragmented boundaries. In: Proceedings of the Twenty-Fifth Annual ACM Symposium on Parallelism in Algorithms and Architectures, SPAA, New York, USA, pp. 241–250 (2013)Google Scholar
12. 12.
Czyzowicz, J., Gąsieniec, L., Kosowski, A., Kranakis, E.: Boundary patrolling by mobile agents with distinct maximal speeds. In: Demetrescu, C., Halldórsson, M.M. (eds.) ESA 2011. LNCS, vol. 6942, pp. 701–712. Springer, Heidelberg (2011).
13. 13.
Gąsieniec, L., Klasing, R., Levcopoulos, C., Lingas, A., Min, J., Radzik, T.: Bamboo garden trimming problem (perpetual maintenance of machines with different attendance urgency factors). In: Steffen, B., Baier, C., van den Brand, M., Eder, J., Hinchey, M., Margaria, T. (eds.) SOFSEM 2017. LNCS, vol. 10139, pp. 229–240. Springer, Cham (2017).
14. 14.
Gąsieniec, L., Klasing, R., Martin, R., Navarra, A., Zhang, X.: Fast periodic graph exploration with constant memory. J. Comput. Syst. Sci. 74(5), 802–822 (2008)
15. 15.
Holte, R., Mok, A., Rosier, L., Tulchinsky, I., Varvel, D.: The pinwheel: a real-time scheduling problem. In: II: Software Track, Proceedings of the Twenty-Second Annual Hawaii International Conference on System Sciences, vol. 2, pp. 693–702, January 1989Google Scholar
16. 16.
Holte, R., Rosier, L., Tulchinsky, I., Varvel, D.: Pinwheel scheduling with two distinct numbers. Theoret. Comput. Sci. 100(1), 105–135 (1992)
17. 17.
Hsueh, C., Lin, K.: An optimal pinwheel scheduler using the single-number reduction technique. In: Proceedings of the 17th IEEE Real-Time Systems Symposium, RTSS 1996, pp. 196–205 (1996)Google Scholar
18. 18.
Kosowski, A., Navarra, A.: Graph decomposition for memoryless periodic exploration. Algorithmica 63(1–2), 26–38 (2012)
19. 19.
Lin, S.-S., Lin, K.-J.: A pinwheel scheduler for three distinct numbers with a tight schedulability bound. Algorithmica 19(4), 411–426 (1997)
20. 20.
Mok, A., Rosier, L., Tulchinski, I., Varvel, D.: Algorithms and complexity of the periodic maintenance problem. In: Proceedings of the 15th Symposium on Microprocessing and Microprogramming (EUROMICRO), pp. 657–664 (1989)
21. 21.
Ntafos, S.: On gallery watchmen in grids. Inf. Process. Lett. 23(2), 99–102 (1986)
22. 22.
Romer, T.H., Rosier, L.E.: An algorithm reminiscent of euclidean-gcd for computing a function related to pinwheel scheduling. Algorithmica 17(1), 1–10 (1997)
23. 23.
Serafini, P., Ukovich, W.: A mathematical model for periodic scheduling problems. SIAM J. Discret. Math. 2(4), 550–581 (1989)
24. 24.
Urrutia, J.: Art gallery and illumination problems. In: Handbook of Computational Geometry, vol. 1, no. 1, pp. 973–1027 (2000)
25. 25.
Hardy, G.H., Ramanujan, S.: Asymptotic formulas in combinatorial analysis. Proc. Lond. Math. Soc. 17, 75–115 (1918)