You are on page 1of 16

Chapter 4: Project Planning and Scheduling

Phan Nguyen Ky Phuc

April 20, 2019

Contents

1 Introduction 2

2 Mathematical Model 2

2.1 Cplex Code . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3

3 Critical Path Method (CPM) 4

3.1 Example of Algorithm . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5

4 Program Evaluation and Review Technique (PERT) 6

5 Time Cost Trade Offs: Linear Costs 7

5.1 Problem Statement . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7

5.2 Mathematical Models . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7

5.3 Cplex Code . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8

5.4 Heuristic Algorithm . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9

5.5 Example . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9

6 Project Scheduling with Workforce Constraints 11

6.1 Problem Statement . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11

6.2 Mathematical Model . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11

6.3 Example . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12

6.3.1 File(*.xlsx). . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 13

6.3.2 File(*.mod) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 13

6.3.3 File *.dat . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 14

7 Assignment 14

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

1 Introduction

This chapter focuses on the planning and scheduling of jobs that are subject to precedence constraints.
The fact that the jobs are subject to precedence constraints implies that a job can start only when all its
predecessors have been completed.
The objective is to minimize the makespan while adhering to the precedence constraints.
The representation of the precedence constraints as a graph may follow either one of two formats: "job-
on-arc" format and "job-on-node" format.
In the job-on-arc format, the arcs represent the jobs and the nodes represent the milestones or epochs
In the job-on-node format, the nodes represent the jobs, and the connecting arcs represents precedence
relationships between the jobs.
Although in practice the first format is more widely used than the second, the second has a number of
advantages.
A disadvantage of the job-on-arc format is a necessity for so-called dummy jobs that are needed to enforce
precedence constraints that otherwise would not have been enforcable.

Figure 1: Formats of precedence Graphs

Example 1
Consider the problem of setting up a manufacturing facility for a new product. The project consists of eight
jobs. The job descriptions and the time requirements are as follows:

No. Job Description of Job Duration (in week) Immediate Predecessor(s)


1 Design production tooling 4 _
2 Prepare manufacturing drawings 6 _
3 Prepare production facility for new tools and parts 10 _
4 Procure tooling 12 1
5 Manual testing of software 10 2
6 Kit parts 2 3,4,5
7 Orientation of new personnel 4 3,4
8 System testing 2 6,7

2 Mathematical Model

Parameters
pi be the processing time of job i
Bij = 1 if job i is the immediate predecessor of job j, i.e. i is immediately before job j., otherwise; Bij = 0

Chapter 4: Project Planning and Scheduling Page 2


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

Figure 2: Example Precedence Graphs

BigM a very big number


Decision Variables
pi be the processing time of job i
ESi be the earliest starting time of job i
ECi be the earliest completion time of job i
LSi be the latest starting time of job i
LCi be the latest completion time of job i
slai slack of job i Cmax be the makespane of the whole project
Mathematical Model
min Cmax

Constraints
Cmax constraint:
Cmax ≥ ECi , ∀i

Processing time relation:

ECi = ESi + pi , ∀i
LCi = LSi + pi , ∀i

Precedence constraints:

ECi ≤ ESj , ∀Bij = 1


LSi ≤ LSj − pi , ∀Bij = 1

Last job constraint:


LCf inalJob = ECf inalJob

Slack constraint:
slai = LCi − ESi − pi , ∀i

2.1 Cplex Code

1 i n t numJob = . . . ;
2 r a n g e j o b = 1 . . numJob ;
3 i n t B[ job ] [ job ] = . . . ;
4 i n t p [ job ] = . . . ;
5 dvar i n t+ Cmax ;
6 dvar i n t+ ES [ j o b ] ;
7 dvar i n t+ EC [ j o b ] ;
8 dvar i n t+ LS [ j o b ] ;

Chapter 4: Project Planning and Scheduling Page 3


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

