Moderate Exponential-time Quantum Dynamic Programming Across the Subsets for Scheduling Problems111This is an extension of the conference paper of Grange et al., 2023a .
Abstract
Grover Search is currently one of the main quantum algorithms leading to hybrid quantum-classical methods that reduce the worst-case time complexity for some combinatorial optimization problems. Specifically, the combination of Quantum Minimum Finding (obtained from Grover Search) with dynamic programming has proved particularly efficient in improving the complexity of NP-hard problems currently solved by classical dynamic programming. For these problems, the classical dynamic programming complexity in , where denotes that polynomial factors are ignored, can be reduced by a hybrid algorithm to , with . In this paper, we provide a bounded-error hybrid algorithm that achieves such an improvement for a broad class of NP-hard single-machine scheduling problems for which we give a generic description.
Moreover, we extend this algorithm to tackle the 3-machine flowshop problem. Our algorithm reduces the exponential-part complexity compared to the best-known classical algorithm, sometimes at the cost of an additional pseudo-polynomial factor.
keywords: Discrete Optimization, Quantum computing, Scheduling, Dynamic Programming
1 Introduction
The fields of quantum computing and combinatorial optimization are becoming every day more closely linked, thanks to the work of the quantum computing community, as well as the more recent interest of the operations research community that has been focusing on the new quantum paradigm. More precisely, there are two types of quantum algorithms for solving optimization problems. The first type encompasses heuristics, often designed today as hybrid quantum-classical algorithms, such as the class of Variational Quantum Algorithms described by Cerezo et al., (2021) or by Grange et al., 2023b and, within it, the famous Quantum Approximate Optimization Algorithm (QAOA) of Farhi et al., (2014). Essentially, these algorithms require the optimization problem to be formulated as an unconstrained binary problem with polynomial objective function and can be implemented on current noisy quantum computers because the quantum part can be made rather small. Note that, usually, the problem is formulated as a QUBO (Quadratic Unconstrained Binary Optimization) to limit the number of entanglement gates. Among others, the problems of MAX-CUT (Farhi et al., , 2014), Travelling Salesman Problem (Ruan et al., , 2020), MAX-3-SAT (Nannicini, , 2019), Graph Coloring (Tabi et al., , 2020) and Job Shop Scheduling (Kurowski et al., , 2023) are reformulated as QUBO and solved with hybrid heuristics on small instances. However, due to the small size of instances processed today and the nature of heuristics whose performances are evaluated empirically, no quantum advantage with these heuristics is emerging yet. This is where the second type of quantum algorithms differ: they are exact algorithms (i.e. that output the optimal solution with a high probability of success) that provide theoretical speed-ups for several types of problems and algorithms, as displayed by Nannicini, (2022) and Sutter et al., (2020). Notice that with the current quantum hardware, it is impossible to implement them today because of the huge size of quantum resources they require.
Grover, (1996) provides one key exact quantum algorithm, that achieves a quadratic speed-up when searching for a specific element in an unsorted table, where the complexity is computed as the number of queries of the table and is done by an oracle. Grover Search represents the routine of many exact quantum algorithms. For instance, Dürr and Høyer, (1996) use Grover Search as a subroutine for a hybrid quantum-classical algorithm that finds the minimum of an unsorted table, resulting in the algorithm called Quantum Minimum Finding. Later, Ambainis et al., (2019) combine Quantum Minimum Finding with dynamic programming to address NP-hard vertex ordering problems, such as the Traveling Salesman Problem (TSP) or the Minimum Set Cover problem. The problems of interest must satisfy a specific property which implies that they can be solved by classical dynamic programming in , where is usually not smaller than 2. Henceforth, we use which is the usual asymptotic notation that ignores the polynomial factors in the complexity. The hybrid algorithm of Ambainis et al., (2019) reduces the complexity to for . As an example, Held and Karp, (1970) dynamic programming solves the TSP in whereas the hybrid algorithm of Ambainis et al., (2019) achieves to solve it in by combining the dynamic programming recurrence of Held and Karp with Quantum Minimum Finding. Following the work of Ambainis et al., (2019), other NP-hard problems have been tackled with the idea of combining Grover Search (or Quantum Minimum Finding) and classical dynamic programming. This has led to quantum speed-ups for the Steiner Tree problem (Miyamoto et al., , 2020) and the graph coloring problem (Shimizu and Mori, , 2022).
The purpose of this work is to provide a hybrid quantum-classical algorithm, adapting the seminal idea of Ambainis et al., (2019), that reduces the time complexity of solving NP-hard scheduling problems. For that, we propose an extended version of well-known Dynamic Programming Across the Subsets (DPAS) recurrences used to solve combinatorial optimization problems like scheduling problems (see e.g. T’kindt et al., (2022)). Notice that DPAS is a common technique for designing exact algorithms for NP-hard problems as described by Woeginger, (2003).
Scheduling problems and DPAS.
A scheduling problem lies in finding the optimal assignment of a set of jobs to machines over time. Each job is defined by at least a processing time and possibly additional data like a due date , a deadline , or even a weight reflecting its priority. One or more machines can process the set of jobs, however, at any time point, a machine can only process one job at a time. The computation of a schedule is done to minimize a given objective function.
In Sections 2 and 3, we consider single-machine scheduling problems. Let be the set of jobs to schedule on the machine. While a solution to a single-machine scheduling problem is described by a starting time for each job on the machine, it is standard to describe instead such a solution by a permutation of the jobs. Indeed, the starting times can be directly deduced from the order of jobs in the permutation and the potential constraints thanks to the following assumptions. First, we assume that only one job can be processed at any time on the machine. Second, we deal only with non-preemptive scheduling, meaning that a job must be run to completion when it started. Henceforth, we use the permutation representation for the solutions. In Section 5, we consider the 3-machine flowshop of jobs. The definition of this problem, introduced in the above-mentioned section, makes also a solution entirely described by a permutation of even if there are 3 machines.
Throughout this paper, we use the usual notation , introduced by Graham et al., (1979), to describe the scheduling problem consisting of machines, with the constraints and the criterion to be minimized. For instance, is the problem of minimizing the total weighted completion time with deadline constraints on a single machine. The reader interested in scheduling can refer to any textbook in scheduling, e.g. to Pinedo, (2012).
The single-machine scheduling problems addressed in this work are those that satisfy the Dynamic Programming Across the Subsets (DPAS) property. It means that these problems can be solved by Dynamic Programming where the optimal solution for a set of jobs is computed as the best concatenation over all of the optimal solution for and the cost of setting as the last processed jobs. Specifically, if we note the optimal value for processing the set of jobs, the recursion is
(1) |
where is a function depending on job . This generic recursion captures many single-machine scheduling problems as recalled in the survey of T’kindt et al., (2022), leading to the worst-case time complexity of to solve all these problems. This naturally raises the question of the existence of moderate exponential-time algorithms with a complexity where . The question has been answered positively for specific problems such as minimizing the total weighted completion time with precedence constraints in for small by Cygan et al., (2014). But, as far as we know, no generic method provides such an improvement for a broad class of scheduling problems. In this paper, we present a hybrid algorithm that solves the problems satisfying (1) in , sometimes with an additional pseudo-polynomial factor in the complexity that comes from the generalization of the recurrence.
Our contributions.
We extend existing recurrences for scheduling problems leading to a quantum speed-up for solving a general class of scheduling problems. The dynamic programming recurrences are adapted to solve scheduling problems with a proposed hybrid algorithm Q-DDPAS, which is an extension of the algorithm of Ambainis et al., (2019). Specifically, Q-DDPAS relies on dynamic programming over values indexed by a set, as by Ambainis et al., (2019), but also indexed by a new integer parameter. This new indexation is of a different nature from indexing with a set because it is not exhaustively enumerate in the recurrence but enables to express temporal constraints. Q-DDPAS also deals with non-linear objective functions, for which this is not sufficient anymore to add values of subsets but requires new ways to combine values, e.g. composition, coming from the specificity of scheduling objective functions. Specifically, we cover three types of problems that satisfy three different kinds of dynamic programming properties. For each of them, the best-known classical time complexity is in that is reduced in by the hybrid algorithm of this paper, where is a pseudo-polynomial factor. Not only it applies to problems for which the dynamic programming property is based on the addition of optimal values of the problem on sub-instances (as done by Grange et al., 2023a ) but it also relates to problems for which the dynamic programming naturally applies on the composition of optimal values of the problem on sub-instances. Furthermore, we address the 3-machine flowshop problem that differs from previous problems by the nature of the recurrence property and widens the range of problems solved by the hybrid algorithm. Last, we also propose an approximation scheme for the 3-machine flowshop problem based on the hybrid algorithm. We summarize in Table 1 the complexities of several NP-hard scheduling problems through which we illustrate the recurrences in this paper.
Problem | Our hybrid algorithm | Best classical algorithm |
---|---|---|
(T’kindt et al., , 2022) | ||
(T’kindt et al., , 2022) | ||
, for small (Cygan et al., , 2014) | ||
(Ploton and T’kindt, , 2022) | ||
(Ploton and T’kindt, , 2022) | ||
(Shang et al., , 2018; Ploton and T’kindt, , 2023) |
Structure of the paper.
First, we present in Section 2 problems for which the dynamic programming property is based on the addition of optimal values of the problem on sub-instances (called Additive DPAS). We begin with the example of problem and then provide a generic description of the problems at stake. We describe the related hybrid algorithm (called Q-DDPAS) as it is usually done in the algorithmic quantum literature, namely with a high-level description where quantum boxes interact with the classical part. We provide a rigorous and detailed description of the circuit-based implementation for interested readers in our companion paper (Grange et al., , 2024). Similarly, we tackle in Section 3 problems for which the dynamic programming property is based on the addition of optimal values of the problem on sub-instances (called Composed DPAS), beginning with the example of problem . We provide in Section 4 some applications of Q-DDPAS to the scheduling literature. Lastly, in Section 5, we consider the 3-machine flowshop problem, for which the dynamic programming recurrence applies to its decision version. It results in a slightly different hybrid algorithm. Additionally, we provide an approximation scheme for this problem, based on the hybrid algorithm, that disposes of the pseudo-polynomial factor in the time complexity. We recall in Appendix A useful bounds to derive the complexities of the proposed algorithms.
2 Additive DPAS
In this section, we present problems for which the dynamic programming recursion is based on the addition of optimal values of problems for sub-instances. Next, we detail the hybrid algorithm Q-DDPAS to solve these problems.
2.1 A scheduling example
The NP-hard single-machine scheduling problem at stake is the minimization of the total weighted completion time with deadline constraints, often referred to as in the scheduling literature. The input is given, for each job , by a weight , a processing time and a deadline before which the job must be completed. We define the completion time of job as the end time of the job on the machine for the permutation . So, if starts as time for the permutation , then . The problem aims at finding the feasible permutation for which the total weighted sum of completion times is minimal. A permutation is feasible if for all job . Thus, the problem can be formulated as follows:
where the set of feasible permutations is
This problem satisfies two recurrences. For deriving them, we need to introduce the set , where we use the notation for integers and . For and , we define as the optimal value of the problem in which only jobs in are scheduled from time . Thus, solving our nominal problem amounts to compute .
The first recurrence comes from the standard Dynamic Programming Across the Subsets (DPAS) described in (1). However, compared to usual DPAS, we introduce an extra parameter necessary for the solution with our hybrid algorithm as explained later. The idea of this recurrence is to get the optimal value of our problem for jobs in and starting at time by finding, over all jobs , the permutation that ends by with the best cost value. It is possible to do so because no matter what the optimal permutation of the first jobs is, the cost of setting job at the end of the permutation is always known. Indeed, the time taken to process all jobs in is always . Thus, the completion time of is defined by . It results that the cost of setting at the end of the permutation is . It also implies that the deadline constraint for job is satisfied if . Specifically, for all and for all , we have
(2) |
initialized by .
The second recurrence generalizes the previous one. For this recurrence, the principle of computing is similar to (2) but instead of setting one job at the end of the permutation, we choose jobs and set them to be the half last jobs of the permutation. Specifically, for all of even cardinality and , we have
(3) |
initialized by, and ,
For a given of size , recurrence (3) computes the best permutation of jobs in starting at time , and the best permutation of jobs in starting at time as we know that, as before, no matter what is the optimal permutation for jobs in , the time taken to process them all is exactly .
The two above recurrences have been illustrated with problem . In the next subsection, we propose a general formulation of these recurrences that will be used to elaborate our algorithm as general as possible to solve a broad class of scheduling problems.
2.2 General formulation of recurrences
Let us consider the following general scheduling problem:
where is the set of feasible permutations of according to given constraints and is the objective function. We introduce a related problem useful for deriving the dynamic programming recursion, for which we specify the instance: for and ,
(4) |
as the nominal scheduling problem that schedules only jobs in and starts the schedule at time . Let us note the optimal value of . It results that solving amounts to solving , and it can be performed by Q-DDPAS if the related problem satisfies the two recurrences (Add-DPAS) and (Add-D-DPAS) below. Henceforth, we denote by the set of all subsets of , and by the set . Let us introduce the first recurrence.
Property 2.1 (Additive DPAS).
There exists a function , computable in polynomial time, such that, for all and for all ,
(Add-DPAS) |
initialized by .
Lemma 2.2.
Dynamic programming (Add-DPAS) solves in .
Proof.
Throughout, we commit a slight abuse of language by letting (Add-DPAS) both refer to the property satisfied by a given optimization problem and to the resulting dynamic programming algorithm. Notice the presence of the additional parameter in the above definition, which is typically absent in the scheduling literature. In particular, is a constant throughout the whole recursion (Add-DPAS) and does not impact the resulting computational complexity. The use of that extra parameter in shall be necessary later when applying our hybrid algorithm.
Property 2.1 expresses that finding the optimal value of for jobs in and starting at time is done by finding over all jobs the permutation that ends by with the best cost value. Function represents the cost of being the last job of the permutation. Notice that isolating the last job of the permutation is a usual technique in scheduling as displayed in (1). In the second recurrence below, we provide a similar scheme, where instead of one job, we isolate half of the jobs in , turning the computation of to the solution of another problem on a sub-instance with jobs.
Property 2.3 (Additive Dichotomic DPAS).
There exist two functions and , computable in polynomial time, such that, for all of even cardinality, and for all ,
(Add-D-DPAS) |
initialized by the values for each and .
For a given , the above recursion computes the best permutation of jobs in starting at time , and the best permutation of jobs in starting at time , adding the function that represents the cost of the concatenation between these two permutations.
Remark 2.4.
We observe that problem (4) satisfies recurrence (Add-DPAS) if and only if it satisfies (Add-D-DPAS). This can be seen by developing recursively both recurrences, which essentially leads to optimization problems over , whose objective functions respectively involve in the first case and and in the second case. Here, one readily verifies that can then be defined from and and reciprocally.
Despite the previous remark, the two recurrences differ on the size of the subsets considered along the recursions, leading to different formulations and therefore require more or less sub-problems to be solved optimally in the dynamic programming process. This is formalized in the following proposition. Note that we use the notation if dominates asymptotically .
Lemma 2.5.
Dynamic programming (Add-D-DPAS) solves in .
The proof is given in the Supplementary Materials. Notice that if is not a power of 2, we can still add fake jobs without changing the following conclusion: solving with (Add-DPAS) is faster than with (Add-D-DPAS). However, in the next subsection, we describe a hybrid algorithm Q-DDPAS that improves the complexity of solving by combining recurrences (Add-DPAS) and (Add-D-DPAS) with a quantum subroutine.
2.3 Hybrid algorithm for Additive DPAS
In this subsection, we describe our hybrid algorithm Q-DDPAS adapted from the work of Ambainis et al., (2019). Notice that it assumes to have a quantum random access memory (QRAM) (Giovannetti et al., , 2008), namely, to have a classical data structure that stores classical information but can answer queries in quantum superposition. We underline that this latter assumption is strong because QRAM is not yet available on current universal quantum hardware. First, let us introduce the Quantum Minimum Finding algorithm of Dürr and Høyer, (1996), which constitutes a fundamental subroutine in our algorithm. This algorithm essentially applies several times Grover Search (Grover, , 1996) and provides a quadratic speedup for the search of a minimum element in an unsorted table.
Definition 2.6 (Quantum Minimum Finding (Dürr and Høyer, , 1996)).
Let be a function. Quantum Minimum Finding computes the minimum value of and the corresponding minimizer . The complexity of Quantum Minimum Finding is , where is the complexity of computing a value of .
Remark 2.7 (Success probability and bounded-error algorithm (Bernstein and Vazirani, , 1993)).
Dürr and Høyer, (1996) prove that Quantum Minimum Finding computes the minimum value with a probability of success strictly larger than , independent of . Thus, for , finding the minimum value with probability is achieved by repeating times Quantum Minimum Finding. Henceforth, we refer to this statement when we write that Quantum Minimum Finding finds the minimum value with high probability. Equivalently, we say that this is a bounded-error algorithm. More generally, in the rest of the paper, we call a bounded-error algorithm an algorithm that provides the optimal solution with a probability as close to 1 as we want by repeating it a number of times independent of the instance size.
Next, we describe the algorithm of Ambainis et al., (2019) adapted for our Additive DPAS recurrences which implies extra parameters in . We call it Q-DDPAS and it consists essentially of calling recursively twice Quantum Minimum Finding and computing classically the left terms. Without loss of generality, we assume that 4 divides . This can be achieved by adding at most three fake jobs and, therefore, does not change the algorithm complexity. Q-DDPAS consists of two steps. First, we compute classically by (Add-DPAS) the optimal values of on sub-instances of jobs and for all starting times . Second, we call recursively two times Quantum Minimum Finding with (Add-D-DPAS) to find optimal values of on sub-instances of jobs starting at any time , and eventually of jobs starting at (corresponding to the optimal value of the nominal problem ). Specifically, we describe Q-DDPAS in Algorithm 1.
Theorem 2.8.
The bounded-error algorithm Q-DDPAS (Algorithm 1) solves in .
The detailed proof of the correctness of the algorithm, involving the description of the gate implementation, is detailed in the companion paper Grange et al., (2024), with all the low-level details for implementing the algorithm.
Proof.
Hereafter, we provide a high-level proof. The upper bounds to simplify the complexities are detailed in the Appendix A.
-
•
Classical part: computing all for all of size and for all (Step 1 in Algorithm 1) is done by (Add-D-DPAS) in time .
-
•
Quantum part: according to Quantum Minimum Finding complexity (Definition 2.6), computing with Quantum Minimum Finding (Step 1 in Algorithm 1) is done in , where is the complexity of computing for a of size and . The essence of the quantum advantage here is that we do not need to enumerate all sets and all time but we apply the Quantum Minimum Finding in parallel to all at once. Notice that is the number of balanced bi-partitions of , namely the number of elements we search over to find the minimum of Equation (Add-D-DPAS) when computing . Thus, is exactly the complexity of Quantum Minimum Finding applied on Step 1 in Algorithm 1, namely where is the complexity of computing for of size and . Those values are already computed and stored in the QRAM (Step 1 in Algorithm 1), namely, . Thus, the quantum part complexity is .
Eventually, Q-DDPAS complexity is the maximum of the classical and the quantum part complexity. Specifically, the total complexity is . ∎
We observe that the complexity of Q-DDPAS can be further reduced by performing a third call to Equation (Add-D-DPAS) as suggested by Ambainis et al., (2019).
Observation 2.9.
A slight modification of Q-DDPAS reduces the complexity to .
Proof.
The slight modification of Q-DDPAS amounts to adding a level of recurrence in the quantum part so that the complexity of the classical part reduces whereas the complexity of the quantum part increases so that both are equal and thus minimize the total complexity. The third call searches for the best concatenation among all the bi-partitions of size (that are integers asymptotically), i.e. solving
The classical part computes all for of size and , in The quantum part applies three levels of recurrence of Quantum Minimum Finding, computing the minimum over functions with a domain of size , and respectively. Its complexity is then (see Appendix A). ∎
Notice that the classical part of Q-DDPAS can be replaced by any classical algorithm , if computes in all for of size and . Moreover, if happens to reduce the classical part complexity for , the complexity of Q-DDPAS can also be reduced in the same spirit as the slight modification of Observation 2.9.
The application of Q-DDPAS for Additive DPAS to the specific problem introduced in Subsection 2.1 is given in Subsection 4.1, together with other scheduling examples. Before introducing other types of problems tackled by Q-DDPAS in the next section, we provide some insights to underline why the use of the quantum subroutine Quantum Minimum Finding in Q-DDPAS must be carefully combined with classical computation to achieve a quantum speedup.
Remark 2.10.
Solving with (Add-DPAS) and replacing each classical computation of the minimum by the quantum subroutine Quantum Minimum Finding would not improve the best classical complexity. Indeed, the complexity would be
Remark 2.11.
Solving exclusively by recursive calls to Quantum Minimum Finding (thus avoiding the classical computations for sets of size ) would not improve the classical complexity. Using recurrence (Add-D-DPAS), which is the quantum part of Algorithm 1 with roughly recursive calls, would give a complexity in that is worse than . Using recurrence (Add-DPAS) would be even worse because it would require recursive calls leading to the complexity .
3 Composed DPAS
In this section, we study scheduling problems whose constraints enable only the composition of problems on sub-instances. We describe the adaptation of Q-DDPAS for these problems.
3.1 A scheduling example
We begin with the specific problem of minimizing the total weighted number of late jobs with release date constraints, often referred to as in the literature. The input is given by, for each job , a weight , a processing time , a release date that is the time from which the job can be scheduled (and not before), and a due date that indicates the time after which the job is late. Thus, a job is late in permutation if its completion time is larger than , namely if . We name its indicator function of lateness. This problem aims at finding the feasible permutation, namely where each job starts after its release date, for which the total weighted number of late jobs is minimal. Thus, the problem can be formulated as follows:
where the set of feasible solutions is
This problem does not satisfy the recurrences (Add-DPAS) and (Add-D-DPAS) because the release date constraints do not allow the addition of sub-instances. Let us take the example of (Add-D-DPAS). The starting time of the second half of jobs in (Add-D-DPAS) can be known only if we know the optimal permutation of the first half job, which is in opposition with the dynamic programming principle. Indeed, the release dates enable empty slots in the scheduling on the first half job such that the time to process all these jobs is not always equal to and can be larger.
This observation leads to different recurrences, where the time to process the jobs would be known by dynamic programming. For that, we define an auxiliary problem on which the recurrences apply and we introduce a new set of parameters . For , and , we note the minimum makespan, i.e. the completion time of the last job, for jobs in beginning at time where the weighted number of late jobs is exactly . Notice that by convention, if there is no feasible solution, i.e. if . Thus, our initial problem is
The following recurrence that satisfies the auxiliary problem is inspired by the work of Lawler, (1990) for the problem of minimizing the total weighted number of late jobs on a single machine under preemption and release date constraints (). For , , ,
In this recurrence, for each , we impose as the last job of the permutation and distinguish two cases, whether it is late or not. Notice that the starting time of is known and equal to which represents the value for the time parameter. The recurrence is initialized by, for , and ,
This recurrence generalizes into the following dichotomic version for which, instead of setting the last job of the permutation, we set the half-last jobs. For all of even cardinality, and ,
initialized by the same values of for , and . Next, we provide generic recurrences to consider problems for which the composition of sub-instances is possible.
3.2 General formulation of recurrence
Let us consider a scheduling problem with jobs
where is the set of feasible permutations of according to given constraints and is the objective function. Following the example detailed in the previous subsection, we consider an auxiliary problem useful for deriving the dynamic programming recursion, for which we specify the instance: for the jobs to be scheduled, the starting time of the schedule and , we define
(5) |
where , respectively , is the objective function, respectively the feasible set, are different from those of . We assume that solving amounts to finding the smallest such that the auxiliary problem is bounded. Specifically,
(6) |
To solve the nominal problem by classical dynamic programming, problem must satisfy recurrence (Comp-DPAS) or recurrence (Comp-D-DPAS) below (as in Remark 2.4, we can state that a problem satisfies one if and only if it satisfies the other one). As we explain later, solving with our hybrid algorithm requires problem to satisfy the two recurrences.
Property 3.1 (Composed DPAS).
For all , and ,
(Comp-DPAS) |
initialized by the values of for all , and . Notice that for , and , we adopt the convention for .
Recurrence (Comp-DPAS) differs from recurrence (Add-DPAS) in two aspects. First, the optimal values of the problem on sub-instances are composed, and not added, because of the nature of the constraints. Second, the search for the minimum value is done not only over all jobs in , but also over all values in . More precisely, for a given , the optimal value of is the minimum value of all possible composition of optimal values of the problem on sub-instances with parameters and such that . We have the following result.
Lemma 3.2.
(Comp-DPAS) solves in .
Proof.
Let . Similarly to the proof of Lemma 2.2, we show that (Comp-DPAS) solves in . Indeed, to compute , we need to solve Equation (Comp-DPAS) for all such that starting from to , and for all and . For a given , and , the values and are known, so is computed in time according to Equation (Comp-DPAS). Eventually, the total complexity of computing is Moreover, solving amounts to solving ,for all , according to (6). The complexity results directly from the above complexity of computing , for . ∎
The auxiliary problem must satisfy the following recurrence (Comp-D-DPAS) in addition to recurrence (Comp-DPAS).
Property 3.3 (Composed Dichotomic DPAS).
For all of even cardinality, and ,
(Comp-D-DPAS) |
initialized by the values of for all , and .
Lemma 3.4.
(Comp-D-DPAS) solves in .
Proof.
As for the Additive DPAS, we notice that, with a classical dynamic programming algorithm, the time complexity to solve with recurrence (Comp-DPAS) is better than with recurrence (Comp-D-DPAS). Next, we show that the hybrid algorithm applied to problems satisfying Additive DPAS recurrences can be easily adapted to tackle problems satisfying Composed DPAS recurrences.
3.3 Hybrid algorithm for Composed DPAS
The hybrid algorithm for Composed DPAS derives naturally from Algorithm 1. It amounts to replacing the recurrence (Add-DPAS), respectivelly (Add-D-DPAS), by (Comp-DPAS), respectivelly (Comp-D-DPAS), resulting in Algorithm 2. Eventually, we use Algorithm 2 as a subroutine to solve Equation (6), i.e. to solve the nominal problem .
Lemma 3.5.
Let . The bounded-error algorithm Q-DDPAS (Algorithm 2) solves in .
Notice that the implementation of this algorithm is slightly different from the one of Algorithm 1, mainly due to the operation of composition. The details are given in the companion paper (Grange et al., , 2024).
Theorem 3.6.
The bounded-error Algorithm 3, with Q-DDPAS as a subroutine, solves in .
As for the case of Q-DDPAS for Additive DPAS, we can reduce the exponential part of Q-DDPAS complexity for Composed DPAS, by the modification indicated in Observation 2.9, thus leading to the following observation.
Observation 3.7.
A slight modification of the Q-DDPAS algorithm can reduce the complexity of Algorithm 3 to .
4 Application to the scheduling literature
In Subsection 2.2 and Subsection 3.2, we provided general formulations of problems satisfying Additive and Composed DPAS recurrences. Next, we illustrate these recurrences with several NP-hard single-machine scheduling problems enabling their resolution with our hybrid algorithm Q-DDPAS. The list of problems is non-exhaustive but highlights the structures’ specificity of scheduling problems that enable such recurrences. Eventually, for each problem, we compare in Table 1 the worst-case time complexity of Q-DDPAS with the complexity of the best-known moderate exponential-time exact algorithm. Q-DDPAS improves the exponential-part complexity, sometimes at the cost of an additional pseudo-polynomial factor.
4.1 Scheduling with deadlines and precedence constraints
Single-machine scheduling problems with no constraints, deadline constraints or precedence constraints satisfy the addition of optimal values of the problem on sub-instances. We provide next several examples of problems that satisfy Additive DPAS and thus can be solved by Q-DDPAS (Algorithm 1).
In Subsection 2.1, we have presented the problem of minimizing the total weighted completion time with deadline constraints (). The formulation needed the set to be equal to , hence its resolution with Q-DDPAS is in according to Observation 2.9. Next, we give two more examples, beginning with the strongly NP-hard scheduling problem with minimization of the total weighted tardiness. Henceforth, we note the sum of processing times of the jobs in .
Example 1 (Minimizing the total weighted tardiness, ).
For each job , we are given a weight , a processing time , and a due date that indicates the time after which the job is late. Thus, a job is late in permutation if its completion time is larger than , and we define as its tardiness. Our problem aims at finding the permutation that minimizes the total weighted tardiness, referred to as in the scheduling literature. Let be the set of all possible starting times. We define the related problem of Equation (4) as follows: for and , and for :
where represents the tardiness of job for the effective due date . Problem satisfies both Additive DPAS recurrences. Indeed, Equation (Add-DPAS) is valid with:
where the computation of is polynomial (linear). Moreover, Equation (Add-D-DPAS) is valid for the following functions:
(7) |
initialized by, for and ,
We consider the scheduling problem with precedence constraints and minimization of the total weighted completion time that is also NP-hard. Conversely to the two previous examples, the set is reduced to , and function translates the potential infeasibility of the concatenation of problem on two sub-instances.
Example 2 (Minimizing the total weighted completion time with precedence constraints, ).
We are given, for each job , a processing time , a weight , and a set of precedence constraints . A pair of jobs in implies that must precede in the permutation, namely that must be processed before . Our problem, denoted by , aims at finding the feasible permutation, i.e. that respects the precedence constraints, that minimizes the total weighted completion time. Let be . Here, an instance of the problem of Equation (4) under consideration is only indexed by the chosen subset of . Thus, we consider the problem as follows: for , and for : Our problem satisfies both Additive DPAS recurrences. Indeed, Equation (Add-DPAS) is valid for:
where the computation of is polynomial (quadratic). This problem also satisfies (Add-D-DPAS). Indeed, Equation (Add-D-DPAS) is valid for the following functions: such that
where the computation of is polynomial (quadratic). The initialization is, for ,
The three NP-hard scheduling problems examples described above can be solved with Q-DDPAS for Additive DPAS (Algorithm 1). We illustrate in Table 2 the worst-case time complexities of solving them with Q-DDPAS and compare them with the complexities of the best-known exact classical algorithms. Q-DDPAS improves the complexity of the exponent but sometimes at the cost of a pseudo-polynomial factor.
Problem | Q-DDPAS for Additive DPAS | Best classical algorithm |
---|---|---|
(T’kindt et al., , 2022) | ||
(T’kindt et al., , 2022) | ||
, for small (Cygan et al., , 2014) |
4.2 Scheduling with release date constraints
Single-machine scheduling problems with release date constraints do not satisfy the addition of optimal values of the problem on sub-instances but enable the composition of them. We illustrate this notion with two examples of problems that satisfy Composed DPAS and thus can be solved by Q-DDPAS (Algorithm 2).
We have presented in Subsection 3.1 an example that is the problem of minimizing the weighted number of late jobs with release date constraints (). We have shown that the two sets to define the auxiliary problem are and . Thus, Q-DDPAS solves this problem in according to Observation 3.7. Next, we present another example which is the strongly NP-hard problem of minimizing the total weighted completion time with release date constraints.
Example 3 (Minimizing the total weighted completion time with release date constraints, ).
Each job has a weight , a processing time , and a release date . This problem aims at finding the feasible permutation, namely where each job starts after its release date, for which the total weighted completion time is minimal. Let and . For a given , we consider the problem of Equation (5) as follows:
where is the makespan, and
where is the completion time of job . Problem satisfies the two Composed DPAS recurrences (Comp-DPAS) and (Comp-D-DPAS). The initialization of the recurrences is, for , and ,
We synthesize in Table 3 the worst-case time complexities achieved by Q-DDPAS on the examples of scheduling problems satisfying the Composed DPAS recurrences. We compare them with the best-known classical complexities for exact algorithms. The latter comes from the algorithm of Inclusion-Exclusion designed by Ploton and T’kindt, (2022), which provides a generic method to solve such problems. We observe that Q-DDPAS improves the exponential part of the complexity, at a cost of a higher degree for the pseudo-polynomial factor.
Problem | Q-DDPAS for Composed DPAS | Best classical algorithm |
---|---|---|
(Ploton and T’kindt, , 2022) | ||
(Ploton and T’kindt, , 2022) |
5 Decision-based DPAS
We saw in the previous section that the recurrence to solve can be applied to a minimization problem, possibly involving an auxiliary problem. Sometimes, the recurrence does not apply directly to a minimization problem but to a decision problem. This is the case of the 3-machine flowshop problem. In this section, we adapt the hybrid algorithm Q-DDPAS to solve this problem. Notice that it easily generalizes to the -flowshop problem, for .
5.1 3-machine flowshop and dynamic programming
We consider the permutation flowshop problem on 3 machines for jobs with minimizing the makespan as the objective function. This strongly NP-hard problem is often referred to as in the literature, as mentioned by Shang et al., (2018). Each job consists of 3 operations for , each operation being processed on the -th machine. We note the processing time of operation . Each machine performs at most one operation at a time. For each job , operations must be processed in the specific order , , : the first operation gets processed on the first machine, then the second operation gets processed on second machine (as soon as the first operation is finished and the second machine is available), and eventually the third operation gets processed on the third machine (as soon as the second operation is finished and the third machine is available). Thus, only the processing order of the jobs has to be decided, implying that a solution is entirely described by the permutation of jobs on the first machine. Thus, the problem can be formulated as
(8) |
where is the maximum completion time, namely the completion time of the last job processed on the last machine (third machine). Because the two techniques presented so far do not apply to (8), we present an alternative approach involving the decision counterpart of the above optimization problem.
We introduce below a decision problem for deriving the recurrences. For that, we define the bounded set
Definition 5.1 (Decision problem).
For , and , we define the decision problem on a sub-instance associated with jobs in as the following question: “Does there exist a permutation such that, for , and , where , respectively , denotes the time at which the first operation begins, respectively the last operation ends, on the -th machine.
In other words, problem asks whether or not there exists a feasible permutation with jobs in such that it holds between the two temporal fronts and . Notice that it is not necessary to impose any beginning and ending time for the first machine (). Indeed, the problem is time-invariant, thus we can always consider that the scheduling problem starts at time 0, and that the total completion time on the first machine is known and equal to the sum of processing times of the scheduled jobs. Notice that the number of parameters is four for the 3-machine flowshop, but generalizes to parameters for the -machine flowshop.
With these notations, can be cast as follows:
(9) |
The decision problem satisfies both recurrences (Dec-DPAS) and (Dec-D-DPAS) below.
Property 5.2 (Decision DPAS).
For all of even cardinality, and ,
(Dec-DPAS) |
where means that the -th coordinate of is between the -th coordinates of and , and where operation , for a vector and a constant , subtracts to each coordinate of .
This latter recurrence enables to be solved by a classical dynamic programming algorithm.
Lemma 5.3.
(Dec-DPAS) solves in .
Proof.
First, we can show that, for a given , (Dec-DPAS) solves in . This is essentially the same lines of the proof as in Lemma 2.2. Second, to solve , we make a dichotomic search over to find the minimum such that is True according to Equation (9). Thus, (Dec-DPAS) is called times. Because is a pseudo-polynomial term of the instance, the total complexity is ∎
Property 5.4 (Decision Dichotomic DPAS).
For all of even cardinality, and ,
(Dec-D-DPAS) |
Lemma 5.5.
(Dec-D-DPAS) solves in .
Proof.
Once again, we observe that recurrence (Dec-DPAS) outperforms recurrence (Dec-D-DPAS) to solve by classical dynamic programming our problem . In the next subsection, we describe how we adapt Q-DDPAS to take advantage of those two recurrences to solve the 3-machine flowshop problem.
5.2 Hybrid algorithm for Decision-based DPAS
We call Q-Dec-DDPAS the adapted decision version of Q-DDPAS. The main difference is that instead of searching for a minimum value in a set in recurrence (Add-D-DPAS) or (Comp-D-DPAS), we search for a True value in a set in recurrence (Dec-D-DPAS). Thus, it essentially amounts to replacing Quantum Minimum Finding with the algorithm of Boyer et al., (1998) specified below, which extends Grover Search (Grover, , 1996).
Definition 5.6 (Grover Search Extension (Boyer et al., , 1998)).
Let be a function. Grover Search Extension computes with high probability the logical OR of all the values and the corresponding antecedent(s) such that . The complexity of Grover Search Extension is , where is the complexity of computing a value of .
Notice that we cannot use Grover Search because we do not know the number of such that . The generalization of Boyer et al., (1998) enables us to deal with an unknown number of solutions while keeping the same complexity of Grover Search. Moreover, if there are solutions, the complexity is but, having no bounds on whenever we call Grover Search Extension, we omit it in the complexity.
Lemma 5.7.
Let . The bounded-error algorithm Q-Dec-DDPAS (Algorithm 4) solves in .
The proof is essentially the same as for Theorem 2.8, detailed in Supplementary Materials. All the details of correctness and low-level implementation are given in our companion paper (Grange et al., , 2024).
Theorem 5.8.
The bounded-error Algorithm 5 solves the 3-machine flowshop in with high probability.
Once again, as mentioned in Observation 2.9, the complexity can be reduced thanks to a slight modification on the Q-Dec-DDPAS that constitutes the subroutine, thus leading to the following observation.
Observation 5.9.
A slight modification of Algorithm 5 reduces the complexity of solving the 3-machine flowshop in with high probability.
This new method improves the best-known classical algorithm that is in or in if there exists a constant such that , for all , presented by Shang et al., (2018) and Ploton and T’kindt, (2023). Hybrid quantum-classical bounded-error Algorithm 5 reduces the exponential part of the time complexity at the cost of a pseudo-polynomial factor. For most cases, this factor is negligible because the numerical values of 3-machine flowshop instances are small compared to the exponential part value. However, we present in the next subsection a way to dispose of this factor with an approximation scheme.
It is worth noting that the previous algorithm easily generalizes to the -machine flowshop problem. Indeed, the only difference is the description of the temporal front that necessitates parameters.
Observation 5.10.
The bounded-error Algorithm 5 generalizes to solve the -machine flowshop in with high probability.
Notice that Ploton and T’kindt, (2023) present a classical resolution for the -machine flowshop by Inclusion-Exclusion in .
5.3 Approximation scheme for the 3-machine flowshop
We present an approximation scheme for the 3-machine flowshop problem that trades the pseudo-polynomial factor in the complexity of Q-Dec-DDPAS and the optimality of the algorithm for a polynomial factor in and an approximation factor of . In other words, we provide Algorithm 6 that finds a solution in time for which the makespan is not greater than (1+) times the optimal makespan. The latter point denotes that this is an -approximation scheme. Our algorithm belongs to the class of moderate exponential-time approximation algorithms. Notice that the 3-machine flowshop problem does not admit an FPTAS (fully polynomial-time approximation scheme) because it is strongly NP-hard, meaning that no -approximation algorithm exists to solve the 3-machine flowshop in time unless P = NP (Vazirani, , 2001). In comparison, Hall, (1998) provides for the -machine flowshop problem an FPT-AS (fixed-parameter tractable approximation scheme), namely an -approximation algorithm that runs in time for a fixed parameter of the instance and a computable function. Hall, (1998) choose to be the number of machines of the flowshop, leading to an FPT-AS that runs in time . In our case, we consider the case .
Lemma 5.11.
Let be an optimal solution of the 3-machine flowshop problem, for the processing times . Let be the output of Algorithm 6. We have
Next, we introduce two observations necessary to prove Lemma 5.11. The proofs are omitted because of their simplicity.
Observation 5.12.
Let be a permutation and let be . We note the makespan of of the 3-machine flowshop for processing times . We note the makespan of of the 3-machine flowshop for processing times such that for all . Then, Notice that for , we have even if the critical path in may differ to obtain and .
Observation 5.13.
Let be a permutation and let such that . We note the makespan of of the 3-machine flowshop for processing times . We note the makespan of of the 3-machine flowshop for processing times such that for all . Then, Notice that for , we still have even if the critical path in may differ to obtain and .
Proof of Lemma 5.11.
Let be . The new processing times considered imply that . We note the makespan of the new problem, i.e. the 3-machine flowshop problem with processing times .
On the one hand, we have , for all . Thus, according to Observations 5.12 and 5.13 considering the optimal permutation , namely, because ,
(10) |
On the other hand, we have . Thus, according to Observation 5.12 considering the output permutation of Algorithm 6, namely, because ,
(11) | ||||
(12) | ||||
(13) |
where (11) comes from the fact that is the optimal solution for makespan , (12) results from Equation (10), and (13) is true because the makespan is always larger than . ∎
Theorem 5.14.
Algorithm 6 is an approximation scheme for the 3-machine flowshop problem and outputs a solution whose makespan it at most times the optimal value in time
6 Conclusion
In this work, we propose generalized dynamic programming recurrences for NP-hard scheduling problems to solve a broad class of such problems with our hybrid algorithm Q-DDPAS which is an adapted version of the quantum-classical algorithm of Ambainis et al., (2019). Q-DDPAS provides a quantum speed-up to their exact resolution. Specifically, our hybrid algorithm reduces the best-known classical time complexity, often equal to for single-machine problems and for the 3-machine flowshop, to , sometimes at the cost of an additional pseudo-polynomial factor as summarized in Table 1. Future work will be dedicated to widening the range of problems for which we can achieve a quantum speed-up. This will necessitate finding NP-hard problems for which the description of a solution is a permutation, and that satisfy a dynamic programming property admitting a dichotomic version, relying either on an optimization or a decision problem. A first lead is to consider the -machine jobshop problem. Indeed, a promising description of a solution of this problem is the Bierwith vector (Bierwirth, , 1995), a vector encoding a solution as a permutation with repetition of size , where is the number of jobs.
Acknowledgements.
This work has been partially financed by the ANRT through the PhD number 2021/0281 with CIFRE funds.
References
- Ambainis et al., (2019) Ambainis, A., Balodis, K., Iraids, J., Kokainis, M., Prūsis, K., and Vihrovs, J. (2019). Quantum speedups for exponential-time dynamic programming algorithms. In Proceedings of the Thirtieth Annual ACM-SIAM Symposium on Discrete Algorithms, pages 1783–1793. SIAM.
- Bernstein and Vazirani, (1993) Bernstein, E. and Vazirani, U. (1993). Quantum complexity theory. In Proceedings of the twenty-fifth annual ACM symposium on Theory of computing, pages 11–20.
- Bierwirth, (1995) Bierwirth, C. (1995). A generalized permutation approach to job shop scheduling with genetic algorithms. Operations-Research-Spektrum, 17(2):87–92.
- Boyer et al., (1998) Boyer, M., Brassard, G., Høyer, P., and Tapp, A. (1998). Tight bounds on quantum searching. Fortschritte der Physik: Progress of Physics, 46(4-5):493–505.
- Cerezo et al., (2021) Cerezo, M., Arrasmith, A., Babbush, R., Benjamin, S. C., Endo, S., Fujii, K., McClean, J. R., Mitarai, K., Yuan, X., Cincio, L., et al. (2021). Variational quantum algorithms. Nature Reviews Physics, 3(9):625–644.
- Cygan et al., (2014) Cygan, M., Pilipczuk, M., Pilipczuk, M., and Wojtaszczyk, J. O. (2014). Scheduling partially ordered jobs faster than . Algorithmica, 68:692–714.
- Dürr and Høyer, (1996) Dürr, C. and Høyer, P. (1996). A quantum algorithm for finding the minimum. arXiv preprint quant-ph/9607014.
- Farhi et al., (2014) Farhi, E., Goldstone, J., and Gutmann, S. (2014). A quantum approximate optimization algorithm. arXiv preprint arXiv:1411.4028.
- Giovannetti et al., (2008) Giovannetti, V., Lloyd, S., and Maccone, L. (2008). Quantum random access memory. Physical review letters, 100(16):160501.
- Graham et al., (1979) Graham, R. L., Lawler, E. L., Lenstra, J. K., and Kan, A. R. (1979). Optimization and approximation in deterministic sequencing and scheduling: a survey. In Annals of discrete mathematics, volume 5, pages 287–326. Elsevier.
- (11) Grange, C., Bourreau, E., Poss, M., and t’Kindt, V. (2023a). Quantum speed-ups for single-machine scheduling problems. In Proceedings of the Companion Conference on Genetic and Evolutionary Computation, pages 2224–2231.
- (12) Grange, C., Poss, M., and Bourreau, E. (2023b). An introduction to variational quantum algorithms for combinatorial optimization problems. 4OR, pages 1–41.
- Grange et al., (2024) Grange, C., Poss, M., Bourreau, E., t’Kindt, V., and Ploton, O. (2024). Companion Paper: Moderate Exponential-time Quantum Dynamic Programming Across the Subsets for Scheduling Problems. HAL preprint, https://hal.science/hal-04296238.
- Grover, (1996) Grover, L. K. (1996). A fast quantum mechanical algorithm for database search. In Proceedings of the twenty-eighth annual ACM symposium on Theory of computing, pages 212–219.
- Hall, (1998) Hall, L. A. (1998). Approximability of flow shop scheduling. Mathematical Programming, 82(1-2):175–190.
- Held and Karp, (1970) Held, M. and Karp, R. M. (1970). The traveling-salesman problem and minimum spanning trees. Operations Research, 18(6):1138–1162.
- Kurowski et al., (2023) Kurowski, K., Pecyna, T., Slysz, M., Rozycki, R., Waligora, G., and Weglarz, J. (2023). Application of quantum approximate optimization algorithm to job shop scheduling problem. European Journal of Operational Research, 310(2):518–528.
- Lawler, (1990) Lawler, E. L. (1990). A dynamic programming algorithm for preemptive scheduling of a single machine to minimize the number of late jobs. Annals of Operations Research, 26:125–133.
- Miyamoto et al., (2020) Miyamoto, M., Iwamura, M., Kise, K., and Gall, F. L. (2020). Quantum speedup for the minimum steiner tree problem. In COCOON 2020, Atlanta, GA, USA, August 29–31, 2020, Proceedings, pages 234–245. Springer.
- Nannicini, (2019) Nannicini, G. (2019). Performance of hybrid quantum-classical variational heuristics for combinatorial optimization. Physical Review E, 99(1):013304.
- Nannicini, (2022) Nannicini, G. (2022). Fast quantum subroutines for the simplex method. Operations Research.
- Pinedo, (2012) Pinedo, M. L. (2012). Scheduling, volume 29. Springer.
- Ploton and T’kindt, (2022) Ploton, O. and T’kindt, V. (2022). Exponential-time algorithms for parallel machine scheduling problems. Journal of Combinatorial Optimization, 44(5):3405–3418.
- Ploton and T’kindt, (2023) Ploton, O. and T’kindt, V. (2023). Moderate worst-case complexity bounds for the permutation flowshop scheduling problem using inclusion–exclusion. Journal of Scheduling, 26(2):137–145.
- Ruan et al., (2020) Ruan, Y., Marsh, S., Xue, X., Liu, Z., Wang, J., et al. (2020). The quantum approximate algorithm for solving traveling salesman problem. CMC, 63(3):1237–1247.
- Shang et al., (2018) Shang, L., Lenté, C., Liedloff, M., and T’Kindt, V. (2018). Exact exponential algorithms for 3-machine flowshop scheduling problems. Journal of Scheduling, 21:227–233.
- Shimizu and Mori, (2022) Shimizu, K. and Mori, R. (2022). Exponential-time quantum algorithms for graph coloring problems. Algorithmica, pages 1–19.
- Sutter et al., (2020) Sutter, D., Nannicini, G., Sutter, T., and Woerner, S. (2020). Quantum speedups for convex dynamic programming. arXiv preprint arXiv:2011.11654.
- Tabi et al., (2020) Tabi, Z., El-Safty, K. H., Kallus, Z., Hága, P., Kozsik, T., Glos, A., and Zimborás, Z. (2020). Quantum optimization for the graph coloring problem with space-efficient embedding. In 2020 IEEE (QCE), pages 56–62. IEEE.
- T’kindt et al., (2022) T’kindt, V., Della Croce, F., and Liedloff, M. (2022). Moderate exponential-time algorithms for scheduling problems. 4OR, pages 1–34.
- Vazirani, (2001) Vazirani, V. V. (2001). Approximation algorithms, volume 1. Springer.
- Woeginger, (2003) Woeginger, G. J. (2003). Exact algorithms for np-hard problems: A survey. In Combinatorial Optimization—Eureka, You Shrink! Papers, pages 185–207. Springer.
Appendix A Useful upper bounds
We define the binary entropy of by We remind some useful upper bounds of binomial coefficients Ambainis et al., (2019):
Thus, it leads to the following upper bounds to compute the complexities of interest: