Home Listing all delta partitions of a given set: Algorithm design and results
Article Open Access

Listing all delta partitions of a given set: Algorithm design and results

  • Samer Nofal EMAIL logo
Published/Copyright: July 9, 2024
Become an author with De Gruyter Brill

Abstract

Let α be a set of n elements and δ be a nonnegative integer. A δ -partition of α is a set of pairwise disjoint nonempty subsets of α such that the union of the subsets is equal to α and every subset has a size greater than δ . We formulate an algorithm for computing all δ -partitions of a given n -element set and show that the algorithm runs in O ( n ) space and O ( n ) delay time between any two successive outputs of δ -partitions of the given set. An application of the notion of δ -partitions is illustrated in the following scheduling problem. Suppose a factory has n machines and m n jobs to complete daily. Every job can be accomplished by operating at least δ + 1 machines. A machine cannot work on multiple jobs simultaneously. According to a utilization policy of the factory’s management, no machine is allowed to be idle, so all machines should be running on some job. Find a daily schedule of the factory’s machines satisfying all the mentioned constraints. Let α be the set of the factory’s machines. Then, an α ’s δ -partition with m subsets is a legal schedule if every subset (in the δ -partition) includes exclusively δ + 1 or more machines that run on the same job.

1 Introduction

Scheduling problems are ubiquitous in the real world; see, e.g., previous studies [19]. Therefore, exact-solution procedures for scheduling problems have been studied heavily over the years, where seminal methods such as linear programming, integer programming, and constraint programming were designed and analyzed prevalently; likewise, approximate-solution procedures for scheduling problems have been worldwide addressed substantially where influential approaches such as heuristic and metaheuristic algorithms were proposed and other approximation methods such as online algorithms were intensively studied; for further information, we refer the reader to previous studies [1017], for instance.

In this article, we design and analyze an exact algorithm for computing a given set’s so-called delta partitions. An application of this algorithm can be for a scheduling problem. To illustrate the connection between a scheduling problem and our algorithm of listing all delta partitions of a given set, we first define delta partitions. Let α be a set of n elements and δ be a nonnegative integer. A partition of α is a set of pairwise disjoint nonempty subsets of α such that the union of the subsets is equal to α . A δ -partition of α is a partition of α such that the size of every subset in the partition is greater than δ . For instance, the partitions of { a 1 , a 2 , a 3 } are { { a 1 , a 2 , a 3 } } , { { a 1 , a 2 } , { a 3 } } , { { a 1 , a 3 } , { a 2 } } , { { a 1 } , { a 2 , a 3 } } , { { a 1 } , { a 2 } , { a 3 } } . In contrast, the 1-partition of { a 1 , a 2 , a 3 } is { { a 1 , a 2 , a 3 } } , which is equal to the 2-partition of { a 1 , a 2 , a 3 } . Now, take the following scheduling problem. Suppose a factory has n machines and m n jobs to complete daily. Every job can be accomplished by operating at least δ + 1 machines. A machine cannot work on multiple jobs simultaneously. According to a utilization policy of the factory’s management, no machine is allowed to be idle, so all machines should be running on some job. Find a daily schedule of the factory’s machines satisfying all the mentioned constraints. Let α be the set of the factory’s machines. Then, an α ’s δ -partition with m subsets is a legal schedule if every subset (in the δ -partition) includes exclusively δ + 1 or more machines that run on the same job. In [18], the authors discussed the notion of δ -partitions and gave an asymptotic estimate for the number of δ -partitions of a given set. In this article, we devise and analyze an algorithm for generating all δ -partitions of a given set.

In Section 2, we discuss related work. In Section 3, we demonstrate that all δ -partitions of an n -element set, α , can be listed in O ( n ) space and O ( n ) delay time between any two successive outputs of δ -partitions of α . Finally, we conclude the article in Section 4.

2 Related work

The study of computing set partitions has received significant attention from combinatorial algorithms research communities for a long time until now; see, for example, previous studies [1924]. Perhaps the earliest work on formal algorithms for computing set partitions goes back to the study of Hutchinson [25], where the partitions of a set with n elements are represented by certain n -tuples of positive integers and algorithms were described, which generate the n -tuples corresponding to all partitions of the given set, all partitions of the given set into m or fewer sets ( 1 m n ), and all partitions of the given set into exactly m sets ( 1 m n ). Ehrlich [26] presented a loopless algorithm for listing all partitions of a given set with constant time between generating one set partition from the previous one. Kaye [27] arranged set partitions in a Gray code list so that each partition is obtained from its immediate predecessor by changing the class of exactly one element. Ruskey [28] developed a Gray code list of the partitions of a set into a fixed number of blocks where each partition is produced in O ( 1 ) amortized time. Er [29] gives a recursive algorithm for generating all partitions of a set with a constant time (on average) per partition generated. The practical performance of the algorithm of Er [29] was enhanced further in the study of Djokic et al. [30]. Mansour and Nassar [31] presented another combinatorial Gray code for the partitions of a given set; also, they constructed a different loopless algorithm for generating all partitions of a given set, which offers a constant time between successive partitions in the construction process. In the study of Kokosński [32], a parallel algorithm is presented for generating all n -element set partitions where each partition has at least m parts and such that each partition is generated in O ( m ) time. Likewise, Lee et al. [33] proposed another parallel algorithm for set partitioning with cost O ( n B n ) , where B n is the number of all n -element set partitions. Williams [34] gives a greedy algorithm for generating set partitions where the algorithm begins with an initial partition and an ordered list of operations and then repeatedly creates a new partition by applying the first possible operation to the most recently created partition. Huemer et al. [35] presented Gray codes for restricted set partitions, what they called non-crossing set partitions. Researchers [36,37] studied Gray codes for a different family of restricted set partitions, what they called nonsetting set partitions.

