 # A 12/7-approximation algorithm for the discrete Bamboo Garden Trimming problem

We study the discrete Bamboo Garden Trimming problem (BGT), where we are given n bamboos with different growth rates. At the end of each day, one can cut down one bamboo to height zero. The goal in BGT is to make a perpetual schedule of cuts such that the height of the tallest bamboo ever is minimized. Here, we improve the current best approximation guarantee by designing a 12/7-approximation algorithm. This result is based on a reduction to the Pinwheel Scheduling problem. We show that a guarantee of 12/7 is essentially the best we can hope for if our algorithm is based on this type of reduction.

## Authors

##### This week in AI

Get the week's most popular data science and artificial intelligence research sent straight to your inbox every Saturday.

## 1 Introduction

In the discrete Bamboo Garden Trimming problem (BGT), we are given a garden with bamboos, where bamboo grows with a rate of per day. Initially, all bamboos have height zero. At the end of each day, one can cut down one bamboo to height zero. The goal in BGT is to make a perpetual schedule of cuts (trimming schedule) such that the height of the tallest bamboo ever is minimized. The problem was introduced by Gasieniec et al. . They also introduced a continuous version of BGT, in which one can cut a bamboo at any time. However, here the bamboos are located at vertices in a weighted graph, and time passes while traveling. The discrete and continuous BGT have, among others, applications in scheduling maintenance of machines. Gasieniec et al. gave a 2-approximation for discrete BGT. Recently, Della Croce  improved this to a guarantee of approximately 1.888. He also showed that the approximation guarantee of his algorithm converges to when . In this paper, we will extend the approach of  in order to obtain a -approximation algorithm. This result is obtained by reducing BGT to the Pinwheel Scheduling problem (PS).

In the Pinwheel Scheduling problem , we are given jobs with integral periods . On each day, we can schedule at most one job. The goal is to design a perpetual schedule such that each job is scheduled at least once in any period of consecutive days, or to conclude that no such schedule exists. Holte et al.  showed that the problem is contained in PSPACE, but no completeness result is known. The strongest hardness result is given by Jacobs and Longo , who showed that there is no (pseudo-)polynomial time algorithm for the Pinwheel Scheduling problem, unless Satisfiability can be solved by a randomized algorithm running in expected time . An important issue of PS, and other related problems like BGT, is the representation of a solution. Explicitly writing down the schedule may take exponential time and space. In this paper, we only consider periodic schedules that can be represented by numbers and for each . In a periodic schedule, job is scheduled for the first time on day , and then scheduled every days later. Our algorithm will be able to compute the ’s and ’s in polynomial time (Section 4).

It is quite easy to reduce PS to BGT. Given an instance of PS, we create an instance of BGT by creating a bamboo for each job with growth rate . Now, there is a feasible schedule for PS if and only if there is a trimming schedule for BGT with maximum height 1. Hence, BGT is harder than PS, and the hardness result by  also holds for BGT.

There are several problems that relate to the Pinwheel Scheduling problem. The continuous version of PS, in which jobs can be scheduled at any time, but time passes when one is traveling, is known as the Periodic Latency problem . Moreover, the problem also arises as a subproblem is some variants of inventory routing  and replenishment problems .

An interesting aspect of a PS-instance is the density. The density of instance is defined as . Clearly, if , instance is not schedulable. Holte et al.  showed that if divides whenever , and , then is schedulable. Consequently, if , can be scheduled by rounding each period down to its nearest power of 2. Later, more elaborate ways of rounding the periods were considered [3, 4, 7]. In the first paper by Chan and Chin , they designed an algorithm that was able to round any instance with to a schedulable instance. They also considered a simpler algorithm such that any instance with density is rounded to a schedulable instance. We will use this algorithm for our main result. They also observed that instance cannot be scheduled for any value of . Hence, there exists an instance with density above that is not schedulable. They conjectured that any instance with is schedulable. In the second paper by Chan and Chin , they improved the achievable density bound to . Finally, Fishburn and Lagarias  showed that any instance with density at most can be scheduled.

In the next section, we will describe the 2-approximation algorithm designed by . In Section 3 we will show how we can use the algorithm by Chan and Chin  to improve the approximation guarantee to . This sections will focus on the approximation guarantee. In Section 4, we will discuss the running time of the algorithms.

## 2 A 2-approximation algorithm

In this section, we will describe the approach taken by  in order to obtain a 2-approximation algorithm. For this, define . As observed in , is a lower bound on the optimal value. Hence, if we find a solution with value , we know that we are within a factor of the optimal value. Given an instance of BGT, i.e., , we define the following periods:

 pi:=2Hhi.

The period can be interpreted as the (possibly fractional) number of days it takes bamboo to reach height . Since the ’s need not to be integral, we call a pseudo-instance of the Pinwheel Scheduling problem. A feasible solution for a pseudo-instance of the Pinwheel Scheduling problem is a schedule assigning at most one job per day such that each job is scheduled at least once in any period of consecutive days. If we are able to find a feasible schedule for the created pseudo-instance, we know that no bamboo will ever exceed height . Hence, we will obtain a 2-approximation algorithm.

The density of the created pseudo-instance is equal to

 ρ(A)=∑i1pi=∑ihi2H=12.

If we round every period down to its nearest power of 2, we get an instance of the Pinwheel Scheduling problem with density at most 1. So, the result from  ensures there is a schedule for this instance of the Pinwheel Scheduling problem. In Section 4, it is shown how to obtain a representation of a feasible schedule in polynomial time. Since periods are rounded down, the resulting schedule can also be used as a feasible solution for the pseudo-instance . This concludes the proof.

## 3 A 12/7-approximation algorithm

Our algorithm uses the same approach as the 2-approximation by . Given an instance of BGT, we create a pseudo-instance of the Pinwheel Scheduling problem by defining periods:

 pi:=12H7hi.

The pseudo-instance has density . As noted in the introduction, Chan and Chin  designed an algorithm that is able to round any instance of PS with density at most to a schedulable instance. As it turns out, this algorithm is even able to round any pseudo-instance of PS with density at most to a schedulable instance of PS (Theorem 1). In Section 4, we show how to obtain a representation of a feasible schedule in polynomial time. Hence, we obtain a -approximation algorithm for BGT.

To explain the algorithm by , we need to define the operation specialization. If we specialize a pseudo-instance of PS with respect to , it means that we round every period down to its nearest integer in . For example, in the algorithm by , the pseudo-instance is specialized with respect to . We can also specialize a pseudo-instance with respect to multiple integers. If we specialize a pseudo-instance of PS with respect to , it means that we round every period down to its nearest integer in

 {x,2x,4x,…,x2j,…}∪{y,2y,4y,…,y2j,…}.

The algorithm by Chan and Chin  uses specialization with respect to . We use the following notation. Let be a pseudo-instance, where and . Let and be the specialization of and with respect to and , respectively. Then, if , the instance is schedulable (Theorem 3.1.1 in ).

After specializing with respect to , we may want to further adjust and . For this, define and such that

 ρ(B)=r2+ρ(P) with 0<ρ(P)<12 for some integer r≥0, ρ(C)=s3+ρ(Q) with 0<ρ(Q)<13 for some integer s≥0.

If , no further action is taken. If , we will start our normalization procedure, which considers four cases. Here, treating set as one means that we will reserve space in the schedule as if the jobs in set were one .

• Treat and as one . Here, we specialize with respect to , and then move it to . This will be done if .

• Treat and as one . Here, we specialize with respect to , and then move it to . This will be done if and .

• Treat and as two ’s. Here, we specialize with respect to , and then move it to . This will be done if and .

• Treat and as a and a . This will be done if .

We define and to be and after normalization, respectively. The following theorem states that if we specialize a pseudo-instance of PS with respect to , and then apply normalization, we obtain a schedulable instance whenever . The proof is actually the same as the one in , and is therefore given in the appendix.

###### Theorem 1.

The algorithm of Chan and Chin  obtains a schedulable PS-instance for any pseudo-instance with .

###### Corollary 1.

There is a -approximation algorithm for the discrete Bamboo Garden Trimming problem.

Next, we will illustrate that the approximation guarantee of is essentially the best we can hope for when our algorithm is based on a reduction to a pseudo-instance of PS. First, we give an example of a pseudo-instance of PS with density , with , that is not schedulable.

###### Example 1.

Consider the pseudo-instance with , , and , with and a large number. This pseudo-instance has density

 712+δ with δ=ϵ9−3ϵ+ϵ16−4ϵ+1M.

In order to obtain a feasible schedule for this pseudo-instance, we should round to 2. Similarly, we should round to an integer smaller than or equal to 3. In the most conservative rounding, we obtain the PS-instance , which is known to be non-schedulable . Hence, our pseudo-instance is not schedulable.