9 dvar i n t+ LC [ j o b ] ;
10 dvar i n t+ s l a [ j o b ] ;
11 m i n i m i z e Cmax ;
12 s u b j e c t to {
13 f o r a l l ( i in job ) {
14 Cmax>=EC[ i ] ;
15 }
16 f o r a l l ( i in job ) {
17 EC [ i ]==ES [ i ]+p [ i ] ;
18 LC [ i ]==LS [ i ]+p [ i ] ;
19 }
20 f o r a l l ( i i n job , j i n j o b : B [ i ] [ j ]==1) {
21 ES [ j ]>=EC [ i ] ;
22 LS [ i ]<=LS [ j ]−p [ i ] ;
23 }
24

25 f o r a l l ( i in job ) {
26 s l a [ i ]==LC [ i ]−ES [ i ]−p [ i ]
27 }
28

29 LF [ numJob]==Cmax ;
30 }

In the first round, the CPLEX CODE is run to find the Cmax . Let this value is V .
In the second round, objective function is changed and a constraint is added to find ES, EC, LS, LC and sla
The new objective function
1 maximize sum ( i i n j o b ) s l a [ i ]

The adding constraint


1 Cmax==V

3 Critical Path Method (CPM)

The algorithm that yields a schedule with a minimum makespan is relatively simple and can be described
in words as follows:

• Start at time zero with the processing of all jobs that have no predecessors.

• Every time a job completes its processing, start processing those jobs of which all the predecessors
have been completed.

Let ECj denote the earliest possible completion time of job j


Let ESj denote the earliest possible starting time of job j.
Clearly,ECj = ESj + pj .
Let the set {all k → j} denote all jobs that are predecessors of job j. This implies that if job k is a predecessor
of job j, job k has to be completed before job j can be started. [!ht] Let LCj denote the latest possible
completion time of job j
Let LSj denote the latest possible starting time of job j.
Let the set {j → all k} denote all jobs that are successor of job j.

Chapter 4: Project Planning and Scheduling Page 4


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

Algorithm 1 Forward Procedure


Input:
Given a precedence graph G of job

Process:
1: Step 1
2: Set time t = 0
3: Set ESj = 0 and ECj = pj for each job j has no predecessors
4: Step 2
5: Compute inductively for each job j: ESj = max ECk
all k→j
Compute: ECj = ESj + pj
6:
Step 3
7:
The makespan is Cmax = max (EC1 , EC2 , ...ECn )
8:
STOP

Algorithm 2 Backward Procedure


Input:
Given a precedence graph G of job

Process:
1: Step 1
2: Set time t = Cmax
3: Set LCj = Cmax and LSj = Cmax − pj for each job j has no successors
4: Step 2
5: Compute inductively for each job j: LCj = min LSk
j→all k
Compute: LSj = LCj − pj
6:
Step 3
7:
Verify that min (LS1 , LS2 , ...LSn ) = 0
8:
STOP

3.1 Example of Algorithm

Example 2
Consider 14 jobs. The processing times are given below.

Table 1: Table Example 2

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

Figure 3: Precedence Graph of Example 2

Chapter 4: Project Planning and Scheduling Page 5


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

The corresponding ECj and LCj are given as:

Table 2: The earliest completion time ECj of Example 2

Job 1 2 3 4 5 6 7 8 9 10 11 12 13 14
ECj 5 11 14 23 21 26 33 32 36 42 43 51 50 56

So the critical path is


1 → 3 → 6 → 9 → 11 → 12 → 14

4 Program Evaluation and Review Technique (PERT)

In contrast to the setting in the previous section, the processing times of the n jobs are now random variables.
The mean µj and the variance σj2 of each of these random variables are either known or can be estimated.
Three pieces of data with regard the processing time of each job are given as:

• paj = the optimistic processing time of job j,

• pm
j = the most likely processing time of job j,

• pbj = the pessimistic processing time of job j.

Using these three pieces of data the expected processing time of job j is typically estimated by setting

paj + 4pm b
j + pj
µ̂j =
6

If Jcp denotes the set of jobs on a critical path, then an estimate for the expected makespan is
X
Ê(Cmax ) = µ̂j
j∈Jcp

To obtain some feeling for the distribution of the makespan in the original problem, one proceeds as follows.
Compute an estimate for the variance of the processing time of job j by taking
!2
pbj − paj
σ̂j2 =
6

the variance of the total processing time of all jobs on the critical path can be estimated by taking
X
V̂ (Cmax ) = σ̂j2
j∈Jcp

Table 3: The latest completion time LCj of Example 2