3 Listing all delta partitions of a given set

Let α = { a 1 , a 2 , a 3 , , a n } be a set of elements and δ < n be a non-negative integer. We characterize partitions and δ -partitions of α using functions. We say that Γ : α { 0 , 1 , 2 , , n } corresponds to a partition of α (or interchangeably, we say that Γ is a partition of α ) if and only if for all x α , Γ ( x ) 0 . Thus, if Γ corresponds to a partition of α , then

i range ( Γ ) { { x α Γ ( x ) = i } }

is a partition of α ; observe that range ( Γ ) is the image set of Γ . Likewise, we say that Γ corresponds to a δ -partition of α (or interchangeably, we say that Γ is a δ -partition of α ) if and only if Γ corresponds to a partition of α and for all i range ( Γ ) , { x α Γ ( x ) = i } > δ .

Note that in constructing a δ -partition of α , for all x α , Γ ( x ) is initially set to 0. But then, later in the construction process, every element of α must be assigned to a positive integer, as we elaborate throughout the article. In other words, in the process of constructing a δ -partition of α , for all x α , we denote by Γ ( x ) = 0 the initial status of x before eventually assigning x to some positive integer.

Let Γ 1 and Γ 2 be partitions of α . We say that Γ 1 and Γ 2 are identical if and only if

(1) j k such that { x : Γ 1 ( x ) = j } = { x : Γ 2 ( x ) = k } .

If two δ -partitions are identical, then it suffices to compute one of them. To this end, we use a rule for mapping elements of α to positive integers as specified in the following proposition where we prove that to construct a partition Γ of a given set α = { a 1 , a 2 , a 3 , , a n } , a 1 needs to be assigned to 1 only and, every ( a i ) i > 1 needs to be assigned to a positive integer not greater than m + 1 , where m is a positive integer that satisfies two conditions: (1) for some k < i it holds that m = Γ ( a k ) , and (2) for all j < i it is the case that m Γ ( a j ) .

Proposition 1

Let α = { a 1 , a 2 , a 3 , , a n } be a set of elements, Γ 1 be a partition of α with Γ 1 ( a i ) = λ for some a i such that λ > η + 1 , where

(2) η = 0 if i = 1 m : ( ( a k ) k < i , m ) Γ 1 with j < i , m Γ 1 ( a j ) i f i > 1 .

Then, there exists Γ 2 identical to Γ 1 such that for every ( a u ) u < i it is the case that Γ 2 ( a u ) = Γ 1 ( a u ) and Γ 2 ( a i ) = η + 1 .

Proof

Let us construct Γ 2 from Γ 1 by the following steps:

  1. Γ 2 ;

  2. for each x with Γ 1 ( x ) = λ , Γ 2 Γ 2 { ( x , η + 1 ) } ;

  3. for each x with Γ 1 ( x ) = η + 1 , Γ 2 Γ 2 { ( x , λ ) } ;

  4. for each x with Γ 1 ( x ) { λ , η + 1 } , Γ 2 Γ 2 { ( x , Γ 1 ( x ) ) } .

Notably, this process produces Γ 2 from Γ 1 such that (1) holds, so Γ 2 and Γ 1 are identical. Due to step 2 in the process, Γ 2 ( a i ) = η + 1 . However, we need to show that

(3) ( a u ) u < i Γ 2 ( a u ) = Γ 1 ( a u ) .

Observe Γ 2 ( a i ) = η + 1 and Γ 1 ( a i ) > η + 1 . Hence, according to (2), for all ( a u ) u < i

(4) Γ 1 ( a u ) < Γ 2 ( a i ) < Γ 1 ( a i ) .

Thus, we note that steps 2 and 3, in the process above do not apply to those elements that are in { a u α : u < i } ; but step 4 applies to them, and so (3) holds. □

As we are concerned with computing the δ -partitions of a set, in the following two propositions, we specify the conditions under which a function Γ has a superset Γ Γ with Γ being a δ -partition of the given set.

Proposition 2

Let α = { a 1 , a 2 , a 3 , , a n } be a set of elements, δ < n be a non-negative integer, Γ 1 : α { 0 , 1 , 2 , 3 , , n } be a function, and β be a nonempty set such that

(5) β = { j > 0 : 0 < { x : Γ 1 ( x ) = j } δ }

with

(6) { x : Γ 1 ( x ) = 0 } < j β δ { x : Γ 1 ( x ) = j } + 1 .

Then, for all Γ 2 { ( x , j ) Γ 1 : j > 0 } , Γ 2 is not a δ -partition of α .

Proof

Let Γ 2 = Γ 1 , and

(7) π = { j > 0 : 0 < { x : Γ 2 ( x ) = j } δ } ,

such that

(8) { x : Γ 2 ( x ) = 0 } < j π δ { x : Γ 2 ( x ) = j } + 1 .

Now, update Γ 2 such that for each y with Γ 2 ( y ) = 0 do

  1. Γ 2 ( y ) j , for some j π ;

  2. π { j > 0 : 0 < { x : Γ 2 ( x ) = j } δ } .

Having applied steps 1 and 2 to each y with Γ 2 ( y ) = 0 , and given (8), we note that

(9) 0 < j π δ { x : Γ 2 ( x ) = j } + 1 .