The example above shows that if we reduce instances of BGT to a pseudo-instances of PS, and then only focus on schedulability of these pseudo-instances, we will not improve upon the guarantee of . However, it might be possible that “bad” pseudo-instances like the one in Example 1 are not encountered after the reduction. The next example shows that if we use as our lower bound, and a magnifying factor of , to make the reduction from BGT to a pseudo-instance of PS, we will encounter the pseudo-instance of Example 1. This shows that if we use as our lower bound, algorithms based on a reduction to a pseudo-instance of PS will not give guarantees better than .

###### Example 2.

Consider the BGT-instance with , , and , with . Since , we obtain the pseudo-instance of PS with

 p1 =(127−η)(7+γ4)=3+3γ7−(7+γ)η4=3−ϵ1 p2 =(127−η)(7+γ3)=4+4γ7−(7+γ)η3=4−ϵ2 p3 =(127−η)(7+γγ)=12γ+127−(7+γ)ηγ=M

We like to note that the chosen approach might be able to improve upon the current guarantee, if another lower bound is used to reduce to PS. For example, Della Croce  observed that, if , the optimal value is at least . Hence, we could use as a lower bound.

## 4 Running time

First observe that rounding the periods as is done by the algorithm from  can be done in polynomial time. Here, we give an algorithm that, for instances obtained by applying the algorithm from , produces a representation of a feasible solution in polynomial time. For this, it is sufficient to show that such an algorithm exists for instances with the property that divides whenever , and . In , an algorithm for instances with this property is given. However, this algorithm runs in exponential time, since it constructs a schedule of length . For instances with the aforementioned property, we can restrict ourselves to periodic schedules . As said in the introduction, these can be represented by an offset time and a time between two consecutive days on which job is scheduled, for each . We will show that we can find these values in polynomial time.

###### Theorem 2.

If an instance satisfies the property that divides whenever , and , then a representation of a feasible schedule can be found in polynomial time.

###### Proof.

First, we show that a feasible schedule exists. Then, we show that this proof leads to a polynomial time algorithm. For proving existence of a feasible schedule, we use induction on the size of the instance. By our assumption on the periods, we can partition an instance into subsets with for all . Moreover, for all .

Create a new instance containing the jobs from and set the periods to for . Clearly, holds for this instance. Suppose there is a feasible schedule for , and let denote the day on which job is scheduled for the th time. Now, in the original instance, schedule job for the th time (denoted by ) on day:

 σ(i,ℓ)=j+(σj(i,ℓ)−1)⋅p1. (1)

To see that this schedule is feasible, note that clients from set are only scheduled on days for which , and therefore there are no two clients scheduled on the same day. Furthermore, the time between two consecutive days on which a job is scheduled is exactly times as long as in the schedule for . Therefore instance will have a feasible schedule if the subinstances are schedulable. As the inductive hypothesis trivially holds for instances with one client, the result follows.

The approach above can be used to find and in polynomial time. Clearly, is equal to . To obtain the values of for all , we repeatedly partition the instance as is done above, until only singletons are left. After partitioning, each subinstance is scaled down by a factor . Now, the value of can be found by using equation 1 recursively. Since in each step, we create at least one subset that contains only one job, this procedure will run in polynomial time. ∎

Finally, we will show that the algorithm above can be used to create a representation of a feasible schedule for instances produced by the algorithm of . In each case, the values of are equal to the periods found by the algorithm. In case our instance is only specialized with respect to either or , we can directly apply the algorithm above. In case our instance is specialized with respect to , we will assign the jobs in

to the odd days, and the jobs in

to the even days. If consists of a single , then this job is scheduled on every odd day. Otherwise, the periods are divided by 2, the algorithm above is applied, and the resulting schedule is stretched by a factor 2. A similar algorithm works for scheduling the jobs in .

## 5 Conclusion

In this paper, we presented a -approximation algorithm for the discrete Bamboo Garden Trimming problem. This improves upon the -approximation by Della Croce . The algorithm uses a reduction to the Pinwheel Scheduling problem, similar to the algorithm designed by Gasieniec et al. . We also gave examples which show that the current bound is essentially the best we can hope for if we restrict ourselves to this approach.

For future research, it would be interesting to see if other approaches can improve upon the guarantee of . It might also be interesting to study lower bounds on approximability. Moreover, it would be great if one is able to prove that either the discrete Bamboo Garden Trimming problem or the Pinwheel Scheduling problem is complete for some class, e.g., PSPACE-complete.

