#
Bamboo Garden Trimming Problem: Priority Schedulings^{ †}

^{1}

^{2}

^{*}

^{†}

## Abstract

**:**

## 1. Introduction

#### 1.1. Related Work

#### 1.2. Achieved Results

**Conjecture**

**1.**

## 2. Notation

## 3. Theoretical Results

#### 3.1. Priority Schedulings

**Definition**

**1.**

**Definition**

**2.**

**Definition**

**3.**

**Definition**

**4.**

**Fact**

**1.**

**Proof.**

**Lemma**

**1**

**.**Given a τ-priority scheduling ${\sigma}_{\tau}$ and an input I, there exists a time $t,$ such that, for any ${t}^{\prime}>t$, it holds $V({C}^{{t}^{\prime}})\le n\tau ,$ where ${C}^{{t}^{\prime}}\in E(I,{\sigma}_{\tau})$.

**Proof.**

**Corollary**

**1**

**.**Given a τ-priority scheduling ${\sigma}_{\tau}$ and an input I, there exist two days t and ${t}^{\prime}$, where $t<{t}^{\prime},$ ${C}^{t}={C}^{{t}^{\prime}}$, and ${C}^{t},{C}^{{t}^{\prime}}\in E(I,{\sigma}_{\tau})$.

**Proof.**

- ${L}_{E}=({C}_{1}={C}^{{t}^{\prime}},{C}_{2}={C}^{{t}^{\prime}+1},{C}_{3},\dots ,{C}_{{\lambda}_{E}})$, where ${C}^{{t}^{\prime}}$ is the first configuration belonging to ${L}_{E}$, reached from ${C}^{0}$, and ${\lambda}_{E}=\left|{L}_{E}\right|$ is the length of the cycle, i.e., the number of configurations in ${L}_{E}$.
- ${l}^{t}$ is the height of the bamboo cut in ${C}_{t}\in {L}_{E}$. It is assumed ${l}^{t}=0$ if no bamboo is cut.
- ${c}_{i}$ is the number of times bamboo ${b}_{i}$ is cut in ${L}_{E}$, for each $i=1,\dots ,n$, which is equal to the number of relative maximum heights reached by ${b}_{i}$ in the cycle.
- ${m}_{i}^{j}$ is the relative maximum height reached by ${b}_{i}$ in the cycle just before the jth cut, for $i=1,\dots ,n$ and $j=1,\dots ,{c}_{i}$. Note that, by definition, during day t, ${l}^{t}={m}_{i}^{j}$ for some values of i and j.
- ${M}_{i}={\displaystyle \sum _{j=1}^{{c}_{j}}}{m}_{i}^{j}$ is the sum of the relative maximum heights reached by ${b}_{i}$.

**Lemma**

**2**

**.**Given an execution E of a priority scheduling, then $\frac{1}{{\lambda}_{E}}{\displaystyle \sum _{t=1}^{{\lambda}_{E}}}{l}^{t}=H.$

**Proof.**

**Lemma**

**3**

_{E})

**.**Given an execution E of a priority scheduling and an index $i\in \{1,2,\dots ,n\},$ then

**Proof.**

**Corollary**

**2**

**.**Given an execution E of a priority scheduling, and two indices $i,j\in \{1,2,\dots ,n\}$, then:

#### 3.2. $\mathtt{ReduceMax}$ Scheduling

**Corollary**

**3**

`ReduceMax`)

**.**Let E be an execution of $\mathtt{ReduceMax}$. Then, $\overline{{M}_{E}}\phantom{\rule{3.33333pt}{0ex}}=\phantom{\rule{3.33333pt}{0ex}}H$.

**Lemma**

**4**

**.**Let E be an execution of $\mathtt{ReduceMax}$. For any two indices $i,j\in \{1,2,\dots ,n\}$ such that ${h}_{i}\ge {h}_{j}$, it holds ${c}_{i}\ge {c}_{j}$.

**Proof.**

**Corollary**

**4**

**.**If E is an execution of $\mathtt{ReduceMax}$, ${h}_{i}={h}_{j}$ implies ${c}_{i}={c}_{j}$.

**Lemma**

**5**

**.**Let E be an execution of $\mathtt{ReduceMax}$. Then,

**Proof.**

**Corollary**

**5**

**.**Let E be an execution of $\mathtt{ReduceMax}$. Then,

**Lemma**

**6**

**.**Given an input I, let E be an execution of $\mathtt{ReduceMax}$. Then:

**Proof.**

**Corollary**

**6**

**.**Let E be an execution of $\mathtt{ReduceMax}$. Then,

**Corollary**

**7**

**.**Let E be an execution of $\mathtt{ReduceMax}$. If E is a minimum-cycle execution, then $M({L}_{E})<2H$.

**Proof.**

**Theorem**

**1**

**.**Given an input I, let E be an execution obtained via $\mathtt{ReduceMax}$. Then, E is not a minimum-cycle execution if

**Proof.**

## 4. Experimental Results

- $\mathtt{ReduceMax}$ (${\mathtt{RMax}}_{}$, for short): This is the heuristic which performance is the most relevant to the experiments. In particular, in [1], based on [27], a $O(logn)$-approximation guarantee has been established. However, the interest is in determining whether such a bound is tight in practice, i.e., whether the logarithmic factor is an accurate estimation. The strategy works in a greedy fashion by cutting each day the tallest bamboo.
- ${\mathtt{ReduceFastest}}_{2}$ (${\mathtt{RFast}}_{2}$, for short): This is another greedy strategy introduced in [1]. It guarantees 4-approximation. However, this method requires ordering the input configurations according to the non-increasing order of the bamboos’ growth rates. In fact, each day it cuts the fastest growing bamboo (the one having the biggest ${h}_{i}$) among those whose height exceeds threshold $2H$. If none of the bamboos is taller than $2H$, no cuts are performed.
- ${\mathtt{ReduceFastest}}_{1}$ (${\mathtt{RFast}}_{1}$, for short): This is a variant of ${\mathtt{RFast}}_{2}$, introduced here for the first time, obtained by decreasing the threshold from $2H$ to H, and by allowing the cut of the fastest growing bamboo also below the threshold. Basically, if none of the bamboos has reached height H, the fastest growing bamboo is cut. This is a natural extension of ${\mathtt{RFast}}_{2}$, and the aim of defining it is to check whether there are chances to obtain better performance with respect to ${\mathtt{RFast}}_{2}$ and ${\mathtt{RMax}}_{}$. Note that ${\mathtt{RFast}}_{1}$ is an ordered H-priority scheduling.
- ${\mathtt{ReduceMin}}_{}$ (${\mathtt{RMin}}_{}$, for short): This priority algorithm cuts each day the shortest bamboo, giving priorities to those above H. The aim of defining this strategy is to evaluate performance of counter-intuitive methods, i.e., to see whether even in an adversarial approach one may obtain acceptable performances. ${\mathtt{RMin}}_{}$ is a H-priority scheduling.

#### 4.1. Fixed H Experimentation

#### 4.2. Fixed n Experimentation

- $n=30$ bamboos with $H\in \{70,100\}$; and
- $n=10$ with $H\in \{40,200\}$.

- (i) Some strategies exhibit a very small variance in terms of height (e.g., ${\mathtt{RMax}}_{}$) with respect to others (e.g., ${\mathtt{RMin}}_{}$).
- (ii) Some strategies (e.g., ${\mathtt{RMax}}_{}$) are able to stabilise very quickly to a cycle, which is a clearly desirable behaviour in a stabilisation perspective. On top of that, they also exhibit a small ${\lambda}_{E}$.

**Conjecture**

**1.**

## 5. Conclusions

## Author Contributions

## Funding

## Conflicts of Interest

## References