Now, assume that π = . Then, we rewrite (9) as 0 < 0 , which is impossible. Therefore, π , and so (9) implies that

(10) j > 0 such that 0 < { x : Γ 2 ( x ) = j } δ .

Hence, for all Γ 2 { ( x , j ) Γ 1 : j > 0 } , Γ 2 is not a δ -partition of α . □

Proposition 3

Let α = { a 1 , a 2 , a 3 , , a n } be a set of elements, δ < n be a non-negative integer, Γ 1 : α { 0 , 1 , 2 , 3 , , n } be a function, and β be a nonempty set such that

(11) β = { j > 0 : 0 < { x : Γ 1 ( x ) = j } δ }

with

(12) { x : Γ 1 ( x ) = 0 } = j β δ { x : Γ 1 ( x ) = j } + 1 .

Then, for all Γ 2 { ( x , j ) Γ 1 : j > 0 } it holds that

(13) y ( Γ 1 ( y ) = 0 Γ 2 ( y ) = k k β ) Γ 2 is n o t a δ - partition o f α .

Proof

Let Γ 3 = Γ 1 . Rewrite (11) and (12) by replacing Γ 1 with Γ 3 . Thus, for

(14) β = { j > 0 : 0 < { x : Γ 3 ( x ) = j } δ } ,

it holds that

(15) { x : Γ 3 ( x ) = 0 } = j β δ { x : Γ 3 ( x ) = j } + 1 .

Now, for some y with Γ 3 ( y ) = 0 , set Γ 3 ( y ) k such that k β . So, rewrite (15) as

(16) { x : Γ 3 ( x ) = 0 } < j β δ { x : Γ 3 ( x ) = j } + 1 .

Using Proposition 2, for all Γ 2 { ( x , j ) Γ 3 : j > 0 } , Γ 2 is not a δ -partition of α . Recall, { ( x , j ) Γ 3 : j > 0 } { ( x , j ) Γ 1 : j > 0 } . □

We now give our procedure listed in Algorithm 1. Let α = { a 1 , a 2 , a 3 , , a n } be a set of elements, δ < n be a non-negative integer, and Γ : α { 0 , 1 , 2 , , n } be a function such that for all x α , Γ ( x ) = 0 . If Algorithm 1 is called with l i s t _ d e l t a _ p a r t i t i o n s ( Γ , 1 , a 1 , δ ) , then the algorithm computes all δ -partitions of α .

Algorithm 1: l i s t _ d e l t a _ p a r t i t i o n s ( Γ , ρ , a i , δ )
1 Γ ( a i ) ρ ;
2 β { j > 0 : 0 < { x : Γ ( x ) = j } δ } ;
3 if β then
4 μ j β δ { x : Γ ( x ) = j } + 1 ;
5 if μ > { x : Γ ( x ) = 0 } then
6 return;
7 if μ = { x : Γ ( x ) = 0 } then
8 foreach k β do
9 l i s t _ d e l t a _ p a r t i t i o n s ( Γ , k , a i + 1 , δ ) ;
10 return;
11 if i = n then
12 report that Γ is a δ -partition;
13 return;
14 Let m { x > 0 ( a k ) k i Γ ( a k ) = x and j i , x Γ ( a j ) } ;
15 foreach k 1 to m + 1 do
16 l i s t _ d e l t a _ p a r t i t i o n s ( Γ , k , a i + 1 , δ ) ;
17 return;

For instance, run Algorithm 1 to compute all 1-partitions of α = { a 1 , a 2 , a 3 , a 4 } . Initially, call

(17) list_delta_partitions ( { ( a 1 , 0 ) , ( a 2 , 0 ) , ( a 3 , 0 ) , ( a 4 , 0 ) } , 1 , a 1 , 1 ) .

Referring to line 15 in Algorithm 1, for k = 1 , invoke

(18) list_delta_partitions ( { ( a 1 , 1 ) , ( a 2 , 0 ) , ( a 3 , 0 ) , ( a 4 , 0 ) } , 1 , a 2 , 1 ) .

Applying line 15 in Algorithm 1, when k = 1 , run

(19) list_delta_partitions ( { ( a 1 , 1 ) , ( a 2 , 1 ) , ( a 3 , 0 ) , ( a 4 , 0 ) } , 1 , a 3 , 1 ) .

Following line 15 in Algorithm 1, for k = 1 , apply

(20) list_delta_partitions ( { ( a 1 , 1 ) , ( a 2 , 1 ) , ( a 3 , 1 ) , ( a 4 , 0 ) } , 1 , a 4 , 1 ) .

Applying lines 11–13 in Algorithm 1, report that { ( a 1 , 1 ) , ( a 2 , 1 ) , ( a 3 , 1 ) , ( a 4 , 1 ) } is a 1-partition of α , and then backtrack to (19). Referring to line 15 in Algorithm 1, for k = 2 , operate

(21) list_delta_partitions ( { ( a 1 , 1 ) , ( a 2 , 1 ) , ( a 3 , 1 ) , ( a 4 , 0 ) } , 2 , a 4 , 1 ) .

At this stage, as line 6 of Algorithm 1 is performed, backtrack to (19), then to (18). Executing line 15 in Algorithm 1, for k = 2 , invoke

(22) list_delta_partitions ( { ( a 1 , 1 ) , ( a 2 , 1 ) , ( a 3 , 0 ) , ( a 4 , 0 ) } , 2 , a 3 , 1 ) .

Referring to line 8 in Algorithm 1, for k = 2 , run

