You are on page 1of 18

Chapter 5: Job Shop Scheduling

Phan Nguyen Ky Phuc

April 8, 2020

Contents

1 Introduction 1

2 Single Machine and Parallel Machine Models 2

3 Job Shop and Mathematical Programming 3

3.1 Mathematical Programming . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4

3.2 Cplex Code . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4

3.3 Job Shops and the Shifting Bottleneck Heuristic . . . . . . . . . . . . . . . . . . . . . . . . . 6

3.4 Example of Shifting Bottle Neck . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6

3.4.1 Iteration 1 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8

3.4.2 Iteration 2 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9

3.5 Job Shops and Constraint Programming . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9

3.6 Constraint Satisfaction Procedure . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11

3.7 Example of Constraint Programming . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11

3.7.1 Iteration 1 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12

3.7.2 Iteration 2 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 13

3.7.3 Iteration 3 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 14

3.7.4 Iteration 4 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 15

3.7.5 Iteration 5 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 16

3.7.6 Iteration 6 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 16

4 Assigment 17

1 Introduction

This chapter focuses on job shops.

• There are n jobs and each job visits a number of machines following a PREDETERMINED ROUTE

1
Ho Chi Minh City International University Scheduling
Industrial Systems Engineering Department Lecturer: Phan Nguyen Ky Phuc

• In some models a job may visit any given machine at most once and in other models a job may visit
each machine more than once, i.e, recirculation.

• A generalization of the basic job shop is a so-called flexible job shop which consists of a collection of
workcenters and each workcenter consists of a number of identical machines in parallel.

• Each job follows a predetermined route visiting a number of workcenters; when a job visits a workcenter,
it may be processed on any one of the machines at that workcenter.

2 Single Machine and Parallel Machine Models


• A single machine is the simplest case of a job shop and a parallel machine environment is equivalent
to a flexible job shop that consists of a single workcenter.

Single Machine

• Consider a single machine and n jobs. Job j has a processing time pj , a release date rj and a due date
dj . If rj = 0 and dj = ∞, then the processing of job j is basically unconstrained.

• The makespan Cm ax in a single machine environment does not depend on the schedule.
Pn
• If the objective is to minimize the total weighted completion time, i.e., j=1 wj Cj , and the processing
of the jobs is unconstrained, then the the optimal schedule is Weighted Shortest Processing Time
first WSPT rule, which schedules the jobs in decreasing order of wj /pj .

• If the objective is to minimize the maximum lateness Lmax and the jobs are all released at time 0,
then the optimal schedule is the Earliest Due Date first (EDD) rule, which schedules the jobs in
increasing order of dj

• WSPT rule and the EDD rule are static priority rules.

• When the release time is not known in advanced, if the objective is to minimize the maximum lateness
Lmax then the Minimum Slack first (MS) is adopted. If the machine becomes available at time t,
the job with the least slack,i.e., max(dj − pj − t, 0) is assigned to the machine.MS rule is a dynamic
priority rule, in which the priority of each job is changed regarding to time.

• If the objective is to minimize the total weighted tardiness , then the heuristic algorithm Apparent
Tardiness Cost first (ATC) rule is applied. If the machine is free at time t, according to ATC rule,
among the remaining jobs the job with the highest Ij (t) is selected
 
wj max (dj − pj − t, 0)
Ij (t) = exp −
pj K p̄

where K is a so-called scaling parameter and p̂ is the average of the processing times of the jobs that
remain to be scheduled.

Parallel Machines

• If the objective is minimize Cmax , a heuristic priority rule, namely the Longest Processing Time
first (LPT) rule is adopted. According to this rule, whenever one of the machines is freed, the longest
job among those waiting for processing is selected to go next. This rule guarantees a solution that is
within 33 % of the optimal

Chapter 5: Job Shop Scheduling Page 2


Ho Chi Minh City International University Scheduling
Industrial Systems Engineering Department Lecturer: Phan Nguyen Ky Phuc

• If all n jobs are available at t = 0, then the nonpreemptive SPT rule minimizes the total completion
P
time j Cj ;the nonpreemptive SPT rule remains optimal when preemtions are allowed.
P
• Minimizing the total weighted completion time j wj Cj in a parallel machine setting when all jobs are
available at t = 0 is NP-Hard, the WSPT rule can guarantee a solution within 22 % of the optimal.

3 Job Shop and Mathematical Programming

Consider a job shop with n jobs and m machines. Each job has to be processed by a number of machines in
a given order and there is no recirculation. The processing of job j on machine i is referred to as operation
(i, j), i.e., (machine, job) and its duration is pij . The objective is to minimize the makespan Cmax . The
problem can be presented a graph G
Graph G

• Graph G composes of a set of nodes N and set of conjuntive (solid) arcs A and and disjunctive (broken)
arcs B.

• A node is presented as (i, j) , i.e., (machine, job)

• The conjunctive (solid) arcs A represent the routes of the jobs. If arc (i, j) → (h, j) ∈ A, then job j
has to be processed on machine i before it is processed on machine h

• Two operations that belong to two different jobs and which have to be processed on the same machine
are connected to one another by two so-called disjunctive (broken) arcs going in opposite directions.

• All arcs emanating from a node, solid as well as broken, have as length the processing time of the
operation that is represented by that node. In addition there is a source U and a sink V , which are
dummy nodes.

• A feasible schedule corresponds to a selection of one broken arc from each pair. Such a selection
determines the sequence in which the operations are to be performed on that machine.

• The makespan of a feasible schedule is determined by the longest path in the feasible schedule from
the source U to the sink V .

Figure 1: Directed Graph of Job Shop

Chapter 5: Job Shop Scheduling Page 3


Ho Chi Minh City International University Scheduling
Industrial Systems Engineering Department Lecturer: Phan Nguyen Ky Phuc

Table 1: Parameters of Example

Job Sequence Processing Time


1 1,2,3 p11 = 10, p21 = 8, p31 = 4
2 2,1,4,3 p22 = 8, p12 = 3, p42 = 5, p32 = 6
3 1,2,4 p13 = 4, p23 = 7, p43 = 3

3.1 Mathematical Programming

Sets
M : set of machines
J: set of jobs
A : be the set of solid arcs
B : be the set of broken arcs
N : be the set of nodes
Parameters
pij be processing time of job j on machine i
Variables
yij : starting of job j on machine i
xijk : binary variable xijk = 1 if job j is processed before job k in machine i; otherwise xijk = 0
Cmax : the make span

max Cmax

subject to

yhj ≥ yij + pij , ∀(i, j) → (h, j) ∈ A


Cmax ≥ pij + yij , ∀(i, j) ∈ N
yij ≥ pik + yik − BigM × (1 − xikj ), ∀(i, k), (i, j), i = 1, 2..m
yik ≥ pij + yij − BigM × (1 − xijk ), ∀(i, k), (i, j), i = 1, 2..m
xijk + xikj = 1
Example
Consider the following example with 4 machines and 3 jobs. The route, i.e., the machine sequence, as well
as the processing times are presented in the Table 1 below.

3.2 Cplex Code

In this example, the tuple approach is used to write the code. Remind the structure of the set.
1 t u p l e tupleName {
2 dataType a t t r i b u t e 1 ;
3 dataType a t t r i b u t e 2 ;
4 };
5 s e t o f ( tupleName ) t u p l e S e t = . . . ;
6 f l o a t ParameterA [ t u p l e S e t ] = . . . ;
7 dvar b o o l e a n X[ t u p l e S e t ] ;

Data is given in "JobShopTupleData.xlsx" excel file as

File *.mod
1 i n t numJob = . . . ;

Chapter 5: Job Shop Scheduling Page 4


Ho Chi Minh City International University Scheduling
Industrial Systems Engineering Department Lecturer: Phan Nguyen Ky Phuc

Table 2: Data in "JobShopTupleData.xlsx"

(b) Data in "Node Sheet"

A B C
1 Machine Job ProTime
2 1 1 10
(a) Data in "Scalar Sheet" 3 2 1 8
4 3 1 4
A B
5 2 2 8
1 numJob 3
6 1 2 3
2 numMachine 4
7 4 2 5
8 3 2 6
9 1 3 4
10 2 3 7
11 4 3 3
(c) Data in "BrokenArc Sheet"

A B C
1 Machine PreJob SucJob
2 1 1 2
3 1 2 1 (d) Data in "SolidArc Sheet"
4 1 2 3
A B C
5 1 3 2
1 Job PreMachine SucMachine
6 1 1 3
2 1 1 2
7 1 3 1
3 1 2 3
8 2 1 2
4 2 2 1
9 2 2 1
5 2 1 4
10 2 2 3
6 2 4 3
11 2 3 2
7 3 1 2
12 2 1 3
8 3 2 4
13 2 3 1
14 3 1 2
15 3 2 1
16 4 2 3
17 4 3 2

2 i n t numMachine = . . . ;
3 t u p l e Node{
4 i n t Machine ;
5 i n t Job ;
6 }
7 tuple SolidArc {
8 i n t Job ;
9 i n t PreMachine ;
10 i n t SucMachine ;
11 }
12 t u p l e BrokenArc {
13 i n t Machine ;
14 i n t PreJob ;
15 i n t SucJob ;
16 }
17 r a n g e JobRange = 1 . . numJob ;
18 r a n g e MachineRange = 1 . . numMachine ;
19

20 s e t o f ( Node ) NodeSet = . . . ;
21 s e t o f ( SolidArc ) SolidArcSet = . . . ;
22 s e t o f ( BrokenArc ) BrokenArcSet = . . . ;
23 f l o a t BigM=10000;

Chapter 5: Job Shop Scheduling Page 5


Ho Chi Minh City International University Scheduling
Industrial Systems Engineering Department Lecturer: Phan Nguyen Ky Phuc

24 f l o a t ProTime [ NodeSet ] = . . . ;
25 dvar f l o a t+ y [ NodeSet ] ;
26 dvar b o o l e a n x [ BrokenArcSet ] ;
27 dvar f l o a t+ Cmax ;
28

29 e x e c u t e PRE_PROCESSING{
30 c p l e x . epgap = 0 . 0 1 ;
31 c p l e x . t i l i m =60∗60;
32 }
33 m i n i m i z e Cmax ;
34 s u b j e c t to {
35 f o r a l l (< j , p , s> i n S o l i d A r c S e t ) {
36 y[< s , j >] >=y[<p , j >]+ProTime[<p , j > ] ;
37 }
38 f o r a l l (<m, j > i n NodeSet ) {
39 Cmax>=y[<m, j >]+ProTime[<m, j > ] ;
40 }
41 f o r a l l (<m, p , s> i n BrokenArcSet ) {
42 y[<m, s >]>=y[<m, p>]+ProTime[<m, p>]−BigM∗(1−x[<m, p , s >]) ;
43 x[<m, p , s >]+x[<m, s , p>]==1;
44 }
45 }
46 e x e c u t e WRITE{
47 v a r o f i l e =new I l o O p l O u t p u t F i l e ( " R e s u l t . t x t " ) ;
48 o f i l e . w r i t e l n ( "The o b j e c t i v e f u n c t i o n v a l u e : " , c p l e x . getObjValue ( ) ) ;
49 f o r ( v a r Node i n NodeSet ) {
50 o f i l e . w r i t e l n ( " Machine [ " , Node . Machine , " ] w i l l s t a r t Job [ " , Node . Job , " ] a t : " , y [ Node ] ) ;
51 o f i l e . w r i t e l n ( " P r o c e s s Time [ " , Node . Machine , Node . Job , " ] : " , ProTime [ Node ] ) ;
52 }
53 o f i l e . w r i t e l n ( "−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−" ) ;
54 o f i l e . close () ;
55 }

File *.dat
1 S h e e t C o n n e c t i o n MyData ( " JobShopTupleData . x l s x " ) ;
2 numJob from SheetRead ( MyData , " S c a l a r ! B1" ) ;
3 numMachine from SheetRead ( MyData , " S c a l a r ! B2" ) ;
4 NodeSet from SheetRead ( MyData , "Node ! A2 : B11" ) ;
5 S o l i d A r c S e t from SheetRead ( MyData , " S o l i d A r c ! A2 : C8" ) ;
6 BrokenArcSet from SheetRead ( MyData , " BrokenArc ! A2 : C17" ) ;
7 ProTime from SheetRead ( MyData , "Node ! C2 : C11" ) ;

3.3 Job Shops and the Shifting Bottleneck Heuristic

One of the most successful procedures for minimizing the makespan in a job shop is the Shifting Bottleneck
heuristic.
In the following overview of the Shifting Bottleneck heuristic M denotes the set of all m machines. In the
heuristic algorithm it is assumed that in previous iterations a selection of disjunctive arcs (broken arcs) has
been fixed for a subset M0 of machines. So for each one of the machines in M0 a sequence of operations has
already been determined.

3.4 Example of Shifting Bottle Neck

Consider the following example with 4 machines and 3 jobs. The route, i.e., the machine sequence, as well
as the processing times are presented in the Table 1 below.

Chapter 5: Job Shop Scheduling Page 6


Ho Chi Minh City International University Scheduling
Industrial Systems Engineering Department Lecturer: Phan Nguyen Ky Phuc

Algorithm 1 Shifting Bottleneck Heuristic


Input:
Given processing time parameters pij
Job sequence
Process:
1: Step 0: Initial Condition
2: Set M0 = ∅
3: Graph G is the graph with all the solid arcs and no broken arcs.
4: Set Cmax (M0 ) equal to the longest path in graph G.
5:
6: Step 1: Analysis of machines still to be scheduled
7: Do for each machine i, i 6∈ M0 the following: formulate a single machine problem with all operations
subject to release dates and due dates
8: The release date of operation (i, j) is determined by the longest path in graph G from the source to
node (i, j)
9: The due date of operation (i, j) can be computed by considering the longest path in graph G from node
(i, j) to the sink and subtracting pij
10: Minimize the Lmax in each one of these single machine subproblems.
11: Let Lmax (i) denote the minimum Lmax in the subproblem corresponding to machine i.
12:
13: Step 2: Bottleneck selection and sequencing)
14: Let Lmax (h) = max (Lmax (i))
i∈M −M0
15: Sequence machine h according to the sequence generated for it in Step 1.
16: Insert all the corresponding broken arcs in graph G.
17: Insert machine h in M0
18:
19: Step 3:Resequencing of all machines scheduled earlier
20: Do for each machine i, ∈ M0 − h the following:
21: Delete the corresponding broken arcs from G; formulate a single machine subproblem for machine i
with release dates and due dates of the operations determined by longest path calculations in G.
22: Find the sequence that minimizes Lmax (i) and insert the corresponding disjunctive arcs in graph G.
23:
24: Step 4:Stopping criterion
25: If M0 = M then STOP, otherwise go to Step 1.

Chapter 5: Job Shop Scheduling Page 7


Ho Chi Minh City International University Scheduling
Industrial Systems Engineering Department Lecturer: Phan Nguyen Ky Phuc

Table 3: Parameters of Example

Job Sequence Processing Time


1 1,2,3 p11 = 10, p21 = 8, p31 = 4
2 2,1,4,3 p22 = 8, p12 = 3, p42 = 5, p32 = 6
3 1,2,4 p13 = 4, p23 = 7, p43 = 3

3.4.1 Iteration 1

The graph with only solid arcs are contructed. In this graph Cmax = 22

Figure 2: Shifting Bottleneck Iteration 1

Remind

• The release date of operation (i, j) is determined by the longest path in graph G from the source to
node (i, j)

• The due date of operation (i, j) can be computed by considering the longest path in graph G from
node (i, j) to the sink and subtracting pij

Table 4: Release Date and Due Date of Operations in Iteration 1

Job (1,1) (2,1) (3,1) (2,2) (1,2) (4,2) (3,2) (1,3) (2,3) (4,3)
Processing time 10 8 4 8 3 5 6 4 7 3
Release Date 0 10 18 0 8 11 16 0 4 11
Due Date 10 18 22 8 11 16 22 12 19 22
Slack Time 0 0 0 0 0 0 0 8 8 8

Table 5: Data for Each Single Machine in Iteration 1

(a) Machine 1 (b) Machine 2 (c) Machine 3 (d) Machine 4

Job 1 2 3 Job 1 2 3 Job 1 2 Job 2 3


p1j 10 3 4 p2j 8 8 7 p3j 4 6 p4j 5 3
r1j 0 8 0 r2j 10 0 4 r3j 18 16 r4j 11 11
d1j 10 11 12 d2j 18 8 19 d3j 22 22 d4j 16 22

For each machine, the Earliest Release Day First rule is applied:

• For machine 1, the sequence is (1, 1) → (1, 3) → (1, 2), Lmax (1) = 6

• For machine 2, the sequence is (2, 2) → (2, 3) → (2, 1), Lmax (2) = 5

• For machine 3, the sequence is (3, 2) → (3, 1), Lmax (3) = 4

Chapter 5: Job Shop Scheduling Page 8


Ho Chi Minh City International University Scheduling
Industrial Systems Engineering Department Lecturer: Phan Nguyen Ky Phuc

• For machine 4, the sequence is (4, 2) → (4, 3), Lmax (4) = 0

Either machine 1 or machine 2 can be considered as bottle neck. Breaking the tie arbitrarily, machine 1 is
selected to be included in M0 .

3.4.2 Iteration 2

Figure 3: Shifting Bottleneck Iteration 2

The makespan is given by:


U → (1, 1) → (1, 3) → (1, 2) → (4, 2) → (3, 2) → V
The makespan is Cmax = 28

Table 6: Release Date and Due Date for Iteration 2

Job (1,1) (2,1) (3,1) (2,2) (1,2) (4,2) (3,2) (1,3) (2,3) (4,3)
Processing time 10 8 4 8 3 5 6 4 7 3
Release Date 0 10 18 0 14 17 22 10 14 21
Due Date 10 24 28 14 17 22 28 14 25 28
Slack Time 0 6 6 6 0 0 0 0 4 4

Table 7: Data for Each Single Machine in Iteration 2

(a) Machine 1 (b) Machine 2 (c) Machine 3 (d) Machine 4

Job 1 2 3 Job 1 2 3 Job 1 2 Job 2 3


p1j 10 3 4 p2j 8 8 7 p3j 4 6 p4j 5 3
r1j 0 14 10 r2j 10 0 14 r3j 18 22 r4j 17 21
d1j 10 17 14 d2j 24 14 25 d3j 28 28 d4j 22 28

For each machine, the Earliest Release Day First rule is applied:

• For machine 2, the sequence is (2, 2) → (2, 1) → (2, 3), Lmax (2) = 0

• For machine 3, the sequence is (3, 1) → (3, 2), Lmax (3) = 0

• For machine 4, the sequence is (4, 2) → (4, 3), Lmax (4) = 0

None of the machines constitutes a bottleneck in any way. The final schedule is

3.5 Job Shops and Constraint Programming

• Constraint Programming only tries to find a good solution that is feasible and satisfies all the given
constraints. The constraints may include release dates and due dates for the jobs.

Chapter 5: Job Shop Scheduling Page 9


Ho Chi Minh City International University Scheduling
Industrial Systems Engineering Department Lecturer: Phan Nguyen Ky Phuc

Figure 4: Shifting Bottle Neck Final Schedule

• A algorithm has to produce a sequence for each machine so that the overall schedule has a makespan
¯
is less than or equal to a given deadline d.

• The earliest possible starting time and latest possible completion time for each operation on the machine
are found

• The time windows of two operations on a given machine are compared to check whether they overlap,
then the precedence constraints will be applied
0
• Sij denote the earliest possible starting time of operation (i, j)
0
• Cij denote the earliest possible completion time of operation (i, j)
00
• Sij denote the latest possible starting time of operation (i, j)
00
• Cij denote the latest possible completion time of operation (i, j)
0
• The earliest possible starting time of operation (i, j), i.e., Sij , may be regarded as a local release date
00
of the operation and denoted by rij , whereas the latest possible completion time, i.e., Cij , may be
considered a local due date denoted by dij

Figure 5: Slack Calculation

Chapter 5: Job Shop Scheduling Page 10


Ho Chi Minh City International University Scheduling
Industrial Systems Engineering Department Lecturer: Phan Nguyen Ky Phuc

• The slack between the processing of operations (i, j) and (i, k) on machine i is defined as

00 0
σ(i,j)→(i,k) = Sik − Cij
00 0
= Cik − Sij − pij − pik
= dik − rij − pij − pik

σ(i,k)→(i,j) = dij − rik − pij − pik

• Case 1 If σ(i,j)→(i,k) ≥ 0 and σ(i,k)→(i,j) < 0 then (i, j) → (i, k)

• Case 2 If σ(i,k)→(i,j) ≥ 0 and σ(i,j)→(i,k) < 0 then (i, k) → (i, j)

• Case 3 If σ(i,j)→(i,k) < 0 and σ(i,k)→(i,j) < 0 then there is no schedule that satisfies the precedence
constraints.

• Case 4 If σ(i,j)→(i,k) ≥ 0 and σ(i,k)→(i,j) ≥ 0 then either ordering between the two operations is still
possible.

• If there is more than one pair of operations that satisfy the conditions of Case 4, then a selection
heuristic has to be applied. The pair with the lowest flexibility is selected.
q
φ0 ((i, j), (i, k)) =
 
min σ(i,j)→(i,k) , σ(i,k)→(i,j) × max σ(i,j)→(i,k) , σ(i,k)→(i,j)

• After the pair of operations with the least flexibility φ0 ((i, j)(i, k)) has been selected, the precedence
constraint that retains the most flexibility is imposed, i.e., if

σ(i,j)→(i,k) ≥ σ(i,k)→(i,j)

then operation (i, j) must precede operation(i, k)

• In order to apply the constraint satisfaction procedure to a job shop problem with the makespan
objective, it has to be embedded in the following framework. First, an upper bound du and a lower
bound dl have to be found for the makespan.

3.6 Constraint Satisfaction Procedure

3.7 Example of Constraint Programming

Consider the following example with 4 machines and 3 jobs. The route, i.e., the machine sequence, as well
as the processing times are presented in the Table below. Consider a due date d = 32 when all jobs have to
be completed.

Table 8: Parameters of Example

Job Sequence Processing Time


1 1,2,3 p11 = 10, p21 = 8, p31 = 4
2 2,1,4,3 p22 = 8, p12 = 3, p42 = 5, p32 = 6
3 1,2,4 p13 = 4, p23 = 7, p43 = 3

Chapter 5: Job Shop Scheduling Page 11


Ho Chi Minh City International University Scheduling
Industrial Systems Engineering Department Lecturer: Phan Nguyen Ky Phuc

Algorithm 2 Constraint Satisfaction Procedure


Input:
Given processing time parameters pij
Job sequence
Process:
1: Step 1
2: Compute for each unordered pair of operations the slacks σ(i,j)→(i,k) and σ(i,k)→(i,j)
3:
4: Step 2
5: Check dominance conditions and classify remaining ordering decisions.
6: If any ordering decision is of Case 3, then BACKTRACK.
7: If any ordering decision is either of Case 1 or Case 2 go to Step 3; otherwise go to Step 4.
8:
9: Step 3
10: Insert new precedence constraint and go to Step 1.
11:
12: Step 4
13: If no ordering decision is of Case 4, then solution is found. STOP..
14: Otherwise go to Step 5
15:
16: Step 5
17: Compute φ0 ((i, j)(i, k)) for each pair of operations not yet ordered. Select the pair with the minimum
φ0 ((i, j)(i, k)).
18: If σ(i,j)→(i,k) ≥ σ(i,k)→(i,j) , then operation (i, k) must follow (i, j); otherwise operation (i, j) must follow
operation (i, k).
19: Go to Step 3.

Algorithm 3 Framework for Constraint Programming


Input:
Given processing time parameters pij
Job sequence
Process:
1: Step 1
2: Set d = (du + dl )/2
3: Apply the Constraint Satisfaction Procedure Algorithm
4:
5: Step 2
6: If Cmax < d set du = d
7: If Cmax > d set dl = d
8:
9: Step 4
10: If du − dl > 1 return to Step 1
11: Otherwise STOP

3.7.1 Iteration 1

The graph with only solid arcs is contructed. In this graph set the makespan equal to the due date d = 32

Table 9: Release Date and Due Date in Iteration 1

Job (1,1) (2,1) (3,1) (2,2) (1,2) (4,2) (3,2) (1,3) (2,3) (4,3)
Processing time 10 8 4 8 3 5 6 4 7 3
Release Date 0 10 18 0 8 11 16 0 4 11
Due Date 20 28 32 18 21 26 32 22 29 32

For each machine the slack between 2 operations are computed


From this table following precedence constraints are applied

Chapter 5: Job Shop Scheduling Page 12


Ho Chi Minh City International University Scheduling
Industrial Systems Engineering Department Lecturer: Phan Nguyen Ky Phuc

Figure 6: Constraint Programming Iteration 1

Table 10: Data for Each Single Machine in Iteration 1

(a) Machine 1 (b) Machine 2

σR→C (1, 1) (1, 2) (1, 3) σR→C (2, 1) (2, 2) (2, 3)


(1, 1) 8 8 (2, 1) -8 4
(1, 2) -1 7 (2, 2) 12 14
(1, 3) 6 14 (2, 3) 9 -1
(c) Machine 3 (d) Machine 4

σR→C (3, 1) (3, 2) σR→C (4, 2) (4, 3)


(3, 1) 4 (4, 2) 12
(3, 2) 6 (4, 3) 7

• (1, 1) → (1, 2),

• (2, 2) → (2, 1)

• (2, 2) → (2, 3)

3.7.2 Iteration 2

The updated graph and updated release date and due date are given as Based on the former precedent

Figure 7: Constraints Programming Iteration 2

Table 11: Release Date and Due Date in Iteration 2

Job (1,1) (2,1) (3,1) (2,2) (1,2) (4,2) (3,2) (1,3) (2,3) (4,3)
Processing time 10 8 4 8 3 5 6 4 7 3
Release Date 0 10 18 0 10 13 18 0 8 15
Due Date 18 28 32 18 21 26 32 22 29 32

constraints some computations can be eliminated

Chapter 5: Job Shop Scheduling Page 13


Ho Chi Minh City International University Scheduling
Industrial Systems Engineering Department Lecturer: Phan Nguyen Ky Phuc

Table 12: Data for Each Single Machine in Iteration 2