- 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 SOFSEM 2017: Theory and Practice of Computer Science, Proceedings of the 43rd International Conference on Current Trends in Theory and Practice of Computer Science, Limerick, Ireland, 16–20 January 2017; Lecture Notes in Computer Science; Springer: Berlin, Germany, 2017; Volume 10139, pp. 229–240. [Google Scholar]
- Holte, R.; Mok, A.; Rosier, L.; Tulchinsky, I.; Varvel, D. The pinwheel: A real-time scheduling problem. In Proceedings of the 22nd Annual Hawaii International Conference on System Sciences, Kailua-Kona, HI, USA, 3–6 January 1989; Volume 2, pp. 693–702. [Google Scholar]
- Fishburn, P.C.; Lagarias, J.C. Pinwheel Scheduling: Achievable Densities. Algorithmica
**2002**, 34, 14–38. [Google Scholar] [CrossRef] - 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 2015 International Conference on Cloud Computing (ICCC), Riyadh, Saudi Arabia, 26–29 April 2015; pp. 1703–1710. [Google Scholar]
- Gąsieniec, L.; Klasing, R.; Martin, R.; Navarra, A.; Zhang, X. Fast periodic graph exploration with constant memory. J. Comput. Syst. Sci.
**2008**, 74, 802–822. [Google Scholar] [CrossRef] - Kosowski, A.; Navarra, A. Graph Decomposition for Memoryless Periodic Exploration. Algorithmica
**2012**, 63, 26–38. [Google Scholar] [CrossRef] - D’Emidio, M.; Di Stefano, G.; Frigioni, D.; Navarra, A. Characterizing the computational power of mobile robots on graphs and implications for the Euclidean plane. Inf. Comput
**2018**, 263, 57–74. [Google Scholar] [CrossRef] - D’Emidio, M.; Frigioni, D.; Navarra, A. Explore and repair graphs with black holes using mobile entities. Theor. Comput. Sci.
**2015**, 605, 129–145. [Google Scholar] [CrossRef] - Ntafos, S. On gallery watchmen in grids. Inf. Process. Lett.
**1986**, 23, 9–102. [Google Scholar] [CrossRef] - Urrutia, J. Art gallery and illumination problems. In Handbook of Computational Geometry; Elsevier: Amsterdam, The Netherlands, 2000; pp. 973–1027. [Google Scholar]
- Collins, A.; Czyzowicz, J.; Gąsieniec, L.; Kosowski, A.; Kranakis, E.; Krizanc, D.; Martin, R.; Morales Ponce, O. Optimal Patrolling of Fragmented Boundaries. In Proceedings of the 25th Annual ACM Symposium on Parallelism in Algorithms and Architectures, Montréal, QC, Canada, 23–25 July 2013; ACM: New York, NY, USA, 2013; pp. 241–250. [Google Scholar]
- Czyzowicz, J.; Gąsieniec, L.; Kosowski, A.; Kranakis, E. Boundary Patrolling by Mobile Agents with Distinct Maximal Speeds. In Algorithms—ESA 2011, Proceedings of the 19th Annual European Symposium, Saarbrücken, Germany, 5–9 September 2011; Lecture Notes in Computer Science; Springer: Berlin, Germany, 2011; Volume 6942, pp. 701–712. [Google Scholar]
- Chuangpishit, H.; Czyzowicz, J.; Gąsieniec, L.; Georgiou, K.; Jurdzinski, T.; Kranakis, E. Patrolling a Path Connecting a Set of Points with Unbalanced Frequencies of Visits. In SOFSEM 2018: Theory and Practice of Computer Science, Proceedings of the 44th International Conference on Current Trends in Theory and Practice of Computer Science, Krems, Austria, 29 January–2 February 2018; Lecture Notes in Computer Science; Springer: Berlin, Germany, 2018; Volume 10706, pp. 367–380. [Google Scholar]
- Serafini, P.; Ukovich, W. A Mathematical Model for Periodic Scheduling Problems. SIAM J. Discret. Math.
**1989**, 2, 550–581. [Google Scholar] [CrossRef] - Chan, M.Y.; Chin, F.Y.L. General schedulers for the pinwheel problem based on double-integer reduction. IEEE Trans. Comput.
**1992**, 41, 755–768. [Google Scholar] [CrossRef] - Chan, M.Y.; Chin, F.Y.L. Schedulers for larger classes of pinwheel instances. Algorithmica
**1993**, 9, 425–462. [Google Scholar] [CrossRef] - Hsueh, C.; Lin, K. An Optimal Pinwheel Scheduler Using the Single-number Reduction Technique. In Proceedings of the 17th IEEE Real-Time Systems Symposium, Washington, DC, USA, 4–6 December 1996; pp. 196–205. [Google Scholar]
- Holte, R.; Rosier, L.; Tulchinsky, I.; Varvel, D. Pinwheel scheduling with two distinct numbers. Theor. Comput. Sci.
**1992**, 100, 105–135. [Google Scholar] [CrossRef] - Lin, S.S.; Lin, K.J. A Pinwheel Scheduler for Three Distinct Numbers with a Tight Schedulability Bound. Algorithmica
**1997**, 19, 411–426. [Google Scholar] [CrossRef] - Romer, T.H.; Rosier, L.E. An algorithm reminiscent of euclidean-gcd for computing a function related to pinwheel scheduling. Algorithmica
**1997**, 17, 1–10. [Google Scholar] [CrossRef] - Baruah, S.K.; Lin, S.-S. Pfair scheduling of generalized pinwheel task systems. IEEE Trans. Comput.
**1998**, 47, 812–816. [Google Scholar] [CrossRef] - Baruah, S.K.; Cohen, N.K.; Plaxton, C.G.; Varvel, D.A. Proportionate progress: A notion of fairness in resource allocation. Algorithmica
**1996**, 15, 600–625. [Google Scholar] [CrossRef] - Mok, A.; Rosier, L.; Tulchinski, I.; Varvel, D. Algorithms and complexity of the periodic maintenance problem. Microprocess. Microprogram.
**1989**, 27, 657–664. [Google Scholar] [CrossRef] - Anily, S.; Glass, C.A.; Hassin, R. The scheduling of maintenance service. Discret. Appl. Math.
**1998**, 82, 27–42. [Google Scholar] [CrossRef] - Anily, S.; Glass, C.A.; Hassin, R. Scheduling maintenance services to three machines. Ann. Oper. Res.
**1999**, 86, 375–391. [Google Scholar] [CrossRef] - Bender, M.A.; Fekete, S.P.; Kröller, A.; Mitchell, J.S.B.; Liberatore, V.; Polishchuk, V.; Suomela, J. The Minimum Backlog Problem. Theor. Comput. Sci.
**2015**, 605, 51–61. [Google Scholar] [CrossRef] - 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 TCS 2012: Theoretical Computer Science, Proceedings of the IFIP Theoretical Computer Science Conference, Amsterdam, The Netherlands, 26–28 September 2012; Lecture Notes in Computer Science; Springer: Berlin, Germany, 2012; Volume 6942, pp. 57–71. [Google Scholar]
- Chrobak, M.; Csirik, J.; Imreh, C.; Noga, J.; Sgall, J.; Woeginger, G.J. The Buffer Minimization Problem for Multiprocessor Scheduling with Conflicts. In Automata, Languages and Programming, Proceedings of the 28th International Colloquium on Automata, Languages, and Programming, Crete, Greece, 8–12 July 2001; Lecture Notes in Computer Science; Springer: Berlin, Germany, 2001; Volume 2076, pp. 862–874. [Google Scholar]
- D’Emidio, M.; Di Stefano, G.; Navarra, A. Priority Scheduling in the Bamboo Garden Trimming Problem. In SOFSEM 2019: Theory and Practice of Computer Science, Proceedings of the 45th International Conference on Current Trends in Theory and Practice of Computer Science, Nový Smokovec, Slovakia, 27–30 January 2019; Lecture Notes in Computer Science; Springer: Berlin, Germany, 2019; Volume 11376, pp. 136–149. [Google Scholar]
- Hardy, G.H.; Ramanujan, S. Asymptotic formulas in combinatorial analysis. Proc. Lond. Math. Soc.
**1918**, 17, 75–115. [Google Scholar] [CrossRef]