(23) list_delta_partitions ( { ( a 1 , 1 ) , ( a 2 , 1 ) , ( a 3 , 2 ) , ( a 4 , 0 ) } , 2 , a 4 , 1 ) .

Following lines 11–13 in Algorithm 1, report that { ( a 1 , 1 ) , ( a 2 , 1 ) , ( a 3 , 2 ) , ( a 4 , 2 ) } is a 1-partition of α , and then return to (22), (18), then back to (17). Applying line 15 in Algorithm 1, for k = 2 , operate

(24) list_delta_partitions ( { ( a 1 , 1 ) , ( a 2 , 0 ) , ( a 3 , 0 ) , ( a 4 , 0 ) } , 2 , a 2 , 1 ) .

Referring to line 8 in Algorithm 1, when k = 1 , execute

(25) list_delta_partitions ( { ( a 1 , 1 ) , ( a 2 , 2 ) , ( a 3 , 0 ) , ( a 4 , 0 ) } , 1 , a 3 , 1 ) .

Performing line 8 in Algorithm 1, for k = 2 , operate

(26) list_delta_partitions ( { ( a 1 , 1 ) , ( a 2 , 2 ) , ( a 3 , 1 ) , ( a 4 , 0 ) } , 2 , a 4 , 1 ) .

Following lines 11–13, report that { ( a 1 , 1 ) , ( a 2 , 2 ) , ( a 3 , 1 ) , ( a 4 , 2 ) } is a 1-partition of α , and return to (25), then to (24). Referring to line 8 in Algorithm 1, for k = 2 , run

(27) list_delta_partitions ( { ( a 1 , 1 ) , ( a 2 , 2 ) , ( a 3 , 0 ) , ( a 4 , 0 ) } , 2 , a 3 , 1 ) .

According to line 8 in Algorithm 1, for k = 1 , call

(28) list_delta_partitions ( { ( a 1 , 1 ) , ( a 2 , 2 ) , ( a 3 , 2 ) , ( a 4 , 0 ) } , 1 , a 4 , 1 ) .

Running lines 11–13 in Algorithm 1, report that { ( a 1 , 1 ) , ( a 2 , 2 ) , ( a 3 , 2 ) , ( a 4 , 1 ) } is a 1-partition of α , and next, return to (27), (24), then eventually back to (17). That completes the application of Algorithm 1.

In the next two propositions, we prove the correctness of Algorithm 1.

Proposition 4

Let α = { a 1 , a 2 , a 3 , , a n } be a set of elements, δ < n be a non-negative integer, Γ : α { 0 , 1 , 2 , , n } be a function such that for all x α it holds that Γ ( x ) = 0 , and let Algorithm 1 be invoked with

l i s t _ d e l t a _ p a r t i t i o n s ( Γ , 1 , a 1 , δ ) .

If line 12 of Algorithm 1 is executed, then Γ is a δ -partition of α .

Proof

Let Γ ( i ) denote the mappings of Γ at some state i of Algorithm 1. From now on, whenever we say “state,” we mean a state of Algorithm 1. The algorithm enters a new state whenever line 1 is applied. Observe that the algorithm might report a δ -partition at state n + 1 ; see line 11 in Algorithm 1. Thus, we focus on the states that lead to a δ -partition. For the initial state, it is the case that

(29) x Γ ( 0 ) ( x ) = 0 .

And, for every i { 0 , 1 , 2 , 3 , , n } it holds that

(30) Γ ( i + 1 ) = ( Γ ( i ) \ { ( a i + 1 , 0 ) } ) { ( a i + 1 , ρ ) } ,

for some positive integer ρ , see line 1 in Algorithm 1. We need to prove that Γ can grow to a δ -partition for every state as described in Propositions 2 and 3. Starting with the case described in Proposition 2, we need to prove that for every state i { 0 , 1 , 2 , 3 , , n } , it holds that

(31) { x : Γ ( i ) ( x ) = 0 } > j β ( i ) δ { x : Γ ( i ) ( x ) = j } + 1 ,

where

(32) β ( i ) = { j > 0 : 0 < { x : Γ ( i ) ( x ) = j } δ } .

For the initial state, β ( 0 ) = , recall (29). Thereby, (31) holds since

(33) j β ( 0 ) δ { x : Γ ( 0 ) ( x ) = j } + 1 = 0

and, recalling (29),

(34) { x : Γ ( 0 ) ( x ) = 0 } = n .

Now, we will show that for all i , if (31) is true for i , then (31) holds for i + 1 . Assume that (31) holds for i . Using (32), we note that

(35) β ( i + 1 ) = { j > 0 : 0 < { x : Γ ( i + 1 ) ( x ) = j } δ } .

Recall (30); if ρ β ( i + 1 ) , then the inequality in (31) holds for i + 1 since ( a i + 1 , 0 ) is dropped from { x : Γ ( i ) ( x ) = 0 } in the left side of the inequality and ( a i + 1 , ρ ) is added to { x : Γ ( i ) ( x ) = ρ } in the right side. Thus,

(36) { x : Γ ( i + 1 ) ( x ) = 0 } = { x : Γ ( i ) ( x ) = 0 } \ { ( a i + 1 , 0 ) }

and

(37) { x : Γ ( i + 1 ) ( x ) = ρ } = { x : Γ ( i ) ( x ) = ρ } { ( a i + 1 , ρ ) } .

Therefore,

(38) { x : Γ ( i + 1 ) ( x ) = 0 } > j β ( i + 1 ) δ { x : Γ ( i + 1 ) ( x ) = j } + 1 .

