The Cyclical Scheduling Problem

We consider the (n − 2,n) cyclical scheduling problem which assigns a shift of n − 2 consecutive periods among a total of n periods to workers. We solve this problem by solving a series of b-matching problems on a cycle of n vertices. Each vertex has a capacity, and edges have costs associated with them. The objective is to maximize the total cost of the matching. The best known algorithm for this problem uses network flow, which runs in O(n 2logn) on a cycle. We provide an O(nlogn) algorithm for this problem. Using this, we provide an O(nlognlogn b max ) algorithm for the (n − 2,n) cyclical scheduling problem, where b max is the maximum capacity on a vertex.