**Figure 1.**An example of input instance for the Pinwheel problem where $V=(2,4,7)$ and hence $D=1/2+1/4+1/7\approx 0.89$.

**Figure 2.**(

**a**) Distribution of instances with respect to n for all partitions of integer $H\in \{5,10,15,20,25,30,35\}$; and (

**b**) distribution of instances with respect to H for all partitions of integer $H\in \{5,10,15,20,25,30,35\}$.

**Figure 3.**Experiments conducted on all possible ordered instances obtained by setting $H=30$ and hence considering n varying in $\{1,2,\dots ,30\}$. Panels (

**a**,

**c**) refer to maximum $M(E)$, whereas panels (

**b**,

**d**) refer to maximum ${\lambda}_{E}$. Panels (

**c**,

**d**) show strategies that, experimentally, exhibit 2-approximation.

**Figure 4.**Experiments conducted on all possible ordered instances obtained by setting $H=35$ and hence considering n varying in $\{1,2,\dots ,35\}$. Panels (

**a**,

**c**) refer to maximum $M(E)$, whereas panels (

**b**,

**d**) refer to maximum ${\lambda}_{E}$. Panels (

**c**,

**d**) show strategies that, experimentally, exhibit 2-approximation.

**Figure 5.**Distribution of values of: $M(E)$ (

**a**); and ${\lambda}_{E}$ (

**b**) exhibited by all algorithms on instances induced by all partitions of $H=35$. Instances are sorted by non-decreasing values of: $M(E)$ (

**a**); and ${\lambda}_{E}$ (

**b**). To magnify the differences, the y-axis in (

**b**) is log-scaled.

