Pinwheel scheduling

Last updated
An instance of the pinwheel scheduling problem: tasks A, B, and C have maximum repeat times 2, 4, and 5 respectively. The repeating schedule ABACABAC... solves this instance. Pinwheel scheduling.svg
An instance of the pinwheel scheduling problem: tasks A, B, and C have maximum repeat times 2, 4, and 5 respectively. The repeating schedule ABACABAC... solves this instance.
A pinwheel in a Lorenz SZ42 cipher machine with its pins (the small lugs near the center of the image) set to different positions Lorenz Cams.jpg
A pinwheel in a Lorenz SZ42 cipher machine with its pins (the small lugs near the center of the image) set to different positions

In mathematics and computer science, the pinwheel scheduling problem is a problem in real-time scheduling with repeating tasks of unit length and hard constraints on the time between repetitions.

Contents

When a pinwheel scheduling problem has a solution, it has one in which the schedule repeats periodically. This repeating pattern resembles the repeating pattern of set and unset pins on the gears of a pinwheel cipher machine, justifying the name. [1] If the fraction of time that is required by each task totals less than 3/4 of the total time, a solution always exists, but some pinwheel scheduling problems whose tasks use a total of slightly more than 5/6 of the total time do not have solutions.

Certain formulations of the pinwheel scheduling problem are NP-hard.

Definition

The input to pinwheel scheduling consists of a list of tasks, each of which is assumed to take unit time per instantiation. Each task has an associated positive integer value, its maximum repeat time (the maximum time from the start of one instantiation of the task to the next). Only one task can be performed at any given time. [1]

The desired output is an infinite sequence specifying which task to perform in each unit of time. Each input task should appear infinitely often in the sequence, with the largest gap between two consecutive instantiations of a task at most equal to the repeat time of the task. [1]

For example, the infinitely repeating sequence ABACABACABAC... would be a valid pinwheel schedule for three tasks A, B, and C with repeat times that are at least 2, 4, and 4 respectively.

Density

If the task to be scheduled are numbered from to , let denote the repeat time for task . In any valid schedule, task must use a fraction of the total time, the amount that would be used in a schedule that repeats that task at exactly its specified repeat time. The density of a pinwheel scheduling problem is defined as the sum of these fractions, . For a solution to exist, the times devoted to each task cannot sum to more than the total available time, so it is necessary for the density to be at most . [2]

This condition on density is also sufficient for a schedule to exist in the special case that all repeat times are multiples of each other. For instance, this would be true when all repeat times are powers of two. In this case one can solve the problem using a disjoint covering system. [1] Having density at most is also sufficient when there are exactly two distinct repeat times. [2] However, having density at most 1 is not sufficient in some other cases. In particular, there is no schedule for three items with repeat times , , and , no matter how large may be, even though the density of this system is only . [3]

Unsolved problem in computer science:

Does every pinwheel scheduling problem with density at most 5/6 have a solution?

Every instance of pinwheel scheduling with density at most has a solution, [4] and it has been conjectured that every instance with density at most has a solution. [3] [5] Every instance with three distinct repeat times and density at most does have a solution. [5] Additionally, case analysis has confirmed that every instance with at most 12 tasks and density at most has a solution. [6] [7]

Periodicity and complexity

When a solution exists, it can be assumed to be periodic, with a period at most equal to the product of the repeat times. However, it is not always possible to find a repeating schedule of sub-exponential length. [2]

With a compact input representation that specifies, for each distinct repeat time, the number of objects that have that repeat time, pinwheel scheduling is NP-hard. [2]

Algorithms

Despite the NP-hardness of the pinwheel scheduling problem for general inputs, some types of inputs can be scheduled efficiently. An example of this occurs for inputs where (when listed in sorted order) each repeat time evenly divides the next one, and the density is at most one. In this case, the problem can be solved by a greedy algorithm that schedules the tasks in sorted order, scheduling each task to repeat at exactly its repeat time. At each step in this algorithm, the time slots that have already been assigned form a repeating sequence, with period equal to the repeat time of the most recently-scheduled task. This pattern allows each successive task to be scheduled greedily, maintaining the same invariant. [1]