Job 1 2 3 4 5 6 7 8 9 10 11 12 13 14
LCj 5 12 14 24 30 26 34 36 36 43 43 51 51 56

Chapter 4: Project Planning and Scheduling Page 6


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

5 Time Cost Trade Offs: Linear Costs

5.1 Problem Statement

There is a project which includes several activities and precedence constraints


There is an overhead cost associate with the makespane of the project. The overhead cost is calculated as
c0 × Cmax , where c0 is the overhead cost per unit time. This cost can be interpreted as:

• Renting Machine Cost

• Renting Land Cost

• Labor Cost ...

Each activity also has its own cost. By increasing the cost for an activity its processing time can be reduced.
The processing time pj of job j must vary in the range of [pmin
j ; pmax
j ]
At pmin
j the cost is caj , at pmax
j the cost is cbj . Clearly, caj ≥ cbj .
Let αj denote the marginal cost of reducing the processing time of job j by one time unit, i.e.,

caj − cbj cbj − cj


αj = = −
pmax
j − pmin
j pmax
j − pj

So the cost of processing job j in pj time units, where pmin


j ≤ pj ≤ pmax
j is

cbj + αj pmax

j − pj

5.2 Mathematical Models

Index
j index of job j = 1...J
Parameters
c0 overhead cost per unit time
αj marginal cost of reducing the processing time of job j by one time unit,
pmin
j minimum processing time of job j
pmax
j maximum processing time of job j
caj cost of job j at pmax
j
cbj cost of job j at pmin
j
Bij = 1 if job i is the immediate predecessor of job j, i.e. i is immediately before job j., otherwise; Bij = 0
BigM a very big number
Decision Variables
pj be the processing time of job j
ESj be the earliest starting time of job j
ECj be the earliest completion time of job j
LSj be the latest starting time of job j
LCj be the latest completion time of job i
slaj slack of job j
Cmax be the makespane of the whole project
Z the total cost of whole project
Mathematical Model
n
X
cbj + αj pmax

min Z = c0 Cmax + j − pj
j=1

Chapter 4: Project Planning and Scheduling Page 7


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

Cm ax constraint:
Cmax ≥ ECi , ∀i

Processing time relation:

ECi = ESi + pi , ∀i
LCi = LSi + pi , ∀i

Precedence constraints:

ECi ≤ ESj , ∀Bij = 1


LSi ≤ LSj − pi , ∀Bij = 1

Processing time constraints:

pmin
i ≤ pi , ∀i
pi ≤ pmax
i , ∀i

The last job constraint:


LCf inalJob = ECf inalJob

Slack constraint
slai = LCi − ESi − pi ∀i
Pn
In this model since j cbj is constant, this term can be eliminated from the objective function.

5.3 Cplex Code

1 i n t numJob = . . . ;
2 r a n g e j o b = 1 . . numJob ;
3 i n t pre [ job ] [ job ] = . . . ;
4 i n t pmax [ j o b ] = . . . ;
5 i n t pmin [ j o b ] = . . . ;
6 i n t alpha [ job ] = . . . ;
7 i n t c0 = . . . ;
8 dvar i n t+ Cmax ;
9 dvar i n t+ ES [ j o b ] ;
10 dvar i n t+ EC [ j o b ] ;
11 dvar i n t+ LS [ j o b ] ;
12 dvar i n t+ LC [ j o b ] ;
13 dvar i n t+ s l a [ j o b ] ;
14 dvar i n t+ p [ j o b ] ;
15 m i n i m i z e c0 ∗Cmax+sum ( i i n j o b ) a l p h a [ i ] ∗ ( pmax [ i ]−p [ i ] ) ;
16 s u b j e c t to {
17 f o r a l l ( i in job ) {
18 Cmax>=EF [ i ] ;
19 }
20 f o r a l l ( i in job ) {
21 EC [ i ]==EC [ i ]+p [ i ] ;
22 LC [ i ]==LC [ i ]+p [ i ] ;
23 }
24 f o r a l l ( i i n job , j i n j o b : B [ i ] [ j ]==1) {
25 ES [ j ]>=EC [ i ] ;
26 LS [ i ]<=LS [ j ]−p [ i ] ;
27 }
28 f o r a l l ( i in job ) {

Chapter 4: Project Planning and Scheduling Page 8


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

29 pmin [ i ]<=p [ i ];
30 p [ i ]<=pmax [ i ];
31 }
32 f o r a l l ( i in job ) {
33 s l a [ i ]==LC [ i ]−ES [ i ]−p [ i ] ;
34 }
35

36 LC [ numJob]==Cmax ;
37 }

