1 Introduction

Scheduling problems are in the mainstream of operations research, industrial engineering, manufacturing systems and computer science. More particularly, scheduling theory deals with executing a set of constrained tasks on a set of machines/processors. Here we focus on a single machine scheduling problem. Scheduling problems on a single machine are central in scheduling theory. This is due to their historical nature, because they employ the simplest type of scheduling models and are a special case of many other, more complex, environments. Various examples of scheduling questions lead to \(\mathsf {NP}\)-complete problems on which classical algorithmic tools have been used to find acceptable solutions: approximation algorithms, randomized algorithms, exact algorithms with exponential time, etc (see the following references for a general presentation of scheduling models: Blazewicz et al. 2007; Chen et al. 1998; Graham et al. 1979). In this paper, we present parameterized algorithms for a specific scheduling problem, the coupled-task scheduling problem.

A problem parameterized by a parameter k is said to be fixed-parameter tractable (\(\mathsf {FPT}\)) if there exists a constant c such that the problem can be solved in time \(f(k) \cdot n^{O(1)}\), where f is a function of k and n is the size of the instance. An algorithm to solve the problem with such a running time is called an \(\mathsf {FPT}\) algorithm. Intractability of parameterized problems is determined via hardness for classes in the \({\mathsf {W}}\)-hierarchy, \({\mathsf {W}}[1]\) being the parameterized class corresponding, in a sense, to the classical class \(\mathsf {NP}\). Some problems, like  \({\mathsf {W}}[1]\)-hard problems, do not admit \(\mathsf {FPT}\) algorithms under standard assumptions in complexity theory. We refer to classical textbooks (Downey and Fellows 2013; Flum and Grohe 2006; Niedermeier 2006) for parameterized algorithms theory. In this paper, we provide \(\mathsf {FPT}\) algorithms for the coupled-task scheduling problem. Very recently, some attention has been paid to \(\mathsf {FPT}\) algorithms for scheduling problems (Hermelin et al. 2017c; Knop and Koutecký 2016; Knop et al. 2017; Mnich and van Bevern 2017). However, few problems consider the number of tasks on time as parameter. The originality of our work is to take this natural parameter to design  \(\mathsf {FPT}\) algorithms.

1.1 The coupled-task scheduling problem

The coupled-task scheduling problem consists in executing n tasks \({\mathcal {A}}=\{A_1,\ldots ,A_n\}\) on a single machine. Each task \(A_i\) possesses two sub-tasks: \(a_i\) and \(b_i\), separated by an fixed idle time \(l_i\). The second sub-task \(b_i\) must be executed exactly after the completion time of the first sub-task \(a_i\) plus the duration of \(l_i\). This model of scheduling was first introduced by Shapiro (1980), motivated by an application to production scheduling, transportation, and radar operations (the first task models information sending, the idle time is the delay to receive an answer and the second task is the answer treatment). In the paper, we will abusively denote also by \(a_i\) (resp. \(b_i\), resp. \(l_i\)) the duration of the sub-task \(a_i\) (resp. \(b_i\), resp. the idle time \(l_i\)), and we assume that \(a_i>0\)\(b_i>0\) and \(l_i\ge 0\) for all \(i=1,\ldots ,n\).

Concerning the task-allocation on a single machine, it is possible to interleave some of them. A task \(A_i\) interleaves with a task \(A_j\) if one of the sub-tasks \(a_j\) or \(b_j\) is processed during the idle time \(l_i\) of the task \(A_i\). Moreover, we consider here two types of constraints on the tasks. The first one is dedicated to the processing times of the sub-tasks \(\{a_1,b_1,\ldots ,a_n,b_n\}\) and idle times \(\{l_1,\ldots ,l_n\}\). The second one comes from their possible heterogeneity. Indeed, it is possible that some tasks could not interleave with some other tasks. It occurs when several tasks need to use a resource, different from the processor that is available sequentially.

These later constraints were first motivated by data acquisition and processing in a single processor torpedo used for underwater exploration (Simonin et al. 2013). In such context, the torpedo executes several submarine topographic surveys (e.g., topological, temperature measurements). Its aim is to collect data and to process them on a single processor within a minimum time. A set of sensors acquires data for the torpedo, and each datum is divided into two sub-tasks: a sensor first emits a wave which propagates in the water; then, it gets a corresponding echo. Clearly, sensors using different frequencies can emit in parallel, whereas, in order to avoid interference, data with the same frequencies have to be delayed.

Therefore, scheduling a sub-task during the idle time of another task requires that both tasks are compatible. Two tasks \(A_i\) and \(A_j\) are described as compatible if they use different wave frequencies; any sub-task of \(A_i\) may be processed during the idle time of \(A_j\) or reciprocally. A feasible schedule implies that, for all tasks \(A_i\) and \(A_j\), if a sub-task of \(A_i\) is scheduled during the idle time of \(A_j\), then \(A_i\) and \(A_j\) must be compatible. In order to represent these constraints, a compatibility graph \(G_c=({\mathcal {A}},E_c)\) is introduced, where the set of vertices of \(G_c\) is the set \({\mathcal {A}}\) of coupled-tasks and \([A_i,A_j] \in E_c\) if, and only if, the two coupled-tasks \(A_i\) and \(A_j\) can be interleaved. When \(G_c\) is a complete graph, then we obtain the classical coupled-tasks scheduling problem.

An example of a coupled-task schedule is depicted in Fig. 1.Footnote 1

Fig. 1
figure 1

A coupled-task schedule consistent with a compatibility graph such that \(A_1=(1,4,2), A_2=(2,3,1)\) and \(A_3=(3,5,1)\)