The same idea can be used for arbitrary instances with density at most 1/2, by rounding down each repeat time to a power of two that is less than or equal to it. This rounding process at most doubles the density, keeping it at most one. After rounding, all densities are multiples of each other, allowing the greedy algorithm to work. The resulting schedule repeats each task at its rounded repeat time; because these rounded times do not exceed the input times, the schedule is valid. [1] Instead of rounding to powers of two, a greater density threshold can be achieved by rounding to other sequences of multiples, such as the numbers of the form for a careful choice of the coefficient , [3] or by rounding to two different geometric series and generalizing the idea that tasks with two distinct repeat times can be scheduled up to density one. [3] [8]

Applications

The original work on pinwheel scheduling proposed it for an application in which a single base station must communicate with multiple satellites or remote sensors, one at a time, with distinct communications requirements. In this application, each satellite becomes a task in a pinwheel scheduling problem, with a repeat time chosen to give it adequate bandwidth. The resulting schedule is used to assign time slots for each satellite to communicate with the base station. [1]

Other applications of pinwheel scheduling include scheduling maintenance sessions for a collection of objects (such as oil changes for automobiles), the arrangement of repeated symbols on the print chains of line printers, [3] computer processing of multimedia data, [5] and contention resolution in real-time wireless computer networks. [9]

Related Research Articles

The P versus NP problem is a major unsolved problem in theoretical computer science. Informally, it asks whether every problem whose solution can be quickly verified can also be quickly solved.

<span class="mw-page-title-main">Knapsack problem</span> Problem in combinatorial optimization

The knapsack problem is the following problem in combinatorial optimization:

The subset sum problem (SSP) is a decision problem in computer science. In its most general formulation, there is a multiset of integers and a target-sum , and the question is to decide whether any subset of the integers sum to precisely . The problem is known to be NP-hard. Moreover, some restricted variants of it are NP-complete too, for example:

In computational complexity theory, a decision problem is PSPACE-complete if it can be solved using an amount of memory that is polynomial in the input length and if every other problem that can be solved in polynomial space can be transformed to it in polynomial time. The problems that are PSPACE-complete can be thought of as the hardest problems in PSPACE, the class of decision problems solvable in polynomial space, because a solution to any one such problem could easily be used to solve any other problem in PSPACE.

The Post correspondence problem is an undecidable decision problem that was introduced by Emil Post in 1946. Because it is simpler than the halting problem and the Entscheidungsproblem it is often used in proofs of undecidability.

In computer science, 2-satisfiability, 2-SAT or just 2SAT is a computational problem of assigning values to variables, each of which has two possible values, in order to satisfy a system of constraints on pairs of variables. It is a special case of the general Boolean satisfiability problem, which can involve constraints on more than two variables, and of constraint satisfaction problems, which can allow more than two choices for the value of each variable. But in contrast to those more general problems, which are NP-complete, 2-satisfiability can be solved in polynomial time.

In computational complexity theory, the 3SUM problem asks if a given set of real numbers contains three elements that sum to zero. A generalized version, k-SUM, asks the same question on k elements, rather than simply 3. 3SUM can be easily solved in time, and matching lower bounds are known in some specialized models of computation.

In computer science and operations research, approximation algorithms are efficient algorithms that find approximate solutions to optimization problems with provable guarantees on the distance of the returned solution to the optimal one. Approximation algorithms naturally arise in the field of theoretical computer science as a consequence of the widely believed P ≠ NP conjecture. Under this conjecture, a wide class of optimization problems cannot be solved exactly in polynomial time. The field of approximation algorithms, therefore, tries to understand how closely it is possible to approximate optimal solutions to such problems in polynomial time. In an overwhelming majority of the cases, the guarantee of such algorithms is a multiplicative one expressed as an approximation ratio or approximation factor i.e., the optimal solution is always guaranteed to be within a (predetermined) multiplicative factor of the returned solution. However, there are also many approximation algorithms that provide an additive guarantee on the quality of the returned solution. A notable example of an approximation algorithm that provides both is the classic approximation algorithm of Lenstra, Shmoys and Tardos for scheduling on unrelated parallel machines.