PJ 
In the 1st round, the code is run to find c0 Cmax + j=1 αj pmax
j − pj . Record the values of Cmax and pj
In the 2nd round, set Cmax and pi at the values found in the 1st round. After that change the objective
function as maximize the total slack to find, ES, EC, LS, EC and sla

5.4 Heuristic Algorithm

Algorithm 3 Time/Cost Trade-Off Heuristic


Input:
Given processing time parameters
Precedence constraints
Process:
1: Step 1
2: Set all processing times at their maximum.
3: Determine all critical path(s) with these processing times
4: Construct the subgraph Gcp of the critical paths
5: Step 2
6: Determine all minimum cut sets in the current Gcp .
7: Consider only those minimum cut sets of which all processing times are strictly larger than their mini-
mum.
8: If there is no such set STOP, otherwise go to Step 3.
9: Step 3
10: For each minimum cut set compute the cost of reducing all its processing times by one time unit
11: Take the minimum cut set with the lowest cost.
12: If this lowest cost is less than the overhead cost c0 per unit time go to Step 4, otherwise STOP
13: Step 4
14: Reduce all the processing times in the minimum cut set by one time unit.
15: Determine the new set of critical paths.
16: Revise graph Gcp accordingly and go to Step 2.

5.5 Example

Consider the following graph. The fixed overhead cost per unit time, co is 6. Other parameters are given as:
Step 1

Table 4: The parameter table

Job 1 2 3 4 5 6 7 8 9 10 11 12 13 14
pmax
j 5 6 9 12 7 12 10 6 10 9 7 8 7 5
pmin
j 3 5 7 9 5 9 8 3 7 6 4 5 5 2
caj 20 25 20 15 30 40 35 25 30 20 25 35 20 10
αj 7 2 4 3 4 3 4 4 4 5 2 2 4 8

Find the critical path at their maximum processing times.


The soonest completion and starting times of jobs at their maximum processing time is given by the following

Chapter 4: Project Planning and Scheduling Page 9


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

Figure 4: Trade Off Metaheuristic Example

table.
Backtrack to calculate the latest starting times and their slacks at job maximum processing times

Table 5: The soonest completion and starting times

Job 1 2 3 4 5 6 7 8 9 10 11 12 13 14
pmax
j 5 6 9 12 7 12 10 6 10 9 7 8 7 5
ESj 0 5 5 11 14 14 23 26 26 33 36 43 43 51
ECj 5 11 14 23 21 26 33 32 36 42 43 51 51 56

Job on critical paths have slack time equal to zero.The critical path is 1 → 3 → 6 → 9 → 11 → 12 → 14

Table 6: The latest starting times and their slack

Job 1 2 3 4 5 6 7 8 9 10 11 12 13 14
ESj 0 5 5 11 14 14 23 26 26 33 36 43 43 51
LSj 0 6 5 12 19 14 24 30 26 34 36 43 44 51
Slackj 0 1 0 1 5 0 1 4 0 1 0 0 1 0

So the total project time, i.e., the makespan at the maximum processing times, is equal to 56. So the total
overhead cost over the maximal duration of the project is c0 × 6 = 336
Enumerate all minimal cut sets: {1},{3}, {6},{9},{11},{12},{14}. Among these sets find the best candidate:
11, 12.
Since reduce one processing time of 11 or 12 will incur a cost of 2 but saving a overhead cost of 6. This leads
to a total saving 4.
Assume that the job 11 is adopted and its processing time is reduce from 7 to 6 then the critical path is
updated as
Then there are two critical paths:

Table 7: Calculation when processing time of job 11 reduce from 7 to 6

