1. Introduction
We consider a two-machine job-shop scheduling problem. Each job
consists of two operations, i.e., we have
according to [
1]. The operation
is processed on the machine
and its processing time is equal to
a. The operation
is processed on the machine
and its processing time is equal to
b, where
and
. For simplicity of the subsequent consideration, we use both notations
a and
, where
a is a descriptor in
and
a is the processing time of any job on this machine.
Let be the subset of jobs j, for which operation precedes operation and let be the subset of jobs j, for which operation precedes operation . Moreover, denote and . Thus, we have . Please note that the parameter is different from and . The parameter is often used in publications on job-shop scheduling to denote the number of operations of job j, and we use , to denote the numbers of jobs with the two possible technological routes. A schedule is uniquely determined by two permutations and of the operations of the set . Let be the completion time of operation and be the starting time of the operation in the schedule .
For the two-machine job-shop scheduling problem of minimizing total completion time subject to given processing times, the objective is to find an optimal schedule
that minimizes the total completion time, i.e.,
We denote this problem by
according to the traditional three-field notation
for scheduling problems proposed by Graham et al. [
2], where
describes the machine environment,
gives the job characteristics and further constraints, and
describes the objective function. Please note that, without loss of generality, we can restrict to the case
since the case
can be trivially solved in constant time.
Our motivation to deal with this problem with an open complexity status is as follows:
Namely, the following single-track railway scheduling problem (STRSP) can be reduced to this problem. In the STRSP, there is a single track between the stations A and C and a middle station B between stations A and C. Trains go in both directions. Each of the sub-tracks and can process only one train at a time. At the station B, a train can pass other trains, and at all stations there are enough parallel tracks to deposit trains. A single-track network can be seen as a bottleneck portion for any type of railway network topology. Furthermore, almost all national railway networks have sections, where there is a single-track between some stations. For some countries (e.g., USA, Australia), a significant part of the network is single-track. For multi-track networks such a single-track segment can be considered as a bottleneck, in which the traffic capacity is restricted.
In this paper, we present a new polynomially solvable case for the two-machine job-shop problem with minimizing total completion time based on dynamic programming [
4]. At the same time, this extends an existing polynomial algorithm for the two-station single-track railway scheduling problem from [
5] to the case of three stations. In addition, we present a fast polynomial heuristic of lower complexity which is able to construct near-optimal solutions.
The rest of this paper is organized as follows. A brief literature review is given in
Section 2. In
Section 3, some properties of the problem are presented which are the base for the dynamic programming algorithm. Polynomial exact and heuristic solution procedures for this problem are presented in
Section 4. Some results of numerical experiments are presented in
Section 5. Finally, concluding remarks are given in
Section 6.
2. Literature Overview
The problem
of minimizing the makespan (maximal completion time) can be solved in constant time by Jackson’s algorithm [
3]. In an optimal schedule, on the machine
, first all operations
, are processed and then all operations
. On the machine
, first all operations
, are processed and then all operations
. However, the problem
without the restriction to at most two operations per job and arbitrary processing times is already NP-hard [
1].
Moreover, when minimizing total completion time, only very special unit-time problems can be polynomially solved (see e.g., [
1]). Even the two-machine unit-time problems
with release dates
,
with job weights
or the three-machine problem
are already NP-hard (see [
1]). Two-machine job shop scheduling problems with unit processing times and
operations per job, where the even operations are processed on one machine and the odd operations on the other one are considered in [
6,
7]. The scheduling problem to minimize total completion time is considered in [
8].
Some results on parallel machine and single machine scheduling problems with unit and equal processing times of the jobs are presented in [
9,
10]. Single machine problems are equivalent to the special case of a two-machine job shop scheduling problem with
, where
a is sufficiently small so that it can be disregarded. These problems without precedence relations are known to be polynomially solvable, except the problem
the complexity status of which is open. An additional motivation of our research is the search for an NP-hard job scheduling problem with equal processing times which is most close to single machine job scheduling problems with equal processing times without precedence relations and preemptions.
As previously mentioned, the problem under consideration is closely related to a particular single-track railway scheduling problem. Often such problems are considered in the case of maintenance of one track of a double-track line. For example, the French railway company SNCF develops such models to produce a new transport schedule in the event of an incident on one of the double-track line sections [
11]. The work on single-track railway scheduling problems (STRSP) goes back to the 1970s, with the initial publication [
12]. A recent literature review on the single-track railway scheduling problem can be found, e.g., in [
13]. A short survey on the STRSP with several stations, where trains are able to pass each other, is presented in [
14]. In [
5], a single-track railway scheduling problem with two stations and several segments of the track is considered. In [
15], train scheduling problems are modeled as job-shop scheduling problems with blocking constraints. Four MIP formulations are developed for the problem of minimizing total tardiness, and a computational study is made on hard instances with up to 20 jobs (trains) and 11 machines (tracks or track sections). Blocking constraints make the job-shop scheduling problem very hard from a practical point of view. In [
16], a complex neighborhood for the job-shop scheduling problem with blocking and total tardiness minimization has been developed and tested on benchmark instances from the literature. Further algorithms for general railway scheduling problems have been given for instance in [
17,
18,
19] and for job-shop scheduling problems with blocking in [
20,
21]. The blocking job-shop with rail-bound transportation has also been discussed in [
22]. Please note that for a small railway network with only a few stations and enough parallel tracks at each station, the blocking constraint can be skipped as in our three-station case.
In this paper, we deal with an exact dynamic programming approach. For some further recent general approaches for the solution of different types of single and multiple criteria scheduling problems, the interested reader is referred to [
23,
24,
25,
26,
27,
28,
29] which highlight the importance of developing advanced scheduling approaches. This concerns both the identification of new polynomially solvable problems as well as new MILP models and metaheuristic or hybrid algorithms.
3. Properties of the Problem
In this section, we present and prove in Lemmas 1–3 some basic properties of the problem. While Lemma 1 characterizes the structure of partial solutions, Lemmas 2 and 3 are used in the proof of the subsequent Theorem 1 which is the foundation of the dynamic programming algorithm given in
Section 4.
Without loss of optimality, we can restrict to schedules, where the operations are processed in the same order as the operations . Then we can schedule the jobs from each subset according to increasing numbers. To distinguish the jobs from the sets and , the jobs from the set are overlined, i.e., we have and .
In an active schedule, a job cannot be started earlier without violating the feasibility. Without loss of optimality, we consider active schedules only.
It is obvious that there is only a single case when an idle time on the machine arises. It can be immediately before time , i.e., when for the job , the completion time of the short operation (with processing time a) is equal to the starting time of the long one (with processing time b). The same holds for an idle time on the machine . An idle time can be immediately before time .
Lemma 1. In any active schedule, the starting times of the operations belong to the set Proof. We consider the possible starting time
of operation
in an active schedule. Let in the interval
,
operations be processed on the machine
without idle time and let there be an idle time immediately before
. Then there is a job
for which
Let in the interval
,
operations be processed on the machine
without an idle time and let there be an idle time immediately before
. Then there is a job
for which
. For an illustration, see
Figure 1.
By continuing this consideration, we have
□
Lemma 2. In any optimal schedule, we have , i.e., the starting times of the first operations of the first job from each subset are equal to 0.
Proof. It is obvious that in each active schedule for .
Next, we show that the lemma holds for the first job
. Let in a schedule
, this does not hold. The operation sequence for machine
is
, where in the partial sequence
there are
operations and
. The operation sequence for machine
is
, where in the partial sequence
there are
operations (see
Figure 2).
Then for the schedule
with the operation sequence
for machine
and the operation sequence
for machine
, we increase the completion times for the operations
on the value
, and we decrease the completion time of the operation
on the value
Let
, then the completion times of the operations from
and
are not increased. Thus, the total completion time is decreased on a value greater than or equal to
An analogous proof can be presented for the case
. The lemma is true for the first job from the set
. □
Lemma 3. In any active schedule Π at each time t, where an operation , is such that , the number of short operations completed is greater than or equal to the number of long operations completed.
Proof. The proof is done by induction. We consider the completion times t of the first, -th and k-th operations processed on the machine . The lemma holds for t equal to the completion time of the first operation processed on the machine , i.e., .
Let the lemma hold for t equal to the completion time of the -th operation processed on the machine . Moreover, there are operations completed on the machine before t. Let be the completion time of the last operation completed on the machine before time t.
Let be the completion time of the k-th operation processed on the machine . Then, in the interval , at least one operation can be processed on the machine and thus, at time , the number of short operations completed is greater than or equal to the number of long operations completed. □
Theorem 1. In any optimal schedule, there is no idle time on the machine before the last operation from the set , i.e., before the time .
Proof. The proof is done by induction. First, we show that the theorem holds for the first job from the set and then for the next jobs . If for an operation , in a schedule , there is an idle time before the time on the machine , then we construct a modified schedule , where the operations and are shifted to an earlier time so that the idle time is vanished and total completion time decreases.
If , then in any active schedule, there is no idle time on the machine , since for any operation , we have . Next, we consider the only remaining case .
According to Lemma 2, the theorem holds for the first job
. Let the theorem hold for the job
, and we consider the next job
. Let there exist an idle time before the time
in a schedule
. We prove that this idle time is before the time
as well. We do this by contradiction. Let there exist a schedule
with
and there is an idle time on the machine
in the interval
. We have
and
(see
Figure 3). In this case, at time
t, the number
of long operations completed is greater than the number
of short operations completed which is a contradiction to Lemma 3. So, assume that we have a schedule
, where the operation sequences are:
(see
Figure 3). In the schedule
, the last operation completed before the idle time is
according to the assumption made above that there is no idle time before operation
. Operation
is processed immediately before operation
since
.
Assume that there are short operations processed between the operations and in and long operations processed between the times and . It is easy to show that there is no idle time between the times and .
Denote
and
(see
Figure 1). We have
. Then
, otherwise
i.e.,
and
, which is false. As a consequence, we get
Let us consider a schedule
, where the operation sequences are
(see
Figure 1).
If in the schedule
, there is an idle time
between the times
and
, then
It is easy to show that there is no idle time on the machine between the time and the first operation in in the schedule . Then for all operations in the sequences and , the completion times are not increased.
Now, we increase the completion time:
We decrease the completion time of the operation
on the value
Thus, we decreased the total completion time on a value greater than or equal to
So, the theorem holds for job . □
4. Solution Algorithms for the Problems
In this section, we first present a fast polynomial heuristic and then a polynomial dynamic programming algorithm which is based on Theorem 1. The problem under consideration can be solved approximately by the following polynomial heuristic, which includes 3 major steps.
Heuristic H:
Construct a schedule according to Jackson’s algorithm.
Consider one by one the operations for . Shift the operation to the earliest position in the sequence, where the total completion time is not increased in comparison to the currently best schedule obtained.
Consider one by one the operations for . Shift the operation to the earliest position in the sequence, where the total completion time is not increased in comparison to the currently best schedule obtained.
Each of the steps 2 and 3 needs operations since for each operation, we consider positions and operations are needed to compute the total completion time of the modified schedule. So, the running rime of the algorithm is .
Next, we present an idea of an exact dynamic programming algorithm (DP). In the first step of Algorithm DP, we construct an active schedule that contains only jobs from the set . Then, in each stage , we compute all possible states , where
operation , is processed between the operations and and after all operations ,
operation , is processed between the operations and and after all operations .
For each state t, the total completion time of the operations , and the operations , is saved.
If for two states
and
, we have
then the state
can be excluded from the further considerations.
According to Theorem 1, we have . Thus, the state is uniquely defined by the vector . Please note that only states with are considered. The states obtained at stage j are used to compute the states in the next stage. After the last stage, for each state , we schedule the remaining operations , and , and add to the value the value . Then we choose the best solution.
The value and can be computed in constant time. For that, in the previous stage , for a state , we saved the value . Let us compute the state from the state . For the state t, the values and are computed in constant time. Then the value can be computed in constant time according to the values and . There can be only an idle time on the machine before operation but such a state can be excluded from consideration according to Theorem 1. Then, according to , the value can be computed in constant time. Finally, the value according to the times and and the value can be computed in constant time.
Theorem 2. The problem can be solved by Algorithm DP in time.
Proof. According to Lemma 1, there are no more than possible values . Then there are no more than possible states at the stage , and each state is computed in constant time. Since there are stages, the running time of Algorithm DP is . □
5. Computational Results
In this section, we present some results of a numerical experiment, where we investigate the relative error of the heuristic algorithm H and the number of states considered in Algorithm . We generated the instances as follows. For each , we generated 5000 instances with , yielding in total 30000 instances. For each instance, both the exact and the heuristic algorithms were used.
In
Table 1, we present the results for 30 randomly selected instances, namely five for each value
, where the main goal is to report the relative error of the heuristic presented in this paper. In columns 1–4, we present the job numbers
and
as well as the processing times
a and
b. In column 5, we give the optimal total completion time value
-
obtained by Algorithm DP. In column 6, we present the maximal number
of states remaining in the list at a stage. In column 7, we present the number
, which is given to show that the maximal number of states remaining in the list is less than
. In column 8, we give the total completion time value
-
H obtained by the heuristic. Finally, column 9 displays the percentage deviation
of the heuristic from the optimal function value.
In
Table 2, we present some results for all 30,000 considered instances. In column 1, we give the number
n of jobs. In columns 2 and 3, we present the average values
and
, respectively, for Algorithm DP. For Heuristic H, we present in column 4 the average values
and column 5 displays the percentage of instances
solved by the heuristic optimally. We also emphasize that the average relative error over all 30,000 instances is
.
Moreover, we can state that the maximal relative error of Heuristic H among all 30,000 instances is which has been obtained for an instance with . For this instance, the optimal objective function value is 384 and the total completion time computed by the heuristic is 401. Moreover, the maximal number of states saved to the state list in a stage is 32,811 which has been obtained for an instance with . In addition, if a state has been written to the list and later a state is computed, where and , then the state is deleted from the list. The maximal number of states in the list left after considering all states is 1743. So, there is a large difference between the number of states considered and the number of states remaining in the list.
According to the previous results, we can also present the following conjecture.
Conjecture 1. There are only states that have to be considered at each stage.
As a consequence of the above conjecture, the running time of an advanced DP algorithm could be reduced to .
6. Concluding Remarks
In this paper, some properties of the scheduling problem were considered which arises for instance in a single-track railway scheduling problem with three stations. A polynomial time solution algorithm of the complexity and a heuristic algorithm of the complexity were presented. In the numerical experiments with the 30000 instances, the running time of the dynamic programming algorithm was even bounded by the order . Moreover, in our tests, the average relative error of the polynomial heuristic was only .
The two-machine job-shop problem of minimizing the makespan was considered in the pioneering work by Jackson. This result is now considered as a classical one in the scheduling theory. An interesting open question is whether there exists an NP-hard job-shop scheduling problem with equal processing times on each machine and other objective functions without precedence relations and preemptions, or whether such problems are also polynomially solvable.