### Acknowledgements

We would like to thank Thomas Bosman for useful discussions on the computational efficiency of algorithms for the Pinwheel Scheduling problem.

## References

•  Annelieke C. Baller, Martijn van Ee, Maaike Hoogeboom, and Leen Stougie. Complexity of inventory routing problems when routing is easy. Networks, 75(2):113–123, 2020.
•  Thomas Bosman, Martijn van Ee, Yang Jiao, Alberto Marchetti-Spaccamela, R. Ravi, and Leen Stougie. Approximation algorithms for replenishment problems with fixed turnover times. In Michael Bender, Martín Farach-Colton, and Miguel A. Mosteiro, editors, LATIN 2018: Theoretical Informatics, volume 10807 of Lecture Notes in Computer Science, pages 217–230. Springer, 2018.
•  Mee Yee Chan and Francis Y. L. Chin. General schedulers for the pinwheel problem based on double-integer reduction. IEEE Transactions on Computers, 41(6):755–768, 1992.
•  Mee Yee Chan and Francis Y. L. Chin. Schedulers for larger classes of pinwheel instances. Algorithmica, 9(5):425–462, 1993.
•  Sofie Coene, Frits C. R. Spieksma, and Gerhard J. Woeginger. Charlemagne’s challenge: The periodic latency problem. Operations Research, 59(3):674–683, 2011.
•  Federico Della Croce. An enhanced pinwheel algorithm for the bamboo garden trimming problem. arXiv preprint arXiv:2003.12460, 2020.
•  Peter C. Fishburn and Jeffrey C. Lagarias. Pinwheel scheduling: Achievable densities. Algorithmica, 34(1):14–38, 2002.
•  Leszek Gasieniec, Ralf Klasing, Christos Levcopoulos, Andrzej Lingas, Jie Min, and Tomasz Radzik. Bamboo garden trimming problem (perpetual maintenance of machines withdifferent attendance urgency factors). In SOFSEM, pages 229–240. Springer, 2017.
•  Robert Holte, Al Mok, Louis Rosier, Igor Tulchinsky, and Donald Varvel. The pinwheel: A real-time scheduling problem. In Proceedings of the 22th Annual Hawaii International Conference on System Sciences, volume 2, pages 693–702, 1989.
•  Tobias Jacobs and Salvatore Longo. A new perspective on the windows scheduling problem. arXiv preprint arXiv:1410.7237, 2014.

## Appendix A Proof of Theorem 1

Using the definitions from Section 3, we have

 ρ(A2)>2ρ(B)3=r3+2ρ(P)3, ρ(A3)>3ρ(C)4=s4+3ρ(P)4.

Hence, we get

 r3+s4+2ρ(P)3+3ρ(Q)4<ρ(A2)+ρ(A3)=ρ(A)≤712.

Hence, we only have combinations of in

 {(0,0),(0,1),(0,2),(1,0),(1,1)}.

We will now check that in each of the cases that the algorithm considers, we have .

If , we have , , and . As for all possible cases of and , the instance can be scheduled. If , we consider the following cases.

Case (a) : treat and as a single . After normalization, and . Thus, . Since , we only have to consider the following cases

 (r,s)∈{(0,0),(0,1),(0,2),(1,0)},

and, in all cases, .

Case (b): treat and as a single . After normalization, and . Thus, . From the conditions for case (b), . With , we have

 2ρ(P)3+3ρ(Q)4=34(4ρ(P)3+ρ(Q))−ρ(P)3>34⋅13−13⋅12=112.

Thus,

 r3+s4+112<712 r3+s4<12.

The only possible cases for are , , and , and this gives .

Case (c): treat and as two ’s. After normalization, and . Thus, . From the conditions for this case, . With , we have

 2ρ(P)3+3ρ(Q)4=23(ρ(P)+3ρ(Q)2)−ρ(Q)4>23⋅12−14⋅13=14.

Thus,

 r3+s4+14<712 r3+s4<13.

The only possible cases for are and , and this gives .

Case (d) : treat and as a and a . After normalization, and . Thus, . From the conditions for this case, . With , we have

 2ρ(P)3+3ρ(Q)4=34(4ρ(P)3+ρ(Q))−ρ(P)3>34⋅23−13⋅12=13.

Thus,

 r3+s4+13<712 r3+s4<14.

The only possible case for is and this gives . ∎