**Figure 6.**Distribution of values of: $M(E)$ (

**a**); ${\lambda}_{E}$ (

**b**); and number of days before stabilisation (

**c**) as a function of H, for all considered strategies and instances.

**Figure 7.**How maximum $M(E)$ (

**a**,

**c**) and maximum ${\lambda}_{E}$ (

**b**,

**d**) change as a function of H when instances are induced by all partitions of $H\in \{10,15,20,25,30,35\}$ having cardinality $n=10$. Panels (

**c**,

**d**) show strategies that, experimentally, exhibit 2-approximation.

**Figure 8.**How maximum $M(E)$ (

**a**) and maximum ${\lambda}_{E}$ (

**b**) change as a function of H when instances are induced by all partitions of $H\in \{15,20,25,30,35\}$ having cardinality $n=15$. Panels (

**c**,

**d**) show strategies that, experimentally, exhibit 2-approximation.

**Figure 9.**Snapshot of the evolution of maximum heights when strategies: $\mathtt{RMin}$ (

**a**); $\mathtt{RMax}$ (

**b**); ${\mathtt{RFast}}_{2}$ (

**c**); and ${\mathtt{RFast}}_{1}$ (

**d**) are applied on an instance having $n=30$ and $H=70$. (in details, structured as follows $[20;11;8;5;1;1;1;1;1;1;1;1;1;1;1;1;1;1;1;1;1;1;1;1;1;1;1;1;1;1]$). On the x-axis the consecutive days are reported while on the y-axis the maximum height on the corresponding day is plot. The vertical line shows the beginning of the periodic phase while the horizontal lines show, respectively, $({\displaystyle \sum _{t=1}^{{\lambda}_{E}}}{l}^{t})/{\lambda}_{E}$ (i.e., H), $2H$, $4H$, and $M(E)$ over the entire execution.

**Figure 10.**Snapshot of the evolution of maximum heights when strategies: $\mathtt{RMin}$ (

**a**); $\mathtt{RMax}$ (

**b**); ${\mathtt{RFast}}_{2}$ (

**c**); and ${\mathtt{RFast}}_{1}$ (

**d**) are applied on an instance having $n=30$ and $H=100$ (in details, structured as follows $[70;2;1;1;1;1;1;1;1;1;1;1;1;1;1;1;1;1;1;1;1;1;1;1;1;1;1;1;1;1]$). Data are plotted as in Figure 9.

**Figure 11.**Snapshot of the evolution of maximum heights when strategies: $\mathtt{RMin}$ (

**a**); $\mathtt{RMax}$ (

**b**); ${\mathtt{RFast}}_{2}$ (

**c**); and ${\mathtt{RFast}}_{1}$ (

**d**) are applied on an instance having $n=10$ and $H=40$ (in details, structured as follows $[15;13;4;2;1;1;1;1;1;1]$). Data are plotted as in Figure 9.

**Figure 12.**Snapshot of the evolution of maximum heights when strategies: $\mathtt{RMin}$ (

**a**); $\mathtt{RMax}$ (

**b**); ${\mathtt{RFast}}_{2}$ (

**c**); and ${\mathtt{RFast}}_{1}$ (

**d**) are applied on an instance having $n=10$ and $H=200$ (in details, structured as follows $[61;30;27;26;13;11;10;10;9;3]$). Data are plotted as in Figure 9.

© 2019 by the authors. Licensee MDPI, Basel, Switzerland. This article is an open access article distributed under the terms and conditions of the Creative Commons Attribution (CC BY) license (http://creativecommons.org/licenses/by/4.0/).

## Share and Cite

**MDPI and ACS Style**

D’Emidio, M.; Di Stefano, G.; Navarra, A.
Bamboo Garden Trimming Problem: Priority Schedulings. *Algorithms* **2019**, *12*, 74.
https://doi.org/10.3390/a12040074

**AMA Style**

D’Emidio M, Di Stefano G, Navarra A.
Bamboo Garden Trimming Problem: Priority Schedulings. *Algorithms*. 2019; 12(4):74.
https://doi.org/10.3390/a12040074

**Chicago/Turabian Style**

D’Emidio, Mattia, Gabriele Di Stefano, and Alfredo Navarra.
2019. "Bamboo Garden Trimming Problem: Priority Schedulings" *Algorithms* 12, no. 4: 74.
https://doi.org/10.3390/a12040074