As all processing times are integers, we use a discrete time for the starting time of each task. Thus, in Fig. 1, the schedule starts at time 0 and ends at time 16. Let us notice that this schedule is optimal, as it is not possible to interleave task \(A_2\) and task \(A_3\) because the corresponding vertices in \(G_c\) are not adjacent.

Given a schedule of the tasks, the makespan, denoted by \(C_{\max }\) is the completion time of the last task of the schedule. The aim of the problem is to produce a shortest schedule (i.e., to minimize the makespan) according to compatibility constraints. In scheduling theory, a problem is categorized by its machine environment, job characteristics and objective function. Using the classical notation schemeFootnote 2 \(\alpha \vert \beta \vert \gamma \), our problem is defined as \(1\vert (a_i,l_i,b_i),G_c \vert C_{\max }\). The decision version we are interested in is more precisely defined below.

Coupled-Tasks Scheduling (CTS):

  • Instance: A set \({\mathcal {A}}=\{A_1,\ldots ,A_n\}\) of n coupled-tasks with associated processing and idle times \((a_i,l_i,b_i)_{1\le i\le n}\), a compatibility graph \(G_c\) and an integer \(C_{\max }\).

  • Question: Is there a task schedule that obeys the compatibility constraints given by \(G_c\) with a makespan at most \(C_{\max }\)?

We also pay attention to some restrictive versions of CTS. If every involved sub-task is one unit of time long and every idle time has same duration (i.e., \(a_i=b_i=1\) and \(l_i=l_j\) for every \(i,j\in \{1,\ldots ,n\}\)), we will refer to the problem as unit CTS. Moreover, let \(L\ge 2\) be an integer. If every task of the instance has total duration bounded by L (i.e., we have \(a_i+l_i+b_i\le L\) for every \(i=1,\ldots ,n\)), we say that the problem is  L-bounded and will denote it as L-bounded CTS. Finally combining both previous notions, if every involved sub-task is one unit of time long and every idle time has duration \(L-2\) exactly (i.e., \(a_i=b_i=1\) and \(l_i=L-2\) for every \(i=1,\ldots ,n\)), we will refer to the problem as L-unit CTS. In this paper, we study variants of the general CTS problem from the parameterized complexity point of view. We will precisely define the different parameters employed in each section of the paper.

1.2 Related works

The coupled-task problem without compatibility constraints was first investigated from an algorithmic point of view by Orman and Potts (1997). Since this pioneering article numerous works have been done on this problem [see Blazewicz et al. (2012) for a survey on this problem or Ageev and Ivanov (2016) and Lehoux-Lebacque et al. (2015) for the latest developments]. The absence of compatibility constraints corresponds to the case of a complete compatibility graph \(G_c\). The more general model in which the complete compatibility graph is relaxed has been studied in the framework of classic complexity and approximation (Simonin et al. 2013, 2012). Notice that for \(L=2\), L-unit CTS is trivial, as there are no idle times and any permutation of the tasks is an optimal scheduling. For \(L=3\), roughly speaking, any schedule can be associated with a matching on \(G_c\) (at most one coupled-task \(A_i\) may be executed in the idle time of the coupled-task \(A_j\) with \([A_i,A_j] \in E_c\)), and the length of the schedule will therefore depend on the size of the matching. Thus, a maximum matching in the compatibility graph leads to an optimal solution for 3-unit CTS (Simonin et al. 2012). In the same paper, the authors prove that for \(L\ge 5\), L-unit CTS is \(\mathsf {NP}\)-complete [the hardness for \(L=4\) is proposed in another article (Simonin et al. 2013)]. Thus, we assume that \(L\ge 4\) for the rest of the paper. Concerning approximation algorithms, it is known that 4-unit CTS admits a polynomial \(\frac{13}{12}\)-approximation algorithm (Simonin et al. 2013), whereas there exists a \(\frac{4+L}{4}\)-approximation algorithm for the general L-unit CTS problem (Simonin et al. 2012). In the case where the graph \(G_c\) is a bipartite graph, more precise results on complexity/approximation are known (Darties et al. 2014). Nevertheless, the status of CTS with \(G_c\) being a tree remains unknown.

Until recently, there were few results about parameterized complexity approach for scheduling theory. On the negative side, Bodlaender and Fellows (1995) proved the \({\mathsf {W}}[2]\)-hardness for the precedence constrained k-processors scheduling. (The parameter is the number of processors.) On the positive side, Fellows and McCartin (2003) gave a positive answer to the question ‘Is there a one-processor schedule for a set of unit-tasks in the presence of precedence constraints admitting an individual deadline, and containing no more than k late tasks (resp. on time)?’. These problems are both proven \({\mathsf {W}}[1]\)-hard when parameterized by k, the number of late (resp. on time) tasks. However, if the set of precedence constraints can be modeled as a partial order of bounded width m, then both problems are \(\mathsf {FPT}\) with respect to the combined parameter (km). Bevern et al. (2015) proposed some \(\mathsf {FPT}\) algorithms for interval scheduling based on an Independent Set formulation. Recently, Mnich and Wiese (2015) initiated a systematic study concerning \(\mathsf {FPT}\) algorithms and \({\mathsf {W}}[1]\)-hardness for some classical scheduling problems like makespan minimization, scheduling with job-dependent cost functions and scheduling with rejection. This led to a growing interest in designing \(\mathsf {FPT}\) algorithms for scheduling problems according to various parameters (van Bevern et al. 2016; Bevern et al. 2017; Hermelin et al. 2017a, b, c; Knop and Koutecký 2016; Knop et al. 2017). And even more recently, Mnich and van Bevern a survey of recent progress and open problems in this field (Mnich and van Bevern 2017). Marx (2011, pp. 86) mentioned an interesting parameterization for a polynomial scheduling problem, consisting to ask whether an instance of the problem admits a schedule with at most k late tasks. The challenging question here is to obtain an \(\mathsf {FPT}\) algorithm for this parameterized version, avoiding then all the \(O(n^k)\) possible choices for the late tasks. However, this choice of parameter does not suit for our problem, as for \(L\ge 4\) the L-unit CTS problem is \(\mathsf {NP}\)-complete (i.e., there is no polynomial algorithm even for \(k=0\)). As mentioned before, another natural way to parameterize a scheduling problem was used by Fellows and McCartin (2003). They studied a scheduling problem dealing with simple tasks having a due date and a set of precedence constraints. The corresponding optimization problem being \(\mathsf {NP}\)-complete they were interested in its “k tasks on time” version. More precisely, they looked for a set of k tasks that could be scheduled according to precedence constraints and such that each task ends before its due date. They obtained a \({\mathsf {W}}[1]\)-hardness result for this parameterized problem.