Job 1 2 3 4 5 6 7 8 9 10 11 12 13 14
pj 5 6 9 12 7 12 10 6 10 9 6 8 7 5
ECj 5 11 14 23 21 26 33 32 36 42 42 50 49 55
ESj 0 5 5 11 14 14 23 26 26 33 36 42 42 50
LSj 0 5 5 11 19 14 23 30 26 33 36 42 43 50
Slackj 0 0 0 0 5 0 0 4 0 0 0 0 1 0

1 → 2 → 4 → 7 → 10 → 12 → 14
1 → 3 → 6 → 9 → 11 → 12 → 14

Chapter 4: Project Planning and Scheduling Page 10


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

Enumerate all minimal cut sets:{1}, {12},{14}, {2, 3},{2, 6}, {2, 9},{2, 11}, {4, 3},{4, 6}, {4, 9},{4, 9}, {4, 11},
{7, 3},{7, 6},{7, 9},{7, 11}, {10, 3},{10, 6},{10, 9},{10, 11}
Among these sets, choose the best candidate {12}. Since the cost for reducing one unit of time in this cut
set only 2. If the cut set for example {2, 6} is chosen, the cost for reducing one unit of time in this cut set
is 2 + 3 = 5
Assume that the processing time of job 12 is reduced by 1
The process will continue until it meets the STOP condition.

Table 8: Calculation when processing time of job 12 is 7 respectively

Job 1 2 3 4 5 6 7 8 9 10 11 12 13 14
pj 5 6 9 12 7 12 10 6 10 9 6 7 7 5
0
ECj 5 11 14 23 21 26 33 32 36 42 42 49 49 54
0
ESj 0 5 5 11 14 14 23 26 26 33 36 42 42 49
00
LSj 0 5 5 11 19 14 23 30 26 33 36 42 42 49
Slackj 0 0 0 0 5 0 0 4 0 0 0 0 0 0

6 Project Scheduling with Workforce Constraints

6.1 Problem Statement

• Each activity requires several kind of operators

• The number of each kind of operators is limited

Figure 5: Processing Time as Integer

6.2 Mathematical Model

Index
j index of jobs j = 1...J
l index of operator types l = 1...L
PI
t index of time t = 0... i=1 pi
Parameters
Bij represent the precedence constraints between job i and j.
Bij = 1 if job i is the immediate predecessor of job j, i.e. i is immediately before job j., otherwise; Bij = 0
pj be the processing time of job i
BigM a very big number
Wlj denote the number of operators type l needs for job j.
Nl denote the number of operators type l
Decision Variables

Chapter 4: Project Planning and Scheduling Page 11


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

Sj be the starting time of job j


Cj be the completion time of job j
Cmax be the completion time of the whole project
Yjt be the binary variable, Yjt = 1 if Sj ≤ t ≤ Sj + pj − 1 ,otherwise Yjt = 0.
Ujt be the binary variable, Ujt = 0 if t ≤ Sj − 1,otherwise, Ujt = 1
Vjt be the binary variable, Vjt = 0 if t ≥ Sj + p,otherwise, Vjt = 1
Mathematical Model
min Cmax

Constraints
Precedence and Processing Time Constraints

Cmax ≥ Ci , ∀i
Ci = Si + pi , ∀i
Ci ≤ Sj , ∀Bij = 1
Sj ≥ 0, ∀j

Constraints for Ujt and Vjt

t ≤ Sj − 1 + BigM × Ujt , ∀j, t


t ≥ Sj − 1 − BigM × (1 − Ujt ), ∀j, t
t ≥ Sj + pj − BigM × Vjt , ∀j, t
t ≤ Sj + pj + BigM × (1 − Vjt ), ∀j, t

Constraints for Yjt

Yjt ≤ Ujt , ∀j, t


Yjt ≤ Vjt , ∀j, t
Yjt ≥ Vjt + Ujt − 1, ∀j, t

Workforce constraints
J
X
Yjt Wlj ≤ Nl ∀t, l
j=1

6.3 Example

Example Consider the following instance with five jobs and two types of operators. There are four of type
1 and eight of type 2. The processing times and workforce requirements, and the immediate Predecessors
are presented in the tables below.
Cplex Code

(a) Processing Time and Operator Parameters


(b) Immediate Predecessors
Job 1 2 3 4 5
pj 8 4 6 4 4 Job Predecessor 1 2 3 4 5
W1j 2 1 3 1 2 Job _ _ _ 1 2,3
W2j 3 0 4 0 3