Referring to (30), if ρ β ( i + 1 ) , then Inequality (31) might not hold for i + 1 ; hence, it might be the case that

(39) { x : Γ ( i + 1 ) ( x ) = 0 } < j β ( i + 1 ) δ { x : Γ ( i + 1 ) ( x ) = j } + 1

or

(40) { x : Γ ( i + 1 ) ( x ) = 0 } = j β ( i + 1 ) δ { x : Γ ( i + 1 ) ( x ) = j } + 1 .

If (39) is the case, illustrated in Proposition 2, then according to lines 5 and 6, Algorithm 1 returns to a previous state to pick another positive integer to be assigned to a i + 1 . If (40) is the case, which is demonstrated in Proposition 3, the algorithm assigns a i + 2 to a positive integer from β ( i + 1 ) , see lines 7–9 in Algorithm 1.□

Proposition 5

Let α = { a 1 , a 2 , a 3 , , a n } be a set of elements, δ < n be a non-negative integer, Γ : α { 0 , 1 , 2 , , n } be a function such that for all x α it holds that Γ ( x ) = 0 , and let Algorithm 1 be invoked with

l i s t _ d e l t a _ p a r t i t i o n s ( Γ , 1 , a 1 , δ ) .

Then, the algorithm computes every δ -partition of α .

Proof

Assume that φ is a δ -partition of α , but φ is not computed by the algorithm. Thus, for every state s

(41) φ is not identical to Γ ( s ) .

We consider the case where φ is not identical to any δ -partition computed by the algorithm; otherwise, there is no need to compute such φ as demonstrated in Proposition 1. Our purpose is to establish a contradiction with (41). Thus, we define

(42) Λ i ( r ) = { 1 , 2 , 3 , , m + 1 }

to be the set of positive integers for some a i α at some state r such that m = 0 if i = 1 ; for i > 1 , m = Γ ( r ) ( a k ) for some k < i such that m Γ ( r ) ( a j ) for all j < i . Additionally, we define σ i ( t ) Λ i ( t ) to be the set of positive integers for some a i α at some state t such that for every state s it is the case that

(43) a i Γ ( s ) ( a i ) σ i ( s ) Γ ( s ) is a δ -partition of α .

Since φ is a δ -partition of α , it is the case that for all positive integers i

(44) 1 φ ( a i ) m + 1 ,

where m = 0 if i = 1 ; for i > 1 , m = φ ( a k ) for some k < i such that m φ ( a j ) for all j < i . Considering (42) and (44), we note that

(45) s a i φ ( a i ) Λ i ( s ) .

This is consistent with Proposition 1, implemented in the algorithm on lines 15–16. Referring to (43),

(46) s a i φ ( a i ) σ i ( s ) ;

otherwise, φ is not a δ -partition as established in Propositions 2 and 3 and implemented on lines 2–10 in the algorithm. Following (43),

(47) s a i φ ( a i ) = Γ ( s ) ( a i ) and Γ ( s ) is a δ -partition of α .

This is consistent with Proposition 4, which shows the correctness of Algorithm 1. Subsequently,

(48) s φ = Γ ( s ) and Γ ( s ) is a δ -partition of α .

See the contradiction between (48) and (41).□

Now, we demonstrate the space complexity of Algorithm 1.

Proposition 6

Let α = { a 1 , a 2 , a 3 , , a n } be a set of elements, δ < n be a non-negative integer, Γ : α { 0 , 1 , 2 , , n } be a function such that Γ ( x ) = 0 for all x α , and let Algorithm 1 be invoked with l i s t _ d e l t a _ p a r t i t i o n s ( Γ , 1 , a 1 , δ ) . Then, Algorithm 1 runs in O ( n ) space.

Proof

Besides the linear-space stack required to execute the recursion of Algorithm 1 and the linear space imposed by using the function Γ inputted to the algorithm, additional space is required. Note, the set β (line 2 in the algorithm) can be implemented instead as a function : { 1 , 2 , 3 , , n } { 0 , 1 , 2 , 3 , , n } such that in the initial state of the algorithm we set ( j ) = 0 for all j . Thus, we can update ( j ) ( j ) + 1 in constant time whenever we map an element of α to some subset j , see line 1 in the algorithm. Consequently, for any state of the algorithm, for any j , it holds that

(49) ( j ) = { x : Γ ( x ) = j } .

Now, we show that μ (line 4 in the algorithm) can be computed in constant time. Hence, in the initial state of Algorithm 1, we set = 0 . Whenever we apply ( k ) ( k ) + 1 for some k , is updated subsequently (in constant time) as follows:

(50) = 1 if ( k ) > 1 + δ if ( k ) = 1

We now prove inductively that is equivalent to μ employed by Algorithm 1 at line 4. For the initial state of Algorithm 1, it is obvious that μ ( 0 ) = ( 0 ) . Next, we demonstrate that for all states i , it is the case that

(51) ( i ) = μ ( i ) ( i + 1 ) = μ ( i + 1 ) .

Suppose ( i ) = μ ( i ) . According to line 4 in the algorithm, we write

(52) ( i ) = μ ( i ) = j { l > 0 : 0 < { x : Γ ( i ) ( x ) = l } δ } δ { x : Γ ( i ) ( x ) = j } + 1 .

If we set Γ ( i + 1 ) ( x ) = k for some x α at some state i + 1 where ( i ) ( k ) > 0 , then ( i + 1 ) ( k ) > 1 . Therefore, using (50), we have

(53) ( i + 1 ) = ( i ) 1 = μ ( i ) 1 .

Observe

(54) { x : Γ ( i + 1 ) ( x ) = k } = { x : Γ ( i ) ( x ) = k } + 1 .

Thus,

(55) ( i + 1 ) = μ ( i ) 1 = 1 + j { l > 0 : 0 < { x : Γ ( i ) ( x ) = l } δ } δ { x : Γ ( i ) ( x ) = j } + 1 .

Using (54), (55) can be rewritten as

(56) ( i + 1 ) = j { l > 0 : 0 < { x : Γ ( i + 1 ) ( x ) = l } δ } δ { x : Γ ( i + 1 ) ( x ) = j } + 1 = μ ( i + 1 ) .

For the second case of (50), if we set Γ ( i + 1 ) ( x ) = k for some x α at some state i + 1 with ( i ) ( k ) = 0 , then ( i + 1 ) ( k ) = 1 . Therefore, using (50), we write

(57) ( i + 1 ) = ( i ) + δ = μ ( i ) + δ .

Observe

(58) μ ( i + 1 ) = j { l > 0 : 0 < { x : Γ ( i + 1 ) ( x ) = l } δ } δ { x : Γ ( i + 1 ) ( x ) = j } + 1 .

Subsequently,

(59) μ ( i + 1 ) = ( δ { x : Γ ( i + 1 ) ( x ) = k } + 1 ) + μ ( i ) = δ + μ ( i ) = ( i ) + δ = ( i + 1 ) .

Note that

(60) { x : Γ ( i + 1 ) ( x ) = k } = ( i + 1 ) ( k ) = 1 .□

Next, in the last proposition, we illustrate the time complexity of Algorithm 1.

Proposition 7

Let α = { a 1 , a 2 , a 3 , , a n } be a set of elements, δ < n be a non-negative integer, Γ : α { 0 , 1 , 2 , , n } be a function such that Γ ( x ) = 0 for all x α , and let Algorithm 1 be invoked with l i s t _ d e l t a _ p a r t i t i o n s ( Γ , 1 , a 1 , δ ) . Then, Algorithm 1 runs in O ( n ) delay time between any two successive outputs of δ -partitions of α .

Proof

Let Γ be a δ -partition listed by Algorithm 1 (line 12). If there are further δ -partitions of α not listed yet by the algorithm, then Algorithm 1 returns (line 13) to assign an element a i to another subset Γ ( a i ) < k m + 1 (see lines 15 and 16). Recall that m + 1 is the only empty subset because, according to line 14, m is the greatest integer representing a nonempty subset among all nonempty subsets of the current partition Γ . Now, if a i is assigned to a nonempty subset Γ ( a i ) < k m , then β (line 2) remains the same or becomes smaller, and consequently, μ (line 4) remains the same or becomes less; thus, the condition of line 5 remains false and subsequently line 6 is not executed, which means that the algorithm proceeds to the next element a i + 1 . But, if a i is assigned to the only empty subset m + 1 , then β might expand (see line 2) and so μ might increase (see line 4), which might make the condition of line 5 true and subsequently line 6 being executed; if line 6 is executed, then the algorithm returns to the caller instance of the procedure l i s t _ d e l t a _ p a r t i t i o n s (line 16) to re-assign a i to another subset. But since the loop (at lines 15 and 16) has finished (recall we were in the last round when k = m + 1 ), we return (line 17) further to the earlier instance of the procedure l i s t _ d e l t a _ p a r t i t i o n s where we were processing a i 1 . After processing a i 1 , we continue to a i to start the loop at lines 15 and 16 by assigning a i to a nonempty subset k = 1 . In summary, for each ( a i ) 1 i n , at most, two subset assignments are tried by Algorithm 1 until the next δ -partition of α is found. So far, we have discussed the cases in which the algorithm is invoked at line 16. If the procedure l i s t _ d e l t a _ p a r t i t i o n s is invoked at line 9, then line 6 will never be executed in the subsequent stages. This is because, at line 9, we invoke the procedure l i s t _ d e l t a _ p a r t i t i o n s to assign an element of α to a nonempty subset exclusively (see line 8); note that we illustrated earlier that line 6 might be run if and only if an element is assigned to an empty subset.□

4 Conclusion

We formulated and analyzed an algorithm listing all δ -partitions of a given n -element set. We discussed the correctness of the algorithm and illustrated its complexity in terms of running space and delay time between any two successive outputs of δ -partitions. We proved that the delay time of the algorithm is O ( n ) and its running space is O ( n ) . Although the algorithm can be applied to solve a scheduling problem, as discussed in the article, one can employ other solution methods to the scheduling problem, such as integer programming or constraint programming. Future research might investigate randomizing our algorithm to see whether the expected delay time of the algorithm can be better than O ( n ) . Likewise, whether the δ -partitions of a given n -element set can be computed in running space better than O ( n ) is yet to be resolved.

  1. Funding information: The author states no funding involved.

  2. Author contributions: Samer Nofal is the only author of this article.

  3. Conflict of interest: The author states no conflict of interest.

  4. Data availability statement: The study uses no data.

References

[1] J. Snauwaert and M. Vanhoucke, “A classification and new benchmark instances for the multi-skilled resource-constrained project scheduling problem,” Europ. J. Operat. Res., vol. 307, no. 1, pp. 1–19, 2023. Search in Google Scholar

[2] S. Zhang, Z. Zhou, R. Luo, R. Zhao, Y. Xiao, and Y. Xu, “A low-carbon, fixed-tour scheduling problem with time windows in a time-dependent traffic environment,” Int. J. Production Res., vol. 61, no. 18, pp. 6177–6196, 2023. Search in Google Scholar

[3] D. B. Fontes, S. M. Homayouni, and J. F. Gonçalves, “A hybrid particle swarm optimization and simulated annealing algorithm for the job shop scheduling problem with transport resources,” Europ. J. Operat. Res., vol. 306, no. 3, pp. 1140–1157, 2023. Search in Google Scholar

[4] A. Goli, A. Ala, and M. Hajiaghaei-Keshteli, “Efficient multi-objective meta-heuristic algorithms for energy-aware non-permutation flow-shop scheduling problem,” Expert Syst. Appl., vol. 213, p. 119077, 2023. Search in Google Scholar

[5] W. Wang, G. Tian, H. Zhang, Z. Li, and L. Zhang, “A hybrid genetic algorithm with multiple decoding methods for energy-aware remanufacturing system scheduling problem,” Robotics Comput-Integrated Manufacturing, vol. 81, p. 102509, 2023. Search in Google Scholar

[6] I. Hayat, A. Tariq, W. Shahzad, M. Masud, S. Ahmed, M. U. Ali, and A. Zafar, “Hybridization of particle swarm optimization with variable neighborhood search and simulated annealing for improved handling of the permutation flow-shop scheduling problem,” Systems, vol. 11, no. 5, p. 221, 2023. Search in Google Scholar

[7] K. Gkiotsalitis, C. Iliopoulou, and K. Kepaptsoglou, “An exact approach for the multi-depot electric bus scheduling problem with time windows,” Europ. J. Operat. Res., vol. 306, no. 1, pp. 189–206, 2023. Search in Google Scholar

[8] F. Mischek, N. Musliu, and A. Schaerf, “Local search approaches for the test laboratory scheduling problem with variable task grouping,” J. Scheduling, vol. 26, pp. 1–21, 2021. Search in Google Scholar

[9] K. Sylejmani, E. Gashi, and A. Ymeri, “Simulated annealing with penalization for university course timetabling,” J. Scheduling, vol. 26, pp. 1–21, 2022. Search in Google Scholar

[10] D. M. Utama and C. N. Al Imron, “A systematic literature review on no-idle flow shop scheduling problem,” Oper. Res. Forum., vol. 5, no. 1, 2024, p. 18. Search in Google Scholar

[11] Z. Bahroun, R. As’ad, M. Tanash, and R. Athamneh, “The multi-skilled resource-constrained project scheduling problem: A systematic review and an exploration of future landscapes,” Manag. Syst. Production Eng., vol. 32, no. 1, pp. 108–132, 2024. Search in Google Scholar

[12] S. B. Shargh, M. Zandieh, A. Ayough, and F. Farhadi, “Scheduling in services: a review and bibliometric analysis,” Operations Management Research, pp. 1–30, 2024. Search in Google Scholar

[13] Y. Xu, S. Wandelt, and X. Sun, “Airline scheduling optimization: literature review and a discussion of modelling methodologies,” Intelligent Transport. Infrastruct., vol. 3, p. liad026, 2024. Search in Google Scholar

[14] J. Pasha, B. Li, Z. Elmi, A. M. Fathollahi-Fard Y.-y. Lau, A. Roshani, T. Kawasaki, et al., “Electric vehicle scheduling: State of the art, critical challenges, and future research opportunities,” J. Industr. Inform. Integration, vol. 38, p. 100561, 2024. Search in Google Scholar

[15] M. Khakifirooz, M. Fathi, A. Dolgui, and P. M. Pardalos, “Scheduling in industrial environment toward future: insights from jean-marie proth,” Int. J. Production Res., vol. 62, no. 1–2, pp. 291–317, 2024. Search in Google Scholar

[16] M. Aghileh, A. Tereso, F. Alvelos, and M. O. Monteiro Lopes, “Multi-project scheduling under uncertainty and resource flexibility: a systematic literature review,” Prod. Manuf. Res., vol. 12, no. 1, p. 2319574, 2024. Search in Google Scholar

[17] E. Aktasss, H. Atmaca, and H. Akbulut, “‘Operating room and surgical team members scheduling: A comprehensive review,” J. Project Management, vol. 9, no. 2, pp. 149–162, 2024. Search in Google Scholar

[18] J. Culver and A. J. Weingartner, “Set partitions without blocks of certain sizes,” Eur. J. Comb., vol. 84, p. 103041, 2020. Search in Google Scholar

[19] T. C. Hu and M. Shing, Combinatorial Algorithms: Enlarged, Second Edition, Courier Corporation, New York, USA, 2012. Search in Google Scholar

[20] I. Mezo, Combinatorics and number theory of counting sequences, Chapman and Hall/CRC, Florida, USA, 2019. Search in Google Scholar

[21] T. Mansour, Combinatorics of Set Partitions. Boca Raton, CRC Press, 2013. Search in Google Scholar

[22] C. Savage, “A survey of combinatorial gray codes,” SIAM review, vol. 39, no. 4, pp. 605–629, 1997. Search in Google Scholar

[23] D. L. Kreher and D. R. Stinson, “Combinatorial algorithms: generation, enumeration, and search,” ACM SIGACT News, vol. 30, no. 1, pp. 33–35, 1999. Search in Google Scholar

[24] A. Nijenhuis and H. S. Wilf, Combinatorial algorithms: for computers and calculators. Elsevier, 2014. Search in Google Scholar