In computer science, parameterized complexity is a branch of computational complexity theory that focuses on classifying computational problems according to their inherent difficulty with respect to multiple parameters of the input or output. The complexity of a problem is then measured as a function of those parameters. This allows the classification of NP-hard problems on a finer scale than in the classical setting, where the complexity of a problem is only measured as a function of the number of bits in the input. This appears to have been first demonstrated in Gurevich, Stockmeyer & Vishkin (1984). The first systematic work on parameterized complexity was done by Downey & Fellows (1999).

In quantum computing, a quantum algorithm is an algorithm that runs on a realistic model of quantum computation, the most commonly used model being the quantum circuit model of computation. A classical algorithm is a finite sequence of instructions, or a step-by-step procedure for solving a problem, where each step or instruction can be performed on a classical computer. Similarly, a quantum algorithm is a step-by-step procedure, where each of the steps can be performed on a quantum computer. Although all classical algorithms can also be performed on a quantum computer, the term quantum algorithm is generally reserved for algorithms that seem inherently quantum, or use some essential feature of quantum computation such as quantum superposition or quantum entanglement.

In number theory and computer science, the partition problem, or number partitioning, is the task of deciding whether a given multiset S of positive integers can be partitioned into two subsets S1 and S2 such that the sum of the numbers in S1 equals the sum of the numbers in S2. Although the partition problem is NP-complete, there is a pseudo-polynomial time dynamic programming solution, and there are heuristics that solve the problem in many instances, either optimally or approximately. For this reason, it has been called "the easiest hard problem".

In computer science, fractional cascading is a technique to speed up a sequence of binary searches for the same value in a sequence of related data structures. The first binary search in the sequence takes a logarithmic amount of time, as is standard for binary searches, but successive searches in the sequence are faster. The original version of fractional cascading, introduced in two papers by Chazelle and Guibas in 1986, combined the idea of cascading, originating in range searching data structures of Lueker (1978) and Willard (1978), with the idea of fractional sampling, which originated in Chazelle (1983). Later authors introduced more complex forms of fractional cascading that allow the data structure to be maintained as the data changes by a sequence of discrete insertion and deletion events.

Interval scheduling is a class of problems in computer science, particularly in the area of algorithm design. The problems consider a set of tasks. Each task is represented by an interval describing the time in which it needs to be processed by some machine. For instance, task A might run from 2:00 to 5:00, task B might run from 4:00 to 10:00 and task C might run from 9:00 to 11:00. A subset of intervals is compatible if no two intervals overlap on the machine/resource. For example, the subset {A,C} is compatible, as is the subset {B}; but neither {A,B} nor {B,C} are compatible subsets, because the corresponding intervals within each subset overlap.

In computer science, the ski rental problem is a name given to a class of problems in which there is a choice between continuing to pay a repeating cost or paying a one-time cost which eliminates or reduces the repeating cost.

In theoretical computer science, the closest string is an NP-hard computational problem, which tries to find the geometrical center of a set of input strings.

The vertex k-center problem is a classical NP-hard problem in computer science. It has application in facility location and clustering. Basically, the vertex k-center problem models the following real problem: given a city with facilities, find the best facilities where to build fire stations. Since firemen must attend any emergency as quickly as possible, the distance from the farthest facility to its nearest fire station has to be as small as possible. In other words, the position of the fire stations must be such that every possible fire is attended as quickly as possible.

Parallel task scheduling is an optimization problem in computer science and operations research. It is a variant of optimal job scheduling. In a general job scheduling problem, we are given n jobs J1J2, ..., Jn of varying processing times, which need to be scheduled on m machines while trying to minimize the makespan - the total length of the schedule. In the specific variant known as parallel-task scheduling, all machines are identical. Each job j has a length parameter pj and a size parameter qj, and it must run for exactly pj time-steps on exactly qj machines in parallel.