1.3 Our contribution

To turn CTS into a parameterized problem, we were inspired by the “k tasks on time” version used by Fellows and McCartin (2003). Indeed, we fix a due date \(d\in \mathrm I\!N\) and try to find a schedule with a maximum number of coupled-tasks executed before d. The parameter is then the number of tasks admitting a completion time before d. Namely, we consider the following problem.

Coupled-Tasks Scheduling Tardy (CTST):

  • Instance: A set \({\mathcal {A}}=\{A_1,\ldots ,A_n\}\) of n coupled-tasks with associated processed and idle times \((a_i,l_i,b_i)_{1\le i\le n}\), a compatibility graph \(G_c\) and a deadline \(d \in \mathrm I\!N\).

  • Parameter: An integer k.

  • Question: Is there a schedule for the tasks that obeys the compatibilities given by \(G_c\) and contains at least k tasks that are completed before the deadline d?

In addition to CTS, we also pay attention to the unit, L-bounded and L-unit versions of CTST.

Section 2 is devoted to parameterized complexity results for CTST. Using a parameterized reduction from k-clique, we show that CTST is \({\mathsf {W}}[1]\)-hard. However, if L is fixed,  L-bounded CTST is \(\mathsf {FPT}\). We obtain the latter result using the color-coding technique (Alon et al. 1995) and dynamic programming.

One of the standard methods to design fixed-parameter tractable algorithms is to exhibit a kernelization algorithm (or kernel) for the studied problem. A kernelization algorithm is a polynomial time algorithm that, given an instance I with parameter k of a parameterized problem, computes an instance \(I'\) with parameter \(k'\) such that (Ik) is a positive instance if and only if \((I',k')\) is a positive instance of the problem, \(|I'| \leqslant h(k)\) for some computable function h(k) depending only on k and \(k' \leqslant k\). We say that the kernel is a polynomial kernel if the function h(k) is a polynomial in k. It is well known that a decidable parameterized problem is \(\mathsf {FPT}\) if and only if it has a kernelization algorithm (Niedermeier 2006).

To design efficient \(\mathsf {FPT}\) algorithms, a kernel of small size—polynomial (or even linear) in k—is highly desirable. Using the cross-composition technique developed by Bodlaender et al. (2011), we prove that there is no hope to find a polynomial kernel for L-unit CTST unless \(\mathsf {coNP} \subseteq \mathsf {NP}/\mathsf {poly}\). In Sect. 3, we obtain an \(\mathsf {FPT}\) algorithm for L-bounded CTST parameterized by a structural invariant of the compatibility graph \(G_c\). A vertex cover of a graph G is a subset X of the vertices of G such that for all edges [uv] of G we have \(u\in X\) or \(v\in X\). We prove that there exists an \(\mathsf {FPT}\) algorithm for  L-unit CTST when parameterized by the size of a vertex cover of \(G_c\). More precisely, we obtain a (non-polynomial) kernel for this problem. We also argue that such an \(\mathsf {FPT}\) algorithm does not exist for unit CTST. Finally, we conclude the paper by some remarks and open questions.

2 Parameterized complexity results for CTST

In this section, we show that the status in term of parameterized complexity of CTST changes depending on whether the problem is L-bounded or not. First, when it is not the case we obtain the following negative result for CTST.

Theorem 1

Unit CTST (and so CTST) is \({\mathsf {W}}[1]\)-hard with respect to the parameter k, i.e., it has no \(f(k)n^{O(1)}\) time algorithm for any computable function f (unless \(\mathsf {FPT} = {\mathsf {W}}[1]\)).

Fig. 2
figure 2

Description of the beginning of the schedule

Proof

We propose a parameterized reduction from k-clique which is known to be \({\mathsf {W}}[1]\)-hard (Cai et al. 1997).