[25] G. Hutchinson, “Partioning algorithms for finite sets,” Commun. ACM, vol. 6, no. 10, pp. 613–614, 1963. Search in Google Scholar

[26] G. Ehrlich, “Loopless algorithms for generating permutations, combinations, and other combinatorial configurations,” J. ACM, vol. 20, no. 3, pp. 500–513, 1973. Search in Google Scholar

[27] R. Kaye, “A gray code for set partitions,” Inf. Process. Lett., vol. 5, no. 6, pp. 171–173, 1976. Search in Google Scholar

[28] F. Ruskey, “Simple combinatorial gray codes constructed by reversing sublists,” in Algorithms and Computation, 4th International Symposium Proceedings, ser. Lecture Notes in Computer Science, K. Ng, P. Raghavan, N. V. Balasubramanian, and F. Y. L. Chin, Eds., vol. 762, Springer, New York, USA, 1993, pp. 201–208. Search in Google Scholar

[29] M. C. Er, “A fast algorithm for generating set partitions,” Comput. J., vol. 31, no. 3, pp. 283–284, 1988. Search in Google Scholar

[30] B. Djokic, M. Miyakawa, S. Sekiguchi, I. Semba, and I. Stojmenovic, “A fast iterative algorithm for generating set partitions,” Comput. J., vol. 32, no. 3, pp. 281–282, 1989. Search in Google Scholar

[31] T. Mansour and G. Nassar, “Gray codes, loopless algorithm and partitions,” J. Math. Model. Algorithms, vol. 7, no. 3, pp. 291–310, 2008. Search in Google Scholar

[32] Z. Kokosiński, “A new algorithm for generation of exactly m-block set partitions in associative model,” Lecture Notes in Computer Science, vol. 3911 LNCS, 2006, pp. 67–74. Search in Google Scholar

[33] W. Lee, J. Tsay, H. Chen, and T. Tseng, “An optimal systolic algorithm for the set partitioning problem, Parallel Algorithms Appl., vol. 10, no. 3–4, pp. 301–313, 1997. Search in Google Scholar

[34] A. Williams, “The greedy gray code algorithm,” in Algorithms and Data Structures, 13th International Symposium Proceedings, ser. Lecture Notes in Computer Science, F. Dehne, R. Solis-Oba, and J. Sack, Eds., vol. 8037. Springer, 2013, pp. 525–536. Search in Google Scholar

[35] C. Huemer, F. Hurtado, M. Noy, and E. Omaña-Pulido, “Gray codes for non-crossing partitions and dissections of a convex polygon,” Discrete Appl. Math., vol. 157, no. 7, pp. 1509–1520, 2009. Search in Google Scholar

[36] A. Conflitti and R. Mamede, “Gray codes and lexicographical combinatorial generation for nonnesting and sparse nonnesting set partitions,” Theor. Comput. Sci., vol. 592, pp. 87–96, 2015. Search in Google Scholar

[37] A. Conflitti and R. Mamede, “Gray codes for noncrossing and nonnesting partitions of classical types,” IJAC, vol. 27, no. 5, pp. 455–476, 2017. Search in Google Scholar

Received: 2023-10-15
Revised: 2024-03-17
Accepted: 2024-05-21
Published Online: 2024-07-09

© 2024 the author(s), published by De Gruyter

This work is licensed under the Creative Commons Attribution 4.0 International License.

Articles in the same Issue

  1. Regular Articles
  2. AFOD: Two-stage object detection based on anchor-free remote sensing photos
  3. A Bi-GRU-DSA-based social network rumor detection approach
  4. Task offloading in mobile edge computing using cost-based discounted optimal stopping
  5. Communication network security situation analysis based on time series data mining technology
  6. The establishment of a performance evaluation model using education informatization to evaluate teacher morality construction in colleges and universities
  7. The construction of sports tourism projects under the strategy of national fitness by wireless sensor network
  8. Resilient edge predictive analytics by enhancing local models
  9. The implementation of a proposed deep-learning algorithm to classify music genres
  10. Moving object detection via feature extraction and classification
  11. Listing all delta partitions of a given set: Algorithm design and results
  12. Application of big data technology in emergency management platform informatization construction
  13. Evaluation of Internet of Things computer network security and remote control technology
  14. Chinese and English text classification techniques incorporating CHI feature selection for ELT cloud classroom
  15. Software compliance in various industries using CI/CD, dynamic microservices, and containers
  16. The extraction method used for English–Chinese machine translation corpus based on bilingual sentence pair coverage
  17. Material selection system of literature and art multimedia courseware based on data analysis algorithm
  18. Spatial relationship description model and algorithm of urban and rural planning in the smart city
  19. Hardware automatic test scheme and intelligent analyze application based on machine learning model
  20. Integration path of digital media art and environmental design based on virtual reality technology
  21. Comparing the influence of cybersecurity knowledge on attack detection: insights from experts and novice cybersecurity professionals
  22. Simulation-based optimization of decision-making process in railway nodes
  23. Mine underground object detection algorithm based on TTFNet and anchor-free
  24. Detection and tracking of safety helmet wearing based on deep learning
  25. WSN intrusion detection method using improved spatiotemporal ResNet and GAN
  26. Review Article
  27. The use of artificial neural networks and decision trees: Implications for health-care research
  28. Special Issue on Informatics 2022
  29. Solving linear and nonlinear problems using Taylor series method
Downloaded on 17.9.2025 from https://www.degruyterbrill.com/document/doi/10.1515/comp-2024-0011/html
Scroll to top button