(a) Machine 1
(b) Machine 2
σR→C (1, 1) (1, 2) (1, 3)
σR→C (2, 1) (2, 3)
(1, 1) 8
(2, 1) 4
(1, 2) 5
(2, 3) 5
(1, 3) 4 14
(c) Machine 3 (d) Machine 4

σR→C (3, 1) (3, 2) σR→C (4, 2) (4, 3)


(3, 1) 4 (4, 2) 11
(3, 2) 4 (4, 3) 3

No further precedence constraints are applied, for each pair σ(i,j)→(i,k) ≥ 0 and σ(i,k)→(i,j) ≥ 0 the
φ0 ((i, j)(i, k)) is computed The pair with least flexibility is (3, 1), (3, 2). Since the slack are such that

Table 13: The calculation of φ0 ((i, j)(i, k)) at Iteration 2


0
pair φ
√ ((i, j)(i, k))
(1, 1)(1, 3) √4 × 8 = 5.65
(1, 2)(1, 3) √5 × 14 = 8.36
(2, 1)(2, 3) √4 × 5 = 4.47
(3, 1)(3, 2) √4 × 4 = 4.00
(4, 2)(4, 3) 3 × 11 = 5.74

σ(3,2)→(3,1) = σ(3,1)→(3,2) = 4

either precedence constraint can be inserted. Assume that (3, 2) → (3, 1) is adopted.

3.7.3 Iteration 3

The updated graph and updated release date and due date are given as

Figure 8: Constraint Programming Iteration 3

Table 14: Release Date and Due Date in Iteration 3

Job (1,1) (2,1) (3,1) (2,2) (1,2) (4,2) (3,2) (1,3) (2,3) (4,3)
Processing time 10 8 4 8 3 5 6 4 7 3
Release Date 0 10 24 0 10 13 18 0 8 15
Due Date 14 28 32 14 17 22 28 22 29 32

Impose the precedence constraints (4, 2) → (4, 3)

Chapter 5: Job Shop Scheduling Page 14


Ho Chi Minh City International University Scheduling
Industrial Systems Engineering Department Lecturer: Phan Nguyen Ky Phuc

Table 15: Data for Each Single Machine in Iteration 3

(a) Machine 1
(b) Machine 2
σR→C (1, 1) (1, 2) (1, 3)
σR→C (2, 1) (2, 3)
(1, 1) 8
(2, 1) 4
(1, 2) 5
(2, 3) 5
(1, 3) 10 3
(c) Machine 4

σR→C (4, 2) (4, 3)


(4, 2) 11
(4, 3) -1

3.7.4 Iteration 4

The updated graph and updated release date and due date are given as

Figure 9: Constraint Programming Iteration 4

Table 16: Release Date and Due Date in Iteration 4

Job (1,1) (2,1) (3,1) (2,2) (1,2) (4,2) (3,2) (1,3) (2,3) (4,3)
Processing time 10 8 4 8 3 5 6 4 7 3
Release Date 0 10 24 0 10 13 18 0 8 18
Due Date 14 28 32 14 17 22 28 22 29 32

Table 17: Data for Each Single Machine in Iteration 4

(a) Machine 1
(b) Machine 2
σR→C (1, 1) (1, 2) (1, 3)
σR→C (2, 1) (2, 3)
(1, 1) 8
(2, 1) 4
(1, 2) 5
(2, 3) 5
(1, 3) 0 10

No further precedence constraints are applied, for each pair σ(i,j)→(i,k) ≥ 0 and σ(i,k)→(i,j) ≥ 0 the
φ0 ((i, j)(i, k)) is computed
The pair with the least flexibility is (1, 1)(1, 3) and the precedence constraint (1, 1) → (1, 3) is inserted.

Table 18: The calculation of φ0 ((i, j)(i, k)) for iteration 4


0
pair φ
√ ((i, j)(i, k))
(1, 1)(1, 3) √0 × 8 = 0
(1, 2)(1, 3) √5 × 10 = 7.07
(2, 1)(2, 3) 4 × 5 = 4.47

Chapter 5: Job Shop Scheduling Page 15


Ho Chi Minh City International University Scheduling
Industrial Systems Engineering Department Lecturer: Phan Nguyen Ky Phuc

3.7.5 Iteration 5

The updated graph and updated release date and due date are given as

Figure 10: Constraint Programming Iteration 5

Table 19: Release Date and Due Date at Iteration 5

Job (1,1) (2,1) (3,1) (2,2) (1,2) (4,2) (3,2) (1,3) (2,3) (4,3)
Processing time 10 8 4 8 3 5 6 4 7 3
Release Date 0 10 24 0 10 13 18 10 14 21
Due Date 14 28 32 14 17 22 28 22 29 32

