In TLSP, a list of projects is given, which each contain several tasks. For each project, the tasks must be partitioned into a set of jobs, with some restrictions on the feasible partitions. Then, those jobs must each be assigned a mode, time slots and resources. The properties and feasible assignments for each job are calculated from the tasks contained within.
A solution of TLSP is a schedule consisting of the following parts:
-
A list of jobs, composed of one or multiple similar tasks within the same project.
-
For each job, an assigned mode, start and end time slots, the employees scheduled to work on the job, and an assignment to a workbench and equipment.
The quality of a schedule is judged according to an objective function that is the weighted sum of several soft constraints and should be minimized. Among others, these include the number of jobs and the total completion time (start of the first job until end of the last) of each project.
Input parameters
A TLSP instance can be split into three parts: The laboratory environment, including a list of resources, a list of projects containing the tasks that should be scheduled together with their properties and the current state of the existing schedule, which might be partially or completely empty.
Environment
In the laboratory, resources of different kinds are available that are required to perform tasks:
-
Employees \(e \in E = \{1,\dots ,|E|\}\) who are qualified for different types of tasks.
-
A number of workbenches \(b \in B = \{1,\dots ,|B|\}\) with different facilities. (These are comparable to machines in shop scheduling problems.)
-
Various auxiliary lab equipment groups \(G_g = \{1,\dots ,|G_g|\}\), where g is the group index. These each represent a set of similar devices. The set of all equipment groups is called \(G^*\).
The scheduling period is composed of discrete time slots \(t \in T = \{0,\dots ,|T|-1\}\). Each time slot represents half a day of work.
Tasks are performed in one of several modes labeled \(m \in M = \{1,\dots ,|M|\}\). The chosen mode influences the following properties of tasks performed under it:
-
The speed factor \(v_m\), which will be applied to the task’s original duration.
-
The number of required employees \(e_m\).
Projects and tasks
Given is a set P of projects labeled \(p \in \{1,\dots ,|P|\}\). Each project contains tasks \(pa \in A_p\), with \(a \in \{1,\dots ,|A_p|\}\). The set of all tasks (over all projects) is \(A^* = \bigcup _{p \in P} A_p\).
Each task pa has several properties:
-
It has a release date \(\alpha _{pa}\) and both a due date \(\bar{\omega }_{pa}\) and a deadline \(\omega _{pa}\). The difference between the latter is that a due date violation only results in a penalty to the solution quality, while deadlines must be observed.
-
\(M_{pa} \subseteq M\) is the set of available modes for the task.
-
The task’s duration \(d_{pa}\) (in time slots, real-valued). Under any given mode \(m \in M_{pa}\), this duration becomes \(d_{pam} :=d_{pa} * v_m \).
-
Most tasks must be performed on a workbench. This is indicated by the boolean parameter \(b_{pa} \in \{0, 1\}\). If required, this workbench must be chosen from the set of available workbenches \(B_{pa} \subseteq B\).
-
Similarly, pa requires qualified employees chosen from \(E_{pa} \subseteq E\). The required number depends on the mode. A further subset \(E^{Pr}_{pa} \subseteq E_{pa}\) is the set of preferred employees.
-
Of each equipment group \(g \in G^*\), the task requires \(r_{pag}\) devices, which must be taken from the set of available devices \(G_{pag} \subseteq G_g\).
-
A list of direct predecessors \(\mathcal P_{pa} \subseteq A_p\), which must be completed before the task can start. Note that precedence constraints can only exist between tasks in the same project.
Each project’s tasks are partitioned into families \(F_{pf} \subseteq A_p\), where f is the family’s index. For a given task pa, \(f_{pa}\) gives the task’s family. Only tasks from the same family can be grouped into a single job.
Additionally, each family f is associated with a certain setup time \(s_{pf}\), which is added to the duration of each job containing tasks of that family.
Finally, each project p may define linked tasks, which must be assigned the same employee(s). Linked tasks are given by the equivalence relation \(L_p \subseteq A_p \times A_p\), where two tasks pa and pb are linked if and only if \((pa, pb) \in L_p\).
Initial schedule
All problem instances include an initial (or base) schedule, which may be completely or partially empty. This schedule can act both as an initial solution and as a baseline, placing limits on the schedules of employees and tasks, in particular by defining fixed assignments that must not be changed.
Provided is a set of jobs \(J^0\), where each job \(j \in J^0\) contains the following assignments:
-
The tasks in the job: \(\dot{A}_j\)
-
The mode assigned to the job: \(\dot{m}_{j}\)
-
The start and completion times of the job: \(\dot{t}^s_{j}\) resp. \(\dot{t}^c_{j}\)
-
The resources assigned to the job:
-
Workbench: \(\dot{b}_{j}\)
-
Employees: \(\dot{E}_{j}\)
-
Equipment: \(\dot{G}_{gj}\) for equipment group g
Except for the tasks, each individual assignment may or may not be present in any given job. Fixed tasks are assumed to be empty, if not given. In all other cases, missing assignments will be referred to using the value \(\epsilon \). Time slots and employees can only be assigned if also a mode assignment is given.
A subset of these jobs are the started jobs \(J^{0S}\). A started job \(j^s \in J^{0S}\) must fulfill the following conditions:
-
It must contain at least one fixed task. It is assumed that the fixed tasks of a started job are currently being worked on.
-
Its start time must be 0.
-
It must contain resource assignments fulfilling all requirements.
A started job’s duration does not include a setup time. In the solution, the job containing the fixed tasks of a started job must also start at time 0. Usually, the resources available to the fixed tasks of a started job are additionally restricted to those assigned to the job, to avoid interruptions of ongoing work in case of a rescheduling.
Jobs and grouping
For various operational reasons, tasks are not scheduled directly. Instead, they are first grouped into larger units called jobs.
A single job can only contain tasks from the same project and family.
Jobs have many of the same properties as tasks, which are computed from the tasks that make up a job. The general principle is that within a job, tasks are not explicitly ordered or scheduled; therefore the job must fulfill all requirements of each associated task during its whole duration.
The motivation behind this restriction, which deliberately overconstrains the schedule, is due to a combination of conditions in the laboratory of our industrial partner:
-
Tasks of the same family usually have equivalent or very similar requirements in practice.
-
Many tasks only cover a small fraction of a timeslot (e.g. half an hour out of a four-hour timeslot). Scheduling tasks directly to timeslots would therefore incur unacceptable overheads due to rounding. An alternative solution to this problem would be shorter timeslots, which would conflict with the flexible working times in the lab.
-
Related formalisms, e.g. schedule-dependent setup times (Mika et al. 2006), would be difficult to apply since the actual setup time between two tasks may depend on multiple resources.
-
Tasks frequently need to be reordered or delayed. The chosen formulation guarantees that this is always possible within a job, adding a measure of flexibility to the schedule. Results by Wilson et al. (2012) indicate that this flexibility can be useful in the presence of delays during the execution of a schedule.
Let \(J = \{1,\dots ,|J|\}\) be the set of all jobs in a solution and \(J_p \subseteq J\) be the set of jobs of a given project p. Then for a job \(j \in J\), the set of tasks contained in j is \(\dot{A}_j\). j has the following properties:
$$\begin{aligned} \tilde{p}_j \quad \text {and}\quad \tilde{f}_j \end{aligned}$$
are the project and family of j.
$$\begin{aligned} {\tilde{\alpha }_j :=\max \limits _{pa \in \dot{A}_j} \alpha _{pa} \text {,} \quad \tilde{\bar{\omega }}_j :=\min \limits _{pa \in \dot{A}_j} \bar{\omega }_{pa} \text {,} \quad \tilde{\omega }_j :=\min \limits _{pa \in \dot{A}_j} \omega _{pa} } \end{aligned}$$
are the release date, due date and deadline of j, respectively.
$$\begin{aligned} {\tilde{M}_j :=\bigcap \limits _{pa \in \dot{A}_j} M_{pa}} \end{aligned}$$
is the set of available modes.
$$\begin{aligned} \tilde{d}_{jm} :=\lceil (s_{p_jf_j} + \sum \limits _{pa \in \dot{A}_j} d_{pa}) ~*~ v_m\rceil \end{aligned}$$
is the (integer) duration of the job under mode m. The additional setup time is added to the total duration of the contained tasks.
$$\begin{aligned} {\tilde{b_j} :=\max _{pa \in \dot{A}_j} b_{pa} } \end{aligned}$$
is the required number of workbenches (\(\tilde{b}_j \in \{0, 1\}\))
$$\begin{aligned} {\tilde{B}_{j} :=\bigcap _{pa \in \dot{A}_j} B_{pa} } \end{aligned}$$
are the available workbenches for j.
$$\begin{aligned} {\tilde{E}_{j} :=\bigcap _{pa \in \dot{A}_j} E_{pa} } \end{aligned}$$
are the employees qualified for j.
$$\begin{aligned} \tilde{E}^{Pr}_{j} :=\bigcap _{pa \in \dot{A}_j} E^{Pr}_{pa} \end{aligned}$$
are the preferred employees of j.
$$\begin{aligned} \tilde{r}_{jg} :=\max _{pa \in \dot{A}_j} r_{pag} \end{aligned}$$
are the required units of equipment group g.
$$\begin{aligned} \tilde{G}_{jg} :=\bigcap _{pa \in \dot{A}_j} G_{pag} \end{aligned}$$
are the available devices for equipment group g.
$$\begin{aligned} \tilde{\mathcal P}_j :=\{k \in J \setminus \{j\}: \exists pa \in \dot{A}_j, pb \in \dot{A}_k \text { s.t. } pb \in \mathcal P_{pa}\} \end{aligned}$$
is the set of predecessor jobs of j. Finally,
$$\begin{aligned} \tilde{L}_p :=\{(j, k) \in J \times J : j \ne k \wedge \exists pa \in \dot{A}_j, pb \in \dot{A}_k \text { s.t. } (pa, pb) \in L_{p}\} \end{aligned}$$
defines the linked jobs in project p.
In addition, a solution contains the following assignments for each job:
-
\(\dot{t}^s_{j} \in T\) the scheduled start time slot
-
\(\dot{t}^c_{j} \in T\) the scheduled completion time
-
\(\dot{m}_{j} \in M\) the mode in which the job should be performed
-
\(\dot{b}_{j} \in B\) the workbench assigned to the job (\(\epsilon \) if no workbench is required)
-
\(\dot{E}_{j} \subseteq E\) the set of employees assigned to the job
-
\(\dot{G}_{jg} \subseteq G_g\) the set of assigned devices from equipment group g
Constraints
A solution is evaluated in terms of constraints that it should fulfill. Hard constraints must all be satisfied in any feasible schedule, while the number and degree of violations of soft constraints in a solution give a measure for its quality.
For the purpose of modeling, we introduce additional notation: The set of active jobs at time t is defined as \(\mathcal J_t :=\{j \in J : \dot{t}^s_{j} \le t \wedge \dot{t}^c_{j} > t\}\).
Hard constraints
-
H1: Job assignment Each task must be assigned to exactly one job.
$$\begin{aligned} \begin{aligned}&\forall p \in P, pa \in A_p:\\&\quad \exists ! j \in J ~\text {s.t.}~pa \in \dot{A}_j\end{aligned} \end{aligned}$$
-
H2: Job grouping All tasks contained in a job must be from the same project and family.
$$\begin{aligned}&\forall j \in J, pa \in \dot{A}_j:\\&\quad p = \tilde{p}_j\\&\quad f_{pa} = \tilde{f}_j \end{aligned}$$
-
H3: Fixed tasks Each group of tasks assigned to a fixed job in the base schedule must also be assigned to a single job in the solution.
$$\begin{aligned} \begin{aligned}&\forall j^0 \in J^{0}:\\&\quad \exists j \in J ~\text {s.t.}~\dot{A}^F_{j^0} \subseteq \dot{A}_j\end{aligned} \end{aligned}$$
-
H4: Job duration The interval between start and completion of a job must match the job’s duration.
$$\begin{aligned} \begin{aligned}&\forall j \in J:\\&\quad \dot{t}^c_j - \dot{t}^s_j = \tilde{d}_{j\dot{m}_{j}}\end{aligned} \end{aligned}$$
-
H5: Time Window Each job must lie completely within the time window from the release date to the deadline.
$$\begin{aligned}&\forall j \in J:\\&\quad \dot{t}^s_j \ge \tilde{\alpha }_j\\&\quad {\dot{t}^c_j \le \tilde{\omega }_j} \end{aligned}$$
-
H6: Task precedence A job can start only after all prerequisite jobs have been completed.
$$\begin{aligned} \begin{aligned}&\forall j \in J, k \in \tilde{\mathcal P}_j:\\&\quad \dot{t}^c_k \le \dot{t}^s_j\end{aligned} \end{aligned}$$
-
H7: Started jobs A job containing fixed tasks of a started job in the base schedule must start at time 0.
$$\begin{aligned} \begin{aligned}&\forall j \in J, j^s \in J^{0S}:\\&\quad t^F_{j^s} = 1 \wedge \dot{A}^F_{j^s} \subseteq \dot{A}_j ~\implies ~ \dot{t}^s_j = 0\end{aligned} \end{aligned}$$
-
H8: Single assignment At any one time, each workbench, employee and device can be assigned to at most one job.
$$\begin{aligned} \begin{aligned}&\forall b \in B, t \in T:\\&\quad |\{j \in \mathcal J_t : \dot{b}_j = b\}| \le 1\end{aligned}\\ \begin{aligned}&\forall e \in E, t \in T:\\&\quad |\{j \in \mathcal J_t : e \in \dot{E}_j\}| \le 1\end{aligned}\\ \begin{aligned}&\forall g \in G^*, d \in G_g, t \in T:\\&\quad |\{j \in \mathcal J_t : d \in \dot{G}_{jg}\}| \le 1\end{aligned} \end{aligned}$$
-
H9a: Workbench requirements Each job requiring a workbench must have a workbench assigned.
$$\begin{aligned} \begin{aligned}&\forall j \in J:\\&\quad \dot{b}_j = \epsilon \iff \tilde{b}_j = 0\end{aligned} \end{aligned}$$
-
H9b: Employee requirements Each job must have enough employees assigned to cover the demand given by the selected mode.
$$\begin{aligned} \begin{aligned}&\forall j \in J:\\&\quad |\dot{E}_j| = e_{\dot{m}_j}\end{aligned} \end{aligned}$$
-
H9c: Equipment requirements] Each job must have enough devices of each equipment group assigned to cover the demand for that group.
$$\begin{aligned} \begin{aligned}&\forall j \in J, g \in G^*:\\&\quad |\dot{G}_{jg}| = \tilde{r}_{jg}\end{aligned} \end{aligned}$$
-
H10a: Workbench suitability The workbench assigned to a job must be suitable for all tasks contained in it.
$$\begin{aligned} \begin{aligned}&\forall j \in J:\\&\quad \dot{b}_j = \epsilon \vee \dot{b}_j \in \tilde{B}_j\end{aligned} \end{aligned}$$
-
H10b: Employee qualification All employees assigned to a job must be qualified for all tasks contained in it.
$$\begin{aligned} \begin{aligned}&\forall j \in J:\\&\quad \dot{E}_j \subseteq \tilde{E}_j\end{aligned} \end{aligned}$$
-
H10c: Equipment availability The devices assigned to a job must be taken from the set of available devices for each group.
$$\begin{aligned} \begin{aligned}&\forall j \in J, g \in G^*:\\&\quad \dot{G}_{jg} \subseteq \tilde{G}_{jg}\end{aligned} \end{aligned}$$
-
H11: Linked jobs Linked jobs must be assigned exactly the same employees.
$$\begin{aligned} \begin{aligned}&\forall p \in P, (j, k) \in \tilde{L}_p:\\&\quad \dot{E}_j= \dot{E}_k\end{aligned} \end{aligned}$$
Soft constraints
The following constraints can be used to evaluate the quality of a feasible solution. They arise from the business requirements of our industrial partner and have been formulated in close cooperation with them.
Each soft constraint violation induces a penalty on the solution quality, denoted as \(C^{i}\), where i is the soft constraint violated.
-
S1: Number of jobs The number of jobs should be minimized.
$$\begin{aligned} \begin{aligned}&:\\&\quad C^{S1} :=|J|\end{aligned} \end{aligned}$$
-
S2: Employee project preferences The employees assigned to a job should be taken from the set of preferred employees.
$$\begin{aligned} \begin{aligned}&\forall j \in J:\\&\quad C^{S2}_j :=|\{e \in \dot{E}_j : e \notin \tilde{E}^{Pr}_{j} \}|\end{aligned} \end{aligned}$$
-
S3: Number of employees The number of employees assigned to each project should be minimized.
$$\begin{aligned} \begin{aligned}&\forall p \in P:\\&\quad C^{S3}_p :=|\bigcup _{j \in J_p} \dot{E}_j|\end{aligned} \end{aligned}$$
-
S4: Due date The internal due date for each job should be observed.
$$\begin{aligned} \begin{aligned}&\forall j \in J:\\&\quad C^{S4}_j :=\max (\dot{t}^c_j - \tilde{\bar{\omega }}_j, 0)\end{aligned} \end{aligned}$$
-
S5: Project completion time The total completion time (start of the first test to end of the last) of each project should be minimized.
$$\begin{aligned} \begin{aligned}&\forall p \in P:\\&\quad C^{S5}_p :=\max _{j \in J_p} \dot{t}^c_j ~-~ \min _{j \in J_p} \dot{t}^s_j\end{aligned} \end{aligned}$$
Constraint S1 favors fewer, longer jobs over more fragmented solutions. This helps reducing overhead (fewer setup periods necessary, rounding of fractional durations) and increases the flexibility of the schedule, since tasks within a job can be freely reordered. Also, it reduces the complexity of the final schedule, both for the employees performing the actual tasks and any human planners in those cases where manual corrections or additions become necessary.
In practice in the lab of our industrial partner, it has proved efficient to have only few employees cover the tests of a single project, due to the presence of project-specific conditions and procedures as well as the need for continual coordination and communication with other parts of the laboratory as well as external clients. This is captured by constraint S3.
Constraint S4 makes the schedule more robust by encouraging jobs to be completed earlier than absolutely required, so they can still be finished on time in case of delays or other disturbances.
Finally, constraint S5 also helps reduce overheads, as longer timespans between the tests of a project would require additional effort to become familiar with project-specific test procedures, as well as storage space for the devices in between tests.
The overall solution quality will be determined as the weighted sum over all soft constraint violations.
The relative importance of these constraints (i.e. their weights) still needs to be defined. In practical applications, we expect them to be chosen interactively according to the current situation. For our evaluations, we have assumed a uniform weight of 1 for all soft constraints.
The TLSP-S problem
A practically relevant subproblem of the TLSP deals with the case where a grouping of tasks into jobs is already provided for each project, which cannot be changed by the solver. Thus, the goal is to find an assignment of a mode, time slot and resources to each (given) job, such that all constraints are fulfilled and the objective function is minimized. Since this variant focuses on the scheduling part of the problem, we denote it as TLSP-S.
In TLSP-S, the number and properties of jobs (see Sect. 3.2) are fixed and can be precomputed from the properties of the tasks they contain.
Without loss of generality, we assume that this fixed initial grouping is provided via the initial schedule. Thus, an instance for TLSP-S can also be given as input to a solver for TLSP and vice-versa, as long as the initial schedule contains a valid job grouping for all tasks.
For TLSP-S, constraints H1–H3 will always be trivially satisfied and can therefore be ignored. Similarly, the penalty induced by soft constraint S1 is constant, since the number of jobs cannot be modified. We still include this penalty in our results for comparability of the solutions with instances of TLSP.
Complexity analysis of TLSP
In this section, we provide a reduction from RCPSP to TLSP, to show that TLSP is indeed a generalization of RCPSP. Since RCPSP is known to be NP-hard (Blazewicz et al. (1983)), this also shows the NP-hardness of TLSP.
RCPSP can be defined as follows (summarized from the definition given by Hartmann and Briskorn (2010)): Input is a list of activities \(A = \{1,\dots ,|A|\}\). Each activity a has a duration \(d_a\), a list of predecessors \(P_a \subset A\), which must be completed before a can start, and resource requirements \(r_{ak}\) for each resource \(k \in K = \{1,\dots ,|K|\}\). Each resource has a capacity \(c_k\), which denotes the number of available units per timeslot. The goal is to find a start time for each activity, such that precedence constraints are fulfilled, the capacity of each resource is not exceeded in any timeslot and the total makespan (i.e. the end of the last activity in the schedule) is minimal.
For this reduction, we use the decision variant of RCPSP (which was also proven NP-hard by Blazewicz et al. (1983)), which takes an integer s as additional input and asks whether a schedule with makespan \(\le s\) exists.
Given an arbitrary instance of RCPSP \(\mathcal {I}\), we can then construct a corresponding instance of TLSP as follows:
-
It contains a single project \(p_1\).
-
For each activity a in \(\mathcal {I}\), we create a corresponding task in \(p_1\) with the same duration as a. Each task has its own family (with a setup time of 0).
-
Precedences between activities in \(\mathcal {I}\) can be directly translated to the tasks of \(p_1\).
-
Each task has a release date of 0 and both a target date and a deadline of s.
-
There is a single mode with speed factor 1 and no required employees. This mode is available for all tasks.
-
For each resource k in \(\mathcal {I}\), we create a new equipment group \(g_k\), containing \(c_k\) devices.
-
Equipment requirements for each task are determined as follows: A task requires \(r_{ak}\) devices of group \(g_k\), where a is the activity in \(\mathcal {I}\) that corresponds to the task. All devices in each group are available for all tasks.
-
There are no workbenches or employees. Tasks do not require workbenches.
-
There are no linked tasks.
-
The base schedule is empty.
Since each family contains only a single task, the job grouping of each feasible schedule is uniquely determined: There is a separate job for each task, which has exactly the same properties (regarding duration, resource requirements, precedences, linked jobs) as the task it contains. For any activity a in \(\mathcal {I}\), there must be exactly one corresponding job \(j_a\), which is the one containing the task corresponding to a in the above construction.
Given a schedule (identified by the set of jobs J) that is a feasible solution for the TLSP instance constructed above, it is easy to see that it directly corresponds to a valid schedule \(\mathcal {S}\) for the RCPSP instance \(\mathcal {I}\), where each activity a starts at the same time as \(j_a \in J\). Precedences are satisfied by construction and the capacity of each resource cannot be exceeded at any time, since otherwise at least one device would have to be assigned to two overlapping jobs in J at the same time (pidgeonhole principle). Further, all jobs in J must end before the deadline s. Since both start and duration of abilities and the corresponding jobs are equal, this also means that all activities in \(\mathcal {S}\) must end before s, i.e. the makespan of \(\mathcal {S}\) is at most s.
In the other direction, for any instance \(\mathcal {I}\) of RCPSP, with a schedule S of makespan at most s, we can find a feasible schedule J for the corresponding instance of TLSP constructed as above. As before, each job \(j_a \in J\) should start (and end) at the same time as the corresponding activity a in \(\mathcal {S}\). Precedences and time windows are then satisfied by construction. Next, we will show that we can always find an equipment assignment for each job that fulfills both the requirements (constraint H9c) and the single assignment constraint (H8) are satisfied: We look at each job j in order of increasing start time. Let \(J_{<j}\) be all jobs considered before j which overlap the start of j, \(A_{<j}\) be the activities in \(\mathcal {S}\) corresponding to those jobs and a be the activity corresponding to j. Since \(\mathcal {S}\) is feasible, the activities in \(A_{<j}\) can require a total of at most \(c_k - r_{ak}\) units of each resource k (the remaining \(r_{ak}\) units are required for a). Therefore, there can be at most \(c_k - r_{ak}\) devices assigned to jobs in \(J_{<j}\). It follows that there are at least \(r_{ak}\) devices left to be assigned to j, which is enough to cover its requirements (H9c). Since jobs are considered in order of increasing start time, there can also be no other jobs not in \(J_{<j}\) that overlap j and have those devices assigned. It follows that constraint H8 must be fulfilled at every step. All other constraints are trivially satisfied.
In conclusion, a schedule for the RCPSP instance with makespan \(\le s\) exists if and only if the corresponding TLSP instance is feasible. Since the reduction can be done in polynomial time, this proves that even the problem of finding any feasible solution for TLSP is already NP-hard.
If the base schedule is not empty, but instead the (unique) feasible job grouping is provided as additional input, we immediately arrive at an instance for TLSP-S. As before, each activity in \(\mathcal {I}\) corresponds directly to both exactly one task and exactly one job in the constructed instance. Therefore, the same argument as for TLSP can be used to show the NP-hardness also of TLSP-S.