In computer science, multiway number partitioning is the problem of partitioning a multiset of numbers into a fixed number of subsets, such that the sums of the subsets are as similar as possible. It was first presented by Ronald Graham in 1969 in the context of the identical-machines scheduling problem. The problem is parametrized by a positive integer k, and called k-way number partitioning. The input to the problem is a multiset S of numbers, whose sum is k*T.

Unrelated-machines scheduling is an optimization problem in computer science and operations research. It is a variant of optimal job scheduling. We need to schedule n jobs J1, J2, ..., Jn on m different machines, such that a certain objective function is optimized. The time that machine i needs in order to process job j is denoted by pi,j. The term unrelated emphasizes that there is no relation between values of pi,j for different i and j. This is in contrast to two special cases of this problem: uniform-machines scheduling - in which pi,j = pi / sj, and identical-machines scheduling - in which pi,j = pi.


High-multiplicity bin packing is a special case of the bin packing problem, in which the number of different item-sizes is small, while the number of items with each size is large. While the general bin-packing problem is NP-hard, the high-multiplicity setting can be solved in polynomial time, assuming that the number of different sizes is a fixed constant.

References

  1. 1 2 3 4 5 6 7 Holte, Robert; Mok, Al; Rosier, Louis; Tulchinsky, Igor; Varvel, Donald (1989), "The pinwheel: a real-time scheduling problem", Proceedings of the Twenty-Second Annual Hawaii International Conference on System Sciences, Volume II: Software Track, IEEE Computer Society Press, pp. 693–702, doi:10.1109/hicss.1989.48075, S2CID   62617897
  2. 1 2 3 4 Holte, Robert; Rosier, Louis; Tulchinsky, Igor; Varvel, Donald (1992), "Pinwheel scheduling with two distinct numbers", Theoretical Computer Science, 100 (1): 105–135, doi:10.1016/0304-3975(92)90365-M, MR   1171436 . Previously announced at MFCS 1989.
  3. 1 2 3 4 5 Chan, M. Y.; Chin, Francis (1993), "Schedulers for larger classes of pinwheel instances", Algorithmica, 9 (5): 425–462, doi:10.1007/BF01187034, MR   1212158, S2CID   6069661
  4. Fishburn, P. C.; Lagarias, J. C. (2002), "Pinwheel scheduling: achievable densities", Algorithmica, 34 (1): 14–38, doi:10.1007/s00453-002-0938-9, MR   1912925, S2CID   25561199
  5. 1 2 3 Lin, Shun-Shii; Lin, Kwei-Jay (1997), "A pinwheel scheduler for three distinct numbers with a tight schedulability bound", Algorithmica, 19 (4): 411–426, doi:10.1007/PL00009181, MR   1470043, S2CID   22001959
  6. Ding, Wei (June 2020), "A branch-and-cut approach to examining the maximum density guarantee for pinwheel schedulability of low-dimensional vectors", Real-Time Systems, 56 (3): 293–314, doi:10.1007/s11241-020-09349-w
  7. Gąsieniec, Leszek; Smith, Benjamin; Wild, Sebastian (2022), "Towards the 5/6-density conjecture of pinwheel scheduling", in Phillips, Cynthia A.; Speckmann, Bettina (eds.), Proceedings of the Symposium on Algorithm Engineering and Experiments, ALENEX 2022, Alexandria, VA, USA, January 9–10, 2022, Society for Industrial and Applied Mathematics, pp. 91–103, arXiv: 2111.01784 , doi:10.1137/1.9781611977042.8
  8. Chan, M. Y.; Chin, Francis (June 1992), "General schedulers for the pinwheel problem based on double-integer reduction", IEEE Transactions on Computers, 41 (6): 755–768, doi:10.1109/12.144627
  9. Wu, Jean-Lien C.; Shin, Haw-Yun; Wu, Yi-Hsien (June 2005), "A pinwheel packet scheduling scheme for broadband wireless networks", Journal of the Chinese Institute of Engineers, 28 (4): 701–711, doi:10.1080/02533839.2005.9671037, S2CID   62761108