Clique:

  • Instance: A graph \(G=(V,E)\)

  • Parameter: A positive integer k.

  • Question: Is there a set of k vertices \(V' \subset V\) that forms a complete subgraph of G (that is, a clique of size k)?

Given an instance \((G=(V,E),k)\) of this problem, we provide an instance \(({{\mathcal {A}}}=\{A_1,\ldots , A_n\},G_c,d)\) with parameter \(k'\) of unit CTST with \(k'=k\). We consider one coupled-task \(A_v\) for each vertex v of G and choose \(G_c=G\). Then, we set \(a_v=b_v=1\) and \(l_v=k-1\) for every vertex v of G and \(d=2k\). This transformation can be clearly computed in polynomial time on n. We claim that G has a clique of size k if, and only if, \((\{A_1,\ldots , A_n\},G_c,d)\) admits a schedule in which at least k coupled-tasks end before d. Indeed, assume that G contains a clique \(C=\{v_1,\ldots ,v_k\}\) of size k. The coupled-tasks \(\{A_{v_1},\ldots ,A_{v_k}\}\) are processed during [0, 2k] without idle time: for \(1\le i\le k\), the starting time of the sub-task \(a_{v_i}\) is \((i-1)\) and for the sub-task \(b_{v_i}\) it is \((k+i-1)\) (see Fig. 2). All \(A_{v_i}\)-tasks interleave into each other. These allocations respect the constraints since C is a clique, and all coupled-tasks are completed at time 2k. Conversely, assume that \((\{A_1,\ldots , A_n\},G_c,d)\) admits a schedule such that the completion time of k coupled-tasks is at most 2k. Since each coupled-task contains two sub-tasks with processing time equal to one, it is clear that there is no idle time before the deadline. Hence, the only possibility to schedule the k first coupled-tasks in this way that is described before. As all these tasks must interleave, G has a clique of size k. \(\square \)

Now we fix an integer \(L\ge 4\) and we prove that L-bounded CTST admits an \(\mathsf {FPT}\) algorithm. For this, we use the color-coding technique developed by Alon et al. (1995).

Theorem 2

For every fixed \(L\ge 4\), there exists an \(\mathsf {FPT}\) algorithm for  L-bounded CTST with running time \(2^{O(k)}n^{2L}\log ^2n\).

Proof

Consider an instance

$$\begin{aligned} ({{\mathcal {A}}}=\{A_1,\ldots , A_n\},(a_i,l_i,b_i)_{1\le i\le n},G_c,d) \end{aligned}$$

with parameter k of  L-bounded CTST. We can presume that \(d<Lk\), otherwise we schedule the tasks sequentially with no interleaving and answer that \({\mathcal {A}}\) is a positive instance of the problem. Following the standard use of the color-coding technique, we define a colored version of the problem. Assume that the coupled-tasks are colored with colors \(\{1,\ldots ,k\}\), we look for a feasible schedule of k coupled-tasks that are on time which involves coupled-tasks of all different colors. We will argue later that if a schedule forms a positive answer for our initial problem, then it is possible to “quickly” find a coloring for which this schedule will be a positive answer for the associated colored version.

To solve the colored version, we use dynamic programming in order to extend the partial schedules of colored tasks. Indeed, for this we only need information on the last \(L-1\) time slots of the partial schedule under construction. Then, we can decide how to add a new task in this schedule. More precisely, let \({\mathcal {S}}\) be a partial schedule of \(\{A_1,\ldots , A_n\}\) respecting the compatibility constraints given by \(G_c\). We focus on the set \({\mathcal {T}}\) of tasks of \({\mathcal {S}}\) occupying one of the \(L-1\) last unit time slots of \({\mathcal {S}}\). For each of these time slots, we record the task of \({{\mathcal {T}}}\cup \{\emptyset \}\) occupying it (\(\emptyset \) meaning that there is no task processed during this time slot). These recordings form the behavior of the tasks of \({\mathcal {T}}\). There are at most \(|{{\mathcal {T}}}\cup \{\emptyset \}|^{L-1}\le L^{L}\) possible behaviors for the tasks of \({\mathcal {T}}\). Notice that some of the configurations possibly do not occur, because of the shape of the tasks and of the constraints on the tasks given by \(G_c\). An illustrative case with \(L=4\) is depicted in Fig. 3. For instance if \(t_1\) and \(t_2\), respectively, denote the gray task and the black task, in configuration 2 the behavior on the last three time slots is \((t_1,t_2,t_2)\); in configuration 3 we obtain \((t_1,\emptyset ,t_2)\).

Fig. 3
figure 3

Examples of possible configurations with \(L=4\). The last task is represented by a black pattern

We encode the behaviors of the tasks of \({\mathcal {T}}\) by a \((L-1)\)-uple of \(({{\mathcal {T}}}\cup \{\emptyset \})^{L-1}\). We say that a schedule \({\mathcal {S}}\)has end \(({{\mathcal {T}}},B,s)\) if the makespan of \({\mathcal {S}}\) is s and if the set of tasks of \({{\mathcal {S}}}\) using one of the L last time slots of \({\mathcal {S}}\) is exactly \({\mathcal {T}}\) and have behavior B. Finally, we say that a triple \(({{\mathcal {T}}}',B',s')\)fits with \(({{\mathcal {T}}},B,s)\) if there exists a schedule \({\mathcal {S}}\) ending with \(({{\mathcal {T}}},B,s)\) and such that \({\mathcal {S}}'= {\mathcal {S}} \setminus \) \(A_i\) ends with \(({{\mathcal {T}}}',B',s')\), where \(A_i\) is the last task of \({\mathcal {S}}\) and \({\mathcal {S}} \setminus A_i\) is the schedule obtained from \({\mathcal {S}}\) by removing the task \(A_i\). Notice that in the case \({{\mathcal {T}}}\ne \{A_i\}\) the penultimate task of \({\mathcal {S}}\) is the last task of \({\mathcal {S}}'\) and that \({\mathcal {S}}\) and B constrain \(\mathcal S'\) and \(B'\). We remark also that \(s'\) takes value in \(\{s-L,\ldots , s-1\}\). For instance, we have \(s'=s-1\) if the sub-task \(b_{i}\) of \(A_i\) has duration one and just follows the last sub-task of the last task of \({\mathcal {S}}'\) like in configurations 4 and 5 of Fig. 3. Also, we have \(s'=s-L\) if \(A_i\) has total duration L and \({{\mathcal {T}}}=\{A_i\}\) as in configuration 1 of Fig. 3.

Now, given X a set of colors (i.e., a subset of \(\{1,\ldots \)\( ,k\}\)), a set \({\mathcal {T}}\) of at most L tasks, a behavior B for these tasks and a time \(s\le d\), we set \(Q[X,{{\mathcal {T}}},B,s]=1\) if there exists a partial schedule \({\mathcal {S}}\) of \({\mathcal {A}}\) that uses exactly one task of each color of X and which has end \(({{\mathcal {T}}},B,s)\). Otherwise, we set \(Q[X,{{\mathcal {T}}},B,s]=0\). Then, we dynamically compute all the values \(Q[X,{{\mathcal {T}}},B,s]\) by increasing the size of X. If X has cardinality one, say \(X=\{l\}\), we set \(Q[X,{{\mathcal {T}}},B,s]=1\) if, and only if, \({{\mathcal {T}}}\) contains only one task that has color l, behavior B and total duration s. Now, assume that we have computed all the values \(Q[X,{{\mathcal {T}}},B,s]\) with \(|X|\le p\) and consider an input \(Q[X,{{\mathcal {T}}},B,s]\) with \(|X|=p+1\). Then we set the following.

$$\begin{aligned} (\star ) \ \ \ Q[X,{{\mathcal {T}}},B,s]=\max \{&Q[X\setminus \{c\},{{\mathcal {T}}}',B',s']\ : \\ \text { the last task of } {{\mathcal {T}}} \text { has color } c&\text { and } ({{\mathcal {T}}}',B',s') \text { fits} \\ \text { with } ({{\mathcal {T}}},B,s)\},&\end{aligned}$$

where the maximum runs over all possible triples \(({\mathcal T}',B',\)\(s')\). It is clear that if there exists a partial schedule \({\mathcal {S}}\) which uses exactly one task of each color of X, which ends with \(({{\mathcal {T}}},B,s)\) and in which the last task, \(A_i\), has color c, then the end of \({{\mathcal {S}}}\setminus A_i\) will fit with \(({{\mathcal {T}}},B,s)\) and \({{\mathcal {S}}}\setminus A_i\) will use one task of each color of \(X\setminus \{c\}\). Hence, in this case, the right part of the equality \((\star )\) is 1. Conversely, if one of the value \(Q[X\setminus \{c\},{{\mathcal {T}}}',B',s']\) used in \((\star )\) is one, then we can extend the corresponding schedule with \(A_i\).

Now, we answer that the instance is positive in the colored version of the problem if one of the values \(Q[X,{\mathcal T},\) B,s] with \(X=\{1,\ldots ,k\}\) is one. Let us see how long could be the overall computation. The number of values \(Q[X,{{\mathcal {T}}},B,s]\) to compute is bounded by \(2^k\times n^{L} \times L^{L} \times d\), where we bound the number of subsets of at most L tasks by \(n^{L}\). Since we have \(d\le Lk\), the number of values \(Q[X,{{\mathcal {T}}},B,s]\) is finally at most \(k2^{k}L^{L+1}n^{L}\). Moreover, to compute a value \(Q[X,{\mathcal T},B,s]\) with \((\star )\) we have to examine all the triples \(({{\mathcal {T}}}',B',s')\) that fit with \(({{\mathcal {T}}},B,s)\), agree with constraints given by \(G_c\) and with the colors constraints. First, knowing the last task of \(({{\mathcal {T}}},B)\), it is possible to exactly compute \(s'\) from s. We already argued that there is at most \(L^Ln^L\) possible choices for the couples \(({{\mathcal {T}}}',B')\). Once such a couple is fixed, we check that the interleaves given by \(({{\mathcal {T}}}',B')\) are compatible with the graph \(G_c\), which can be done in \(O(L^2)\) time using the adjacency matrix of \(G_c\). Then we check, considering unit slots of time one by one, that \(({{\mathcal {T}}}',B',s')\) fits with \(({{\mathcal {T}}},B,s)\), requiring O(L) time. Finally, we have to verify that the colors of the tasks of \({{\mathcal {T}}}'\setminus {{\mathcal {T}}}\) are pairwise distinct, distinct from the color of the tasks of \({{\mathcal {T}}}'\cap {{\mathcal {T}}}\) and belong to X. This checking has to be done for at most L tasks and so asks for O(L) time.

For all coloring, we can compute the right part of \((\star )\) in time \(O(L^2L^Ln^L)\), that is \(O(n^L)\), and answering to the colored version of the problem could be done in time \(O(k2^kn^{2L})\).

As usual when using color-coding, to conclude we need a k-perfect family of hash functions from \(\{1,\ldots ,n\}\) to \(\{1,\ldots ,k\}\), that is a set of colorations such that for every subset U of \(\{1,\ldots ,n\}\) of size k, there exists one of these colorations that colors the elements of U with k different colors. Schmidt and Siegel (1990) explicitly provide such a family of colorations of size \(2^{O(k)}\log ^2n\) which can be computed in time \(2^{O(k)}\log ^2n\). Finally we generate all these colorations of our initial set of tasks \({\mathcal {A}}\) and for every coloration from this family, we run the previous dynamic programming algorithm. If one of these computations gives a positive answer, then we answer positively to  L-bounded CTST on the initial instance. If none of these algorithms return a positive answer, then we answer negatively to  L-bounded CTST on our starting instance. Indeed, if a suitable schedule of k tasks existed, then one of the chosen colorations would have colored these tasks with different colors and the corresponding dynamic program would have answered positively on it.

Finally, we obtain a total time of \(2^{O(k)}n^{2L}\log ^2n\) for the \(\mathsf {FPT}\) algorithm. \(\square \)

Hereafter we propose a negative result in term of parameterized complexity, using the notion of cross-composition. A cross-compositionFootnote 3 is a polynomial time algorithm that, given a sequence \((x_1,\ldots ,x_t)\) of t instances with the same size of an \(\mathsf {NP}\)-complete problem A, computes an instance (yk) of a parameterized problem B such that k is a polynomial in \(|x_1|+\log t\) and (yk) is a positive instance of B if and only if there is some \(1 \le i \le t\) such that \(x_i\) is a positive instance of A. Using the result proposed by Bodlaender et al. (2011), we know that if a parameterized problem B admits such cross-composition, then there is no polynomial size kernel for B unless \(\mathsf {coNP} \subseteq \mathsf {NP}/\mathsf {poly}\).

In order to show the kernel lower bound, we propose a cross-composition from the \(\mathsf {NP}\)-complete problem Hamiltonian Odd Bipartite. (There exists an easy reduction from the \(\mathsf {NP}\)-complete problem Hamiltonian Bipartite to this problem, see Garey and Johnson 1979.)

Hamiltonian Odd Bipartite:

  • Instance: Given a bipartite graph G with an odd number of vertices.

  • Question: Does exist a Hamiltonian path in G?

Theorem 3

For every fixed \(L\ge 4\),  L-unit CTST and  L-bounded CTST do not admit a polynomial kernel with respect to the parameter k, unless \(\mathsf {coNP} \subseteq \mathsf {NP}/\mathsf {poly}\).

Proof

First let us focus on  L-unit CTST. We consider some instances \(G_1, \ldots ,G_t\) of Hamiltonian Odd Bipartite with the same odd number of vertices denoted by n. Let \(L\ge 4\) be fixed, we provide an instance \(I=({{\mathcal {A}}}=\{A_1,\ldots , A_N\},G_c,d)\) of L-unit CTST with parameter \(k=n\). We choose \(G_c\) to be the disjoint union of the graphs \(G_1, \ldots ,G_t\). The integer N is then the number of vertices of \(G_c\) (i.e., \(N=tn\)) and we associate one task \(A_i\) to each vertex of \(G_c\). Finally, we set \(d=\frac{(n+1)L}{2}\), which is an integer since n is odd. We claim that I is a positive instance of  L-unit CTST if and only if \(G_c\) contains a path of length n, which will be the case if and only if there exists a graph \(G_i\) that contains an Hamiltonian path.

Indeed, consider three consecutive tasks \(A_{i_1}, A_{i_2}, A_{i_3}\) of any schedule \({\mathcal {S}}\) of p tasks of I. Tasks \(A_{i_1}\) and \(A_{i_3}\) cannot interleave, otherwise as \(a_{i_2}\) stands between \(a_{i_1}\) and \(a_{i_3}\)\(A_{i_1}\)\(A_{i_2}\) and \(A_{i_3}\) must pairwise interleave, which is not possible as \(G_c\) does not contain any clique of size three. Thus, the first task of \(\mathcal S\) does not interleave with the third task, which itself does not interleave with the fifth one, and so on. Hence, the makespan of the schedule \({\mathcal {S}}\) is at least \(\lceil \frac{p}{2} \rceil L\). Now assume that I is a positive instance and denote by \({\mathcal {S}}=(A_{i_1},\ldots ,A_{i_k})\) the corresponding partial schedule of k (\(=n\)) tasks with makespan at most d. By the previous remark, the makespan of \({\mathcal {S}}\) is at least \(\lceil \frac{k}{2} \rceil L=\frac{(n+1)L}{2}=d\). Thus, the makespan of \({\mathcal {S}}\) is exactly d. For every odd \(j\le n-2\), the sub-task \(a_{i_{j+2}}\) immediately follows the sub-task \(b_{i_j}\), and the task \(A_{i_{j+1}}\) interleaves with \(A_{i_{j}}\) and \(A_{i_{j+2}}\). If we denote by \(v_1,\ldots ,v_n\) the vertices of \(G_c\), respectively, associated with the tasks \(A_{i_1},\ldots ,A_{i_n}\), it means that \(v_1\ldots v_n\) is a path of \(G_c\), and thus it exists a Hamiltonian path in one of the \(G_i\)s.

Conversely, if one of the graphs \(G_i\) has an Hamiltonian path, we schedule the corresponding tasks of I as previously depicted.

Finally notice that the previously provided instance \(I=({{\mathcal {A}}}=\{A_1,\ldots , A_N\},G_c,d)\) is also an instance of  L-bounded CTST. Thus, the result holds also for this problem. \(\square \)

3 A structural parameter for CTS

In this section, we focus on the L-bounded version of the original problem parameterized by a structural parameter of the compatibility graph.

Let \((L,{{\mathcal {A}}}=\{A_1,\ldots , A_n\},G_c, C_{\max })\) be an instance of  L-bounded CTS. If the compatibility graph \(G_c\) has no edges, then any permutation of the tasks is an optimal schedule. We extend this observation to obtain an \(\mathsf {FPT}\) algorithm for CTS with the size of a vertex cover of the graph \(G_c\) as parameter. The size of a vertex cover of a graph is usually considered as a ‘large’ parameter in parameterized complexity. However, we will argue in the next section that it seems hard to obtain the same kind of \(\mathsf {FPT}\) algorithm according to some lower structural parameter for \(G_c\) (as for instance, feedback vertex set or tree width...).

The next lemma will be useful to design the \(\mathsf {FPT}\) algorithm. A subset X of vertices of a graph G are false twins if all the vertices of X have the same neighborhood in G (in particular, X forms an independent set of G).

Lemma 1

Let \({{\mathcal {S}}}\) be any schedule of the coupled-tasks \({{\mathcal {A}}}\) according to the compatibility graph \(G_c\) and p be a nonnegative integer. If there exists \((2p+1)\) tasks \(A_{i_1}, \ldots , \)\(A_{i_{2p+1}}\) of \({{\mathcal {A}}}\) whose corresponding vertices are false twins in \(G_c\) and have a common neighborhood of size at most p in \(G_c\), then one of the task \(A_{i_j}\) does not interleave with any task of \({\mathcal {A}}\) in \({\mathcal {S}}\).

Proof

Denote by \(x_1,\ldots , x_{2p+1}\) the vertices of \(G_c\), respectively, associated with the tasks \(A_{i_1}, \ldots , A_{i_{2p+1}}\). Denote also by Y the common neighborhood of \(x_1,\ldots ,\)\(x_{2p+1}\) in \(G_c\), and by \(A_{i'_1},\ldots ,A_{i'_l}\), with \(l\le p\), the coupled-task corresponding to the vertices of Y. Since the vertices \(x_1,\ldots , x_{2p+1}\) form an independent set of \(G_c\), the tasks \(A_{i_1}, \ldots ,A_{i_{2p+1}}\) do not interleave. Thus, a task \(A_{i'_j}\) can interleave with at most two tasks of \(\{A_{i_1}, \ldots ,A_{i_{2p+1}}\}\). Since \(l\le p\), there exists at least one task \(A_{i_j}\) that does not interleave with any task of \(A_{i'_1},\ldots ,A_{i'_l}\). Moreover, as \(x_j\) has no neighbor in \(G_c\setminus Y\), \(A_j\) does not interleave with any task of \({\mathcal {A}}\). \(\square \)

Theorem 4

For every fixed \(L\ge 4\), there exists an \(\mathsf {FPT}\) algorithm for  L-bounded CTS parameterized by the size k of a vertex cover of \(G_c\), in time \(O((k2^kL^3)!\cdot L^{k2^kL^3}+n^2)\).

Proof

Let \(I=(L,{{\mathcal {A}}}=\{A_1,\ldots , A_n\},G_c, C_{\max })\) be an instance of  L-bounded CTS. Notice that all tasks must be executed. Let also X be a vertex cover of \(G_c\) with size k. The vertices of \(G_c\setminus X\) form an independent set of \(G_c\), and in particular, their neighborhood is included in X. For each subset \(X'\) of X, we compute the set \(N_{X'}\) of vertices of \(G\setminus X\) with neighborhood exactly \(X'\). Habib et al. (1999) show how to compute all the \(N_{X'}\)s in timeFootnote 4\(O(n(G_c)+m(G_c))\) (using a particular technique called partition refinement). By definition, every set \(N_{X'}\) is composed by false twins of \(G_c\). Let us refine again this partition. Each task \(A_i=(a_i,l_i,b_i)\) has total duration at most L, and the values \(a_i\)\(b_i\) and \(l_i\) totally determine the time behavior of \(A_i\). Hence, there are at most \(L^3\) possibilities for these values. Thus, for each value \((a_i,l_i,b_i)\), the set \(N_{X',(a_i,l_i,b_i)}\) contains the tasks of \(N_{X'}\) with time behavior \((a_i,l_i,b_i)\). As all possible values for \((a_i,l_i,b_i)\) are known, we can perform this partition of \(N_{X'}\) in linear time. Now if, for a subset \(X'\) of X and fixed values \((a_i,l_i,b_i)\), we have \(|N_{X',(a_i,l_i,b_i)}|>2k\), then by Lemma 1 \((|N_{X',(a_i,l_i,b_i)}|-2k)\) coupled-tasks corresponding to some vertices of \(N_{X',(a_i,l_i,b_i)}\) do not interleave with any other coupled-tasks of \({\mathcal {A}}\) in any schedule. Therefore, to design an optimal schedule for the problem, since all coupled-tasks corresponding to the vertices of \(N_{X',(a_i,l_i,b_i)}\) are identical, \(|N_{X',(a_i,l_i,b_i)}|-2k\) arbitrarily coupled-tasks can be selected and allotted at the beginning of the schedule in the following way: not interleaving, consecutive and in any order. We also reduce the value \(C_{\max }\) by \((|N_{X',(a_i,l_i,b_i)}|-2k)(a_i+l_i+b_i)\). We repeat this routine for every subset \(X'\) of X and every triplet of values \((a_i,l_i,b_i)\) with \(|N_{X',(a_i,l_i,b_i)}|>2k\). Once a coupled-task is executed at the beginning of the schedule, we can remove it from the instance I. Hence, we obtain an equivalent instance \(I'\) containing at most \(2k\cdot 2^k\cdot L^3\) tasks with an objective makespan \(C'_{\max }\)\(I'\) forms a kernel for the problem, with exponential size and computed in time \(O(n^2)\).

Now, we exhaustively solve the problem on \(I'\). For instance, we can fix an order for the coupled-tasks and execute them in this order. Once a partial schedule is built, there are L possibilities to allot the sub-task \(a_i\) of the next task (\(L-1\) for a possible interleaving with the previous tasks plus 1 if the task \(A_i\) does not interleave with its previous task). Thus, for each order on the tasks, we compute in time \(O(L^{2k2^kL^3})\) the optimal schedule for \(I'\) with tasks in the fixed order. Finally, the optimal schedule for \(I'\) is found in time \(O((k2^kL^3)!\cdot L^{k2^kL^3})\). \(\square \)

If the total duration of the tasks is not bounded, it is not possible to have such an \(\mathsf {FPT}\) algorithm. Indeed in this case CTS is \(\mathsf {NP}\)-complete even if \(G_c\) is a star (in this case \(G_c\) would have a vertex cover of size one).

Lemma 2

CTS restricted to the instances with compatibility graph being a star is an \(\mathsf {NP}\)-complete problem.

Proof

First, being given a schedule it is easy to check in polynomial time that it is a solution to CST or not, and then the problem CTS is in \(\mathsf {NP}\). We use a reduction from the Subset Sum problem. An instance of subset sum is a set S of integers and a target integer value t. A positive answer to the problem is a subset \(S'\) of S with \(\sum _{s\in S'}s=t\). It is known that subset sum is an \(\mathsf {NP}\)-complete problem (Garey and Johnson 1979). Let (St) be an instance of subset sum. We denote by \(\{s_1, \ldots ,s_n\}\) the elements of S and consider the following instance of CTS. The task A has two sub-tasks with duration one and an idle time of length 2t. To every element \(s_i\) of S, we associate a task \(A_i\) with two sub-tasks of duration \(s_i\) and no idle time. The graph \(G_c\) on the vertex set \(\{A,A_1,\ldots ,A_n\}\) is a star with center A and leaves \(\{A_1,\ldots ,A_n\}\). Finally, we set \(C_{\max }=2(\sum _{s_i\in S} s_i)+2\). Clearly, this transformation is polynomial.

We claim that \((\{A,A_1,\ldots ,A_n\}, G_c,\) \(C_{\max })\) is a positive instance of CTS if and only if (St) is a positive instance of subset sum. Indeed, assume that \((\{A,A_1,\ldots ,\)\(A_n\},\)\(G_c, C_{\max })\) is a positive instance of CTS. As the sum of the duration of all the sub-tasks of the tasks \(\{A,\)\(A_1,\ldots ,A_n\}\) is exactly \(C_{\max }\), it means that these tasks can be scheduled without idle time. In particular, the set \(\{A_i\ :\ i\in I'\}\) of tasks filling the idle time of A has total duration exactly 2t. Hence, the corresponding set \(S'=\{s_i\ :\ i\in I'\}\) has total value t and (St) is a positive instance of subset sum. Conversely, we produce similarly an optimal schedule of \(\{A,A_1,\ldots ,A_n\}\) from a solution of subset sum. \(\square \)

4 Concluding remarks and open problems

In this article, we propose positive results for a coupled-task scheduling problem in the presence of compatibility constraints. Note that in scheduling theory, few positive results exist for parameterized complexity, mainly because many known problems are \({\mathsf {W}}[1]\)-hard when parameterized by standard parameters. One of the motivation in designing \(\mathsf {FPT}\) algorithms is to obtain efficient algorithms for small values of the parameter. Unfortunately the obtained algorithms, especially the one obtained from Theorem 2, do not seem to be practically useful. It is interesting to know the existence of such \(\mathsf {FPT}\) algorithms, but it could be interesting to obtain smaller upper bounds on the running time of these algorithms.

It is possible to extend our main result, Theorem 2, to a more general version of CTS . In Generalized CTS, every tasks \(A_i\) contains several sub-tasks \(a_1^i, \ldots ,\)\(a_{n_i}^i\) and for every \(j=1,\ldots ,n_i-1\), the sub-task \(a_{j+1}^i\) must be executed exactly after an idle time \(l_j^i\) succeeding the end of the sub-task \(a_j^i\). To interleave now at a certain position, two tasks must have linked corresponding vertices in the compatibility graph and no sub-tasks have to overlap in this position. Problem Generalized CTST asks whether there exists a schedule of the tasks \(A_i\) which contains at least k tasks executed before a given due time. For a constant L, we say that the problem is L-bounded if the total duration of every task is bounded by L (i.e., for every i we have \(a_1^i+l_1^i+a_2^i+\cdots +l_{n_i-1}^i+a_{n_i}^i\le L\)). In the proof of Theorem 2, to run the dynamic programming we use the fact that when L is fixed there is a finite number of possible kinds of tasks and a finite number of possible kinds of interactions between tasks. As this remark still holds in the case of tasks with several sub-tasks, we obtain the following.

Theorem 5

For every fixed \(L\ge 4\), there exists an \(\mathsf {FPT}\) algorithm for  L-bounded Generalized CTST.

However, Generalized CTS does not appear in the literature and is probably less worthy of interest than (standard) CTS.

Finally, for CTST, it could also be interesting to choose other structural parameters of the graph \(G_c\) in order to design an \(\mathsf {FPT}\) algorithm better than the one given by Theorem 4. However, it seems hard to choose a parameter like the tree width or the size of a feedback vertex set of \(G_c\) because it is unknown whether CTS is polynomially solvable when \(G_c\) is a tree. A possible candidate could be the distance to a disjoint union of paths: let \(\nu (G)\) be the minimal cardinality of a set X of vertices of G such that every connected component of \(G\setminus X\) is a path, where \(G\setminus X\) is the graph obtained from G by removing the vertices of X (and their incident edges). Hence, an interesting question is whether to know whether CTS admits an \(\mathsf {FPT}\) algorithm when it is parameterized by \(\nu \).