Table 20: Data for Each Single Machine in Iteration 5

(a) Machine 1 (b) Machine 2

σR→C (1, 2) (1, 3) σR→C (2, 1) (2, 3)


(1, 2) 5 (2, 1) 4
(1, 3) 0 (2, 3) -1

Precedence constraint (2, 1) → (2, 3) is inserted

3.7.6 Iteration 6

The updated graph and updated release date and due date are given as

Figure 11: Constraint Programming Iteration 6

These two operations can be ordered in either way without violating any due dates. A feasible ordering is
(1, 3) → (1, 2)

Chapter 5: Job Shop Scheduling Page 16


Ho Chi Minh City International University Scheduling
Industrial Systems Engineering Department Lecturer: Phan Nguyen Ky Phuc

Table 21: Release Date and Due Date at Iteration 6

Job (1,1) (2,1) (3,1) (2,2) (1,2) (4,2) (3,2) (1,3) (2,3) (4,3)
Processing time 10 8 4 8 3 5 6 4 7 3
Release Date 0 10 24 0 10 13 18 10 18 25
Due Date 14 28 32 14 17 22 28 22 29 32

Table 22: Data for Each Single Machine in Iteration 6

(a) Machine 1

σR→C (1, 2) (1, 3)


(1, 2) 5
(1, 3) 0

Figure 12: Constraint Programming Final Schedule

4 Assigment

Q.1 What does the ATC rule reduce to

(a) when K goes to ∞

(b) when K is very close to zero?

Q.2 Consider an instance with two machines in parallel and the total weighted tardiness as objective to be
minimized. There are 5 jobs.

Table 23: Data of Q.2

jobs 1 2 3 4 5
pj 13 9 13 10 8
dj 6 18 10 11 13
wj 2 4 2 5 4

(a) Apply the ATC heuristic on this instance with the look-ahead parameter K = 1.

(b) Apply the ATC heuristic on this instance with the look-ahead parameter K = 5.

Q.3. Consider 6 machines in parallel and 13 jobs. The processing times of the 13 jobs are tabulated below.

Table 24: Data of Q.3

jobs 1 2 3 4 5 6 7 8 9 10 11 12 13
pj 6 6 6 7 7 8 8 9 9 10 10 11 11

Chapter 5: Job Shop Scheduling Page 17


Ho Chi Minh City International University Scheduling
Industrial Systems Engineering Department Lecturer: Phan Nguyen Ky Phuc

(a) Compute the makespan under LPT.

(b) Find the optimal schedule.

Q.4 Consider the following instance of the job shop problem with no recirculation and the makespan as
objective. Give an integer programming formulation of this instance

Table 25: Data of Q.4

jobs sequence processing time


1 1,2,3 p11 = 9, p21 = 8, p31 = 8
2 1,2,4 p12 = 5, p22 = 6, p42 = 3
3 3,1,2 p33 = 10, p13 = 4, p23 = 9

Q.5 Given the data in Question 5. Apply the Shifting Bottleneck heuristic to the instance of Question 5 .

Table 26: Data of Q.5

jobs sequence processing time


1 1,2,3,4 p11 = 9, p21 = 8, p31 = 4, p41 = 4
2 1,2,4,3 p12 = 5, p22 = 6, p42 = 3, p32 = 6
3 3,1,2,4 p33 = 10, p13 = 4, p23 = 9, p43 = 2

Q.6 Consider the following two machine job shop with 10 jobs. All jobs have to be processed first on machine
1 and then on machine 2. (This implies that the two machine job shop is actually a two machine flow shop).

Table 27: Data of Q.6

jobs 1 2 3 4 5 6 7 8 9 10 11
p1j 3 6 4 3 4 2 7 5 5 6 12
p2j 4 5 5 2 3 3 6 6 4 7 2

(a) Construct now a schedule as follows. The jobs have to go through the second machine in the same
sequence as they go through the first machine. A job whose processing time on machine 1 is shorter
than its processing time on machine 2 must precede each job whose processing time on machine 1 is
longer than its processing time on machine 2. The jobs with a shorter processing time on machine
1 are sequenced in increasing order of their processing times on machine 1. The jobs with a shorter
processing time on machine 2 follow in decreasing order of their processing times on machine 2. (This
rule is usually referred to as Johnson’s Rule.)

(b) Apply the shifting bottleneck heuristic to this instance

Chapter 5: Job Shop Scheduling Page 18

You might also like