Chapter 4: Project Planning and Scheduling Page 12


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

6.3.1 File(*.xlsx).

(b) “OneDim” Sheet

(a) “Scalar” Sheet A B C


1 Job Processing Time N
A B
2 1 8 4
1 Number of Job 5
3 2 4 4
2 Number of Operator Type 2
4 3 6
3 Number of Time 26
5 4 4
6 5 4
(d) "Bij” Sheet

(c) "Wlj” Sheet A B C D E F


1 Bij 1 2 3 4 5
A B C D E F
2 1 0 0 0 1 0
1 Wlj 1 2 3 4 5
3 2 0 0 0 0 1
2 1 2 1 3 1 2
4 3 0 0 0 0 1
3 2 3 0 4 0 3
5 4 0 0 0 0 0
6 5 0 0 0 0 0

6.3.2 File(*.mod)

1 i n t numJob = . . . ;
2 i n t numType = . . . ;
3 i n t numTime = . . . ;
4 i n t BigM=10000;
5 r a n g e Job = 1 . . numJob ;
6 r a n g e Time = 1 . . numTime ;
7 r a n g e Type = 1 . . numType ;
8 i n t B [ Job ] [ Job ] = . . . ;
9 i n t W[ Type ] [ Job ] = . . . ;
10 i n t p [ Job ] = . . . ;
11 i n t N[ Type ] = . . . ;
12 dvar i n t+ S [ Job ] ;
13 dvar i n t+ C [ Job ] ;
14 dvar i n t+ Cmax ;
15 dvar b o o l e a n Y[ Time ] [ Job ] ;
16 dvar b o o l e a n U[ Time ] [ Job ] ;
17 dvar b o o l e a n V[ Time ] [ Job ] ;
18 e x e c u t e PRE_PROCESS {
19 // c p l e x . epgap = 0 . 0 5 ;
20 cplex . t i l i m = 1200;
21 }
22 m i n i m i z e (Cmax) ;
23 s u b j e c t to {
24 f o r a l l ( j i n Job ) {
25 Cmax >=C [ j ] ;
26 C [ j ]==S [ j ]+p [ j ] ;
27 }
28 f o r a l l ( i i n Job , j i n Job : B [ i ] [ j ]==1) {
29 S [ j ]>=C [ i ] ;
30 }
31 f o r a l l ( t i n Time , j i n Job ) {
32 t>=S [ j ]+p [ j ]−BigM∗V[ t ] [ j ] ;
33 t<=S [ j ]+p [ j ]+BigM∗(1−V[ t ] [ j ] ) ;
34 }
35 f o r a l l ( t i n Time , j i n Job ) {
36 t<=S [ j ]−1+BigM∗U[ t ] [ j ] ;

Chapter 4: Project Planning and Scheduling Page 13


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

37 t>=S [ j ]−1−BigM∗(1−U[ t ] [ j ] ) ;
38 }
39 f o r a l l ( t i n Time , j i n Job ) {
40 Y[ t ] [ j ]<=U[ t ] [ j ] ;
41 Y[ t ] [ j ]<=V[ t ] [ j ] ;
42 Y[ t ] [ j ]>=U[ t ] [ j ]+V[ t ] [ j ] − 1 ;
43 }
44 f o r a l l ( t i n Time , l i n Type ) {
45 sum ( j i n Job )Y[ t ] [ j ] ∗W[ l ] [ j ]<=N[ l ] ;
46 }
47 }

6.3.3 File *.dat

1 S h e e t C o n n e c t i o n MyData ( " WorkforceExample . x l s x " ) ;


2 numJob from SheetRead ( MyData , " S c a l a r ! B1" ) ;
3 numType from SheetRead ( MyData , " S c a l a r ! B2" ) ;
4 numTime from SheetRead ( MyData , " S c a l a r ! B3" ) ;
5 p from SheetRead ( MyData , "OneDim ! B2 : B6" ) ;
6 N from SheetRead ( MyData , "OneDim ! C2 : C3" ) ;
7 B from SheetRead ( MyData , " B i j ! B2 : F6" ) ;
8 W from SheetRead ( MyData , " Wlj ! B2 : F3" ) ;

7 Assignment

Q1 Consider the setup of the production facility. The durations of the 8 jobs are tabulated below.
(a) Compute the makespan and determine the critical path(s).

Table 11: Data for Question 1

(a) Processing Time (b) Immediate Predecessors

Job 1 2 3 4 5 6 7 8 Job 1 2 3 4 5 6 7 8
Pi 4 6 10 12 10 2 4 2 Predecessor _ _ _ 1 2 3,4,5 3,4 6,7

(b) Suppose that the duration of job 7 can be reduced by 3 weeks to 1 week. Compute the new makespan
and determine the new critical path(s).
Q2. Consider a project with the information are described below.

Table 12: Data for Question 2.a

(a) Processing Time

Job 1 2 3 4 5 6 7 8 9 10 11
pi 8 5 6 3 2 5 2 4 7 4 9
(b) Immediate Predecessors

Job 1 2 3 4 5 6 7 8 9 10 11
Predecessor _ 1 _ _ 3 4 4 5,6 5,6,1 2 7,8,9

(a) Compute the makespan and determine the critical path.


Suppose that each job can be shortened at a certain expense. The overhead cost is 6 per week (in tens of
thousands of dollars). The cost functions are linear. The minimum and maximum processing times as well
as the marginal costs are tabulated below.

(b) Apply Algorithm Time Cost Trade-off heuristic to this instance.


(c) Verify whether the solution obtained in (b) is optimal.

Chapter 4: Project Planning and Scheduling Page 14


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

Table 13: Data for Question 2.b and 2.c

Job 1 2 3 4 5 6 7 8 9 10 11
Pjmax 8 5 6 3 2 5 2 4 7 4 9
Pjmin 5 3 4 2 2 3 2 3 5 3 7
caj 30 25 20 15 30 40 35 25 30 20 30
αj 7 2 2 1 2 3 4 4 4 5 4

Q3 Consider the project as table below. Suppose it is possible to add resources to the various jobs on the
critical paths in order to reduce the makespan. The overhead cost co per unit time is 6. The costs are linear
and the marginal costs are tabulated below.

Table 14: Data for Question 3

(a) Processing Time

Job 1 2 3 4 5 6 7 8 (b) Immediate Predecessors


pmax
j 4 6 10 12 10 2 4 2
Job 1 2 3 4 5 6 7 8
pmin
j 2 5 7 10 8 1 2 1
Predecessor _ _ _ 1 2 3,4,5 3,4 6,7
caj 20 25 20 15 30 40 35 25
αj 4 3 4 2 3 2 4 4

(a) Determine the processing times and the makespan of the solution with the total minimum cost. Is the
solution unique?
(b) Plot the relationship between the total cost of the project and the makespan.
(c) Using CPLEX solve the problem.
Q4. Consider the following PERT version of a given system.
(a) Rank the paths according to the means of their total processing time.

Table 15: Data for Question 4

(a) Immediate Predecessors

Job 1 2 3 4 5 6 7 8 9 10 11
Predecessor _ 1 _ _ 3 4 4 5,6 5,6,1 2 7,8,9
(b) Processing Times

Job 1 2 3 4 5 6 7 8 9 10 11
paj 2 1 5 2 1 4 1 1 6 1 8
pmj 8 5 6 3 2 5 2 4 7 4 9
pbj 14 9 7 4 3 6 3 7 7 10

(b) Rank the paths according to the variance in their total processing times. Which path has the highest
variance? Which path has the lowest variance?
(c) Compute the probability that the makespan is larger than 27 following the standard PERT procedure.
(d) Compute the probability that the makespan is larger than 27 by considering only the path with the
largest variance.
Q5 Formulate the following project scheduling problem with workforce constraints as an integer program
then solve it by CPLEX. Both workforce pools have four operators. The precedence constraints are specified
below.

Chapter 4: Project Planning and Scheduling Page 15


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

Table 16: Data for Question 5

(b) Processing Times


(a) Immediate Predecessors
Job 1 2 3
Job 1 2 3 pj 4 6 2
Predecessor _ _ 2 Wj1 2 3 1
Wj2 4 4 0

Chapter 4: Project Planning and Scheduling Page 16

You might also like