You are on page 1of 18

Chapter 9: Interval Scheduling, Reservations, and

Timetabling

Phan Nguyen Ky Phuc

May 16, 2020

Contents

1 Introduction 2

2 Reservations without Slack 2

3 Reservation with Slack 3

3.1 Mathematical Model . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3

3.2 Heuristic Algorithm . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6

3.3 Example . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7

3.3.1 Iteration 0 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7

3.3.2 Job 7 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9

3.3.3 Job 6 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9

3.3.4 Job 1 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10

3.3.5 Job 4 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10

3.3.6 Job 5 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10

3.4 Multiple Machines . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11

3.5 Job 3 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12

3.6 Job 4 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12

3.7 Job 1 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12

3.8 Job 2 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 13

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

4 Timetabling with Operator or Tooling Constraints 13

4.1 Example . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 13

4.1.1 Algorithm Application . . . . . . . . . . . . . . . . . . . . . . . . . . 14

4.1.2 Step 1 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 15

4.1.3 Step 2 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 15

4.1.4 Step 3 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 15

4.1.5 Step 4 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 16

4.1.6 Final Schedule . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 16

5 Assignment 16

1 Introduction

This chapter considers two types of timetabling problems.

• The first type of timetabling problem assumes that all operators are identical.The total
number of operators available is W and in order to do activity j on one of the resources
Wj operators have to be present. If the sum of the people required by activities j and
k is larger than W (i.e., Wj + Wk > W ), then activities j and k may not overlap in
time.

• In the second type of timetabling problem each operator has its own identity and is
unique. Each activity now requires a specific subset of the operators and/or tools. In
order for an activity to be scheduled all the operators or tools in its subset have to be
available. Two activities that need the same operator can therefore not be processed
at the same time. Scheduling activities in an environment with resources in parallel
may require at times a reservation system.Each activity (i.e., reservation) is supposed
to occupy one of the resources for a given time period. Activity j, j = 1, ..., n, has a
duration pj and has to fit within a time window that is specified by an earliest starting
time rj and a latest termination time dj . There may or may not be any slack

2 Reservations without Slack

In this section we consider the following reservation model. There are m resources in parallel
and n activities. Annotation

• j: index of job, j = 1...J

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

• s: index of resource, s = 1...S

• t: index of time, t = 1..T

Parameters

• bj : beginning time of job j

• fj : finishing time of job j

• wjs : weigh time of job j

• Ejs : Ejs = 1 if job j require resource s to finish, otherwise Ejs = 0

• Oij : if job i and jobj are time overlap then Oij = 1 otherwise Oij = 0

Decision Variables

• xjs : binary variable, if job j is assigned during the planning horizon Xj = 1 otherwise
Xj = 0

Mathematical Models
J X
X S
max wjs xjs
j=1 s=1

Constraints
S
X
xjs ≤ 1 ∀j
s=1

xjs ≤ Ejs ∀j, s


xjs Ejs + xis Eis ≤ 2 − Oij , ∀i, j, s

3 Reservation with Slack

3.1 Mathematical Model

In this section we consider the following reservation model. There are m resources in parallel
and n activities.
Annotation

• j: index of job, j = 1...J

• s: index of resource, s = 1...S

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

• t: index of time, t = 1..T

Parameters

• rj : release date of job j

• dj : due date of job j

• pj : processing time of job j

• wj : weigh time of job j

• Ejs : Ejs = 1 if job j require resource s to finish, otherwise Ejs = 0

• BigM : very big number

Decision Variables

• xj : binary variable, if job is assigned during the planning horizon xj = 1 otherwise


xj = 0

• bj : beginning time of job j

• fj : finishing time of job j

Following auxiliary variables will be used to consider the overlap constraint:

• ujt be the binary variable ujt = 1 if bj ≤ t otherwise ujt = 0

• vjt be the binary variable vjt = 1 if fj ≥ t otherwise vjt = 0

• αjt be the binary variable αjt = 1 if ujt = 1 and vjt = 1

Mathematical Models
J
X
max w j xj
j=1

Constraints
Time window constraints

ri ≤ bi + BigM (1 − xi ) ∀i
di ≥ fi − BigM (1 − xi ) ∀i
fi ≥ bi + pi − 1 − BigM (1 − xi ) ∀i
fi ≤ bi + pi − 1 + BigM (1 − xi ) ∀i

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

uit = 1 if t ≥ bi otherwise uit = 0

t ≥ bi − 1 − BigM × (1 − uit ) − BigM × (1 − xi ), ∀i, t


t ≤ bi − 1 + BigM × uit + BigM × (1 − xi ), ∀i, t

vit = 1 if t ≤ fi otherwise vit = 0

t ≤ fi + 1 + BigM × (1 − vit ) + BigM × (1 − xi ), ∀i, t


t ≥ fi + 1 − BigM × vit − BigM × (1 − xi ), ∀i, t

If uit = 1 and vit = 1, then αit = 1 otherwise αit = 0

αit ≤ uit , ∀i, t


αit ≤ vit , ∀i, t
αit ≥ uit + vit − 1, ∀i, t
αit ≤ xi ∀i, t

Resource constraints
I
X
αit Eis ≤ 1 ∀t, s
i=1

1 /∗∗∗∗∗∗∗∗∗∗∗∗∗∗∗∗∗∗∗∗∗∗∗∗∗∗∗∗∗∗∗∗∗∗∗∗∗∗∗∗∗∗∗∗∗
2 ∗ OPL 1 2 . 9 . 0 . 0 Model
3 ∗ Author : kyphuc
4 ∗ C r e a t i o n Date : May 1 3 , 2020 a t 1 0 : 2 1 : 1 0 AM
5 ∗∗∗∗∗∗∗∗∗∗∗∗∗∗∗∗∗∗∗∗∗∗∗∗∗∗∗∗∗∗∗∗∗∗∗∗∗∗∗∗∗∗∗∗∗/
6 i n t numJob=7;
7 i n t numRes=3;
8 i n t numTime=22;
9 r a n g e Job = 1 . . numJob ;
10 r a n g e Res = 1 . . numRes ;
11 r a n g e Time = 0 . . numTime ;
12 f l o a t w [ Job ] = [ 2 , 3 , 3 , 2 , 1 , 2 , 3 ] ;
13 f l o a t p [ Job ] = [ 3 , 1 0 , 9 , 4 , 6 , 5 , 3 ] ;
14 f l o a t r [ Job ] = [ 5 , 0 , 2 , 3 , 2 , 4 , 5 ] ;
15 f l o a t d [ Job ] = [ 1 2 , 1 0 , 2 0 , 1 5 , 1 8 , 1 9 , 1 4 ] ;
16 f l o a t E [ Job ] [ Res ] = [ [ 1 , 0 , 1 ] , [ 1 , 1 , 0 ] , [ 1 , 1 , 1 ] , [ 0 , 1 , 1 ] , [ 1 , 0 , 0 ] , [ 1 , 0 , 0 ] , [ 1 , 1 , 0 ] ] ;
17 f l o a t BigM=10000;
18 dvar i n t+ b [ Job ] ;
19 dvar i n t+ f [ Job ] ;
20 dvar b o o l e a n x [ Job ] ;
21 dvar b o o l e a n u [ Job ] [ Time ] ;
22 dvar b o o l e a n v [ Job ] [ Time ] ;
23 dvar b o o l e a n a [ Job ] [ Time ] ;

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

24 execute Setting {
25 c p l e x . t i l i m =5∗60;
26 }
27 maximize
28 sum ( j i n Job )w [ j ] ∗ x [ j ] ;
29 s u b j e c t to {
30 f o r a l l ( j i n Job ) {
31 r [ j ]<=b [ j ]+BigM∗(1−x [ j ] ) ;
32 d [ j ]>= f [ j ]−BigM∗(1−x [ j ] ) ;
33 f [ j ]>=b [ j ]+p [ j ]−1−BigM∗(1−x [ j ] ) ;
34 f [ j ]<=b [ j ]+p [ j ]−1+BigM∗(1−x [ j ] ) ;
35 }
36 f o r a l l ( i i n Job , t i n Time ) {
37 t>=b [ i ]−1−BigM∗(1−u [ i ] [ t ] )−BigM∗(1−x [ i ] ) ;
38 t<=b [ i ]−1+BigM∗u [ i ] [ t ]+BigM∗(1−x [ i ] ) ;
39 t<=f [ i ]+1+BigM∗(1−v [ i ] [ t ] )+BigM∗(1−x [ i ] ) ;
40 t>=f [ i ]+1−BigM∗v [ i ] [ t ]−BigM∗(1−x [ i ] ) ;
41 a [ i ] [ t]<=u [ i ] [ t ] ;
42 a [ i ] [ t]<=v [ i ] [ t ] ;
43 a [ i ] [ t]>=u [ i ] [ t ]+v [ i ] [ t ] −1;
44 a [ i ] [ t]<=x [ i ] ;
45 }
46 f o r a l l ( t i n Time , s i n Res ) {
47 sum ( i i n Job ) a [ i ] [ t ] ∗ E [ i ] [ s ] <=1;
48 }
49 }
50 e x e c u t e WRITE_RESULT{
51 var 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 " ) ;
52 o f i l e . w r i t e l n ( c p l e x . getObjValue ( ) ) ; / / Get t h e v a l u e o f t h e o b j e c t i v e
function
53 f o r ( j i n Job ) {
54 i f ( x [ j ]==1) {
55 o f i l e . w r i t e l n ( "Job−−" , j , "−− i s s e l e c t e d , b : " , b [ j ] , "−−f : " , f [ j ] , "−−p : " , p [ j ] , "
−−r : " , r [ j ] , "−−d : " , d [ j ] ) ;
56 }
57 }
58 o f i l e . w r i t e l n ( "−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−" ) ;
59 o f i l e . close () ;
60 }

3.2 Heuristic Algorithm

• Let νit denote the number of activities that may be assigned to resource i during in-
terval [t − 1, t].

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

• This factor thus corresponds to a potential utilization of resource i in time slot t. The
higher this number is, the more flexible resource i is in this time slot.

• A second factor is the number of resources to which activity j can be assigned, i.e., the
number of resources in set Mj , which is denoted by | Mj |. The larger this number,
the more flexible activity j is.

• Define for activity j a priority index Ij that is a function of wj /pj and | Mj |, i.e.,
Ij = f (wj /pj , | Mj |)

• The activities can now be ordered in increasing order of their indices, i.e.,

I1 ≤ I2 ≤ ... ≤ In

• If the activity needs a resource over the period [t, t + pj ], then the selection of resource
i depends on a function of the factors νi,t+1 , ..., νi,t+pj i.e., g(νi,t+1 , ..., νi,t+pj ). For
example,
pj
!
X
g(νi,t+1 , ..., νi,t+pj ) = νi,t+l /pj
l=1

g(νi,t+1 , ..., νi,t+pj ) = max νi,t+1 , ..., νi,t+pj

Algorithm 1 Maximizing Weighted Number of Activities


Input:
Given job parameters pj , wj , rj , dj , Mj
Process:
1: Step 1
2: Set j=1
3:
4: Step 2
5: Take activity j and select, among the resources and time slots available, the resource
and time slots with the lowest g(νi,t+1 , ..., νi,t+pj ) rank. Discard activity j if it cannot be
assigned to any machine at any time.
6:
7: Step 3
8: If j = n ST OP , otherwise set j = j + 1 and return to Step 2.

3.3 Example

3.3.1 Iteration 0

The index function is given by


| Mj |
Ij =
(wj /pj )

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

Activities 1 2 3 4 5 6 7
pj 3 10 9 4 6 5 3
wj 2 3 3 2 1 2 3
rj 5 0 2 3 2 4 5
dj 12 10 20 15 18 19 14
Mj {1,3} {1,2} {1,2,3} {2,3} {1} {1} {1,2}

The indices for the activities are given by


The potential usage of for resource 1,2 and 3 are given through

Table 1: The activity indices Ii

Activities 1 2 3 4 5 6 7
Ij 3 6.67 9 4 6 2.5 2

Table 2: Potential Usage of Resource 1

Time 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19
Job 1 0 0 0 0 0 1 1 1 1 1 1 1 0 0 0 0 0 0 0 0
Job 2 1 1 1 1 1 1 1 1 1 1 0 0 0 0 0 0 0 0 0 0
Job 3 0 0 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1
Job 4 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
Job 5 0 0 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 0 0
Job 6 0 0 0 0 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 0
Job 7 0 0 0 0 0 1 1 1 1 1 1 1 1 1 0 0 0 0 0 0
Resource 1 1 1 3 3 4 6 6 6 6 6 5 5 4 4 3 3 3 3 2 1

Table 3: Potential Usage of Resource 2

Time 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19
Job 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
Job 2 1 1 1 1 1 1 1 1 1 1 0 0 0 0 0 0 0 0 0 0
Job 3 0 0 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1
Job 4 0 0 0 1 1 1 1 1 1 1 1 1 1 1 1 0 0 0 0 0
Job 5 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
Job 6 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
Job 7 0 0 0 0 0 1 1 1 1 1 1 1 1 1 0 0 0 0 0 0
Resource 2 1 1 2 3 3 4 4 4 4 4 3 3 3 3 2 1 1 1 1 1

Now assume that the job is assigned to the slot according to



g(νi,t+1 , ..., νi,t+pj ) = max νi,t+1 , ..., νi,t+pj

According to the index Ij calculated above, the job 7 is scheduled first.

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

Table 4: Potential Usage of Resource 3

Time 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19
Job 1 0 0 0 0 0 1 1 1 1 1 1 1 0 0 0 0 0 0 0 0
Job 2 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
Job 3 0 0 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1
Job 4 0 0 0 1 1 1 1 1 1 1 1 1 1 1 1 0 0 0 0 0
Job 5 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
Job 6 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
Job 7 0 0 0 0 0 0 0 0 0 0 0 0 0 1 0 0 0 0 0 0
Resource 3 0 0 1 2 2 3 3 3 3 3 3 3 2 2 2 1 1 1 1 1

Table 5: Summary of Potential Usage of 3 Resources

Time 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19
Resource 1 1 1 3 3 4 6 6 6 6 6 5 5 4 4 3 3 3 3 2 1
Resource 2 1 1 2 3 3 4 4 4 4 4 3 3 3 3 2 1 1 1 1 1
Resource 3 0 0 1 2 2 3 3 3 3 3 3 3 2 2 2 1 1 1 1 1

3.3.2 Job 7

Since the p7 = 3 the value of g7,5 = (ν7,5 + ν7,6 + ν7,7 ) /3

Table 6: Calculate g for job 7

Time 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19
Res 1 1 1 3 3 4 6 6 6 6 6 5 5 4 4 3 3 3 3 2 1
Res 2 1 1 2 3 3 4 4 4 4 4 3 3 3 3 2 1 1 1 1 1
Res 3 0 0 1 2 2 3 3 3 3 3 3 3 2 2 2 1 1 1 1 1
J7, g1,t 0 0 0 0 0 6 6 6 5.7 5.3 4.7 4.3 0 0 0 0 0 0 0 0
J7, g2,t 0 0 0 0 0 4 4 4 3.7 3.3 3.0 3.0 0 0 0 0 0 0 0 0

Job 7 is scheduled from 11 → 14


Update the Resource Usage and order job 6

3.3.3 Job 6

Table 7: Calculate g for job 6

Time 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19
Res 1 1 1 3 3 4 5 5 5 5 5 4 3 3 3 3 2 1
Res 2 1 1 2 3 3 3 3 3 3 3 2 2 1 1 1 1 1
Res 3 0 0 1 2 2 3 3 3 3 3 3 3 2 2 2 1 1 1 1 1
J6, g1,t 0 0 0 0 4.8 5 4.8 2.8

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

Job 6 is scheduled from 14 → 19


Update the Resource Usage and order job 1

3.3.4 Job 1

Table 8: Calculate g for job 1

Time 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19
Res 1 1 1 3 3 4 4 4 4 4 4 3 1
Res 2 1 1 2 3 3 3 3 3 3 3 2 2 1 1 1 1 1
Res 3 0 0 1 2 2 3 3 3 3 3 3 3 2 2 2 1 1 1 1 1
J1, g1,t 4 4 4 3.7
J1, g3,t 3 3 3 3

Job 1 is scheduled from 8 → 10


Update the Resource Usage and order job 4

3.3.5 Job 4

Table 9: Calculate g for job 4

Time 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19
Res 1 1 1 3 3 3 3 3 3 1
Res 2 1 1 2 3 3 3 3 3 3 3 2 2 1 1 1 1 1
Res 3 0 0 1 2 2 2 2 2 3 2 2 2 1 1 1 1 1
J4, g2,t 3 3
J4, g3,t 2 2

Job 4 is scheduled from 3 → 6


Update the Resource Usage and order job 5

3.3.6 Job 5

Table 10: Calculate g for job 5

Time 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19
Res 1 1 1 3 3 3 3 3 3 1
Res 2 1 1 2 2 2 2 1 1 1 1 1 1 1
Res 3 0 0 1 1 2 1 1 1 1 1 1 1 1
J5, g1,t 3

Job 5 is scheduled from 2 → 7


Update the Resource Usage

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

Table 11: The resource usage after job 5 is assigned

Time 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19
Res 1 1 1 1
Res 2 1 1 2 2 2 2 1 1 1 1 1 1 1
Res 3 0 0 1 1 2 1 1 1 1 1 1 1 1

It is impossible to schedule the rest job. We stop here

3.4 Multiple Machines

The algorithm above can be extended to the case where number of each time of machine is
greater than 1
The number of machine type 1 and 2 are 2

Table 12: The data of example 2

Job 1 2 3 4
wj 3 2 2 1
pj 2 3 1 1
rj 0 2 1 2
dj 5 7 6 6
Machine 1 2 0 1 1
Machine 2 1 2 0 1

Calculate the index priority of each job


P 
K mjk
k=1 Nk × pj
Ij =
wj

where:
mjk : be the number of resource type k which is required by job j
Nk : be the maximum number of resource type k

(2/2 + 1/2) 2
I1 =
3

Table 13: The priority index

Job 1 2 3 4
Ij 1 1.5 0.25 1

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

Table 14: Summary of usage resource

Time 0 1 2 3 4 5 6
M1 2 3 4 4 4 2 0
M2 1 1 4 4 4 3 2
RemainM1 2 2 2 2 2 2 2
RemainM2 2 2 2 2 2 2 2

3.5 Job 3

Table 15: Summary of usage resource of Job 3

Time 0 1 2 3 4 5 6
M1 2 3 4 4 4 2 0
M2 1 1 4 4 4 3 2
Remain M1 2 2 2 2 2 2 2
Remain M2 2 2 2 2 2 2 2
J3,M1 usage 1.5 2 2 2 1

Job 3 is assigned to time slot 5

3.6 Job 4

Then resource is updated


Assume that job 4 is selected next

Table 16: Summary of usage resource of Job 4

Time 0 1 2 3 4 5 6
M1 2 2 3 3 3 1 0
M2 1 1 4 4 4 3 2
RemainM1 2 2 2 2 2 1 2
RemainM2 2 2 2 2 2 2 2
J4, M1 usage 1.5 1.5 1.5 1
J4, M2 usage 2 2 2 2
Total 3.5 3.5 3.5 2.5

Job 4 is assigned to slot 5.

3.7 Job 1

Job 1 is assigned to slot 0

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

Table 17: Summary of usage resource of Job 1

Time 0 1 2 3 4 5 6
M1 2 2 2 2 2 0 0
M2 1 1 3 3 3 2 2
Remain M1 2 2 2 2 2 0 2
Remain M2 2 2 2 2 2 1 2
J1, M1 usage 2 2 2 2
J1, M2 usage 0.5 0.5 1.5 1.5
Total 2.5 2.5 3.5 3.5

Table 18: Summary of usage resource of Job 2

Time 0 1 2 3 4 5 6
M1 0 0 0 0 0 0 0
M2 0 2 2 2 2 2 2
RemainM1 0 0 2 2 2 0 2
RemainM2 1 1 2 2 2 1 2
J2, M2 Usage 2
Total 2

3.8 Job 2

Job 2 is assigned to slot 2

4 Timetabling with Operator or Tooling Constraints

• The degree of a node is the number of arcs connected to a node;

• The saturation level of a node in a partially colored graph, is the number of


differently colored nodes already connected to it. In the coloring process, the first
color to be used is labeled Color 1, the second Color 2, and so on.

4.1 Example

Gary, Hamilton, Izak and Reha are university professors attending a national conference.
During this conference seven one hour meetings have to be scheduled in such a way that
each one of the four professors can be present at all the meetings he has to attend. The goal
is to schedule all seven meetings in a single afternoon between 2 p.m. and 6 p.m.

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

Algorithm 2 Graph Coloring Heuristic


Input:
Given job parameters pj , wj , rj , dj , Mj
Process:
1: Step 1
2: Arrange the nodes in decreasing order of their degree.
3:
4: Step 2
5: Color a node of maximal degree with Color 1.
6:
7: Step 3
8: Choose an uncolored node with maximal saturation level.
9: If there is a tie, choose any one of the nodes with maximal degree in the uncolored
subgraph.
10:
11: Step 4
12: Color the selected node with the color with the lowest possible number.
13:
14: Step 5
15: If all nodes are colored, STOP. Otherwise go to Step 3..

Activities 1 2 3 4 5 6 7
Gary, 1 0 0 1 1 0 1
Hamilton 1 1 1 0 0 0 0
Izak 0 0 1 0 1 1 0
Reha 1 0 1 1 1 0 0

4.1.1 Algorithm Application

In this table, if activity i and j have the common resource, then there is an arc between
node i and node j
The degree of each node is

Figure 1: Example of Graph Coloring Algorithm

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

Table 19: Node Degree

Node 1 2 3 4 5 6 7
Degree 5 2 5 4 5 2 3

4.1.2 Step 1

Among node 1, 3, and 5 choose an arbitrarily node. For example, node 1 is selected.
Coloring node 1 with Color 1, then update the staturation and degree of other node

Table 20: Node Degree and Saturation

Node 1 (Color 1) 2 3 4 5 6 7
Saturation _ 1 1 1 1 0 1
Degree _ 1 4 3 4 2 2

4.1.3 Step 2

Among node 3, and 5 choose an arbitrarily node. Node 3 is selected.


Coloring node 3 with Color 2, then update the staturation and degree of other node

Table 21: Node Degree and Saturation

Node 1 (Color 1) 2 3 (Color 2) 4 5 6 7


Saturation _ 2 _ 2 2 1 1
Degree _ 0 _ 2 3 1 2

4.1.4 Step 3

Node 5 is selected.
Coloring node 5 with Color 3, then update the staturation and degree of other node

Table 22: Node Degree and Saturation

Node 1 (Color 1) 2 3 (Color 2) 4 5 (Color 3) 6 7


Saturation _ 2 _ 3 _ 2 2
Degree _ 0 _ 1 _ 0 1

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

4.1.5 Step 4

Node 4 is selected.
Coloring node 4 with Color 4

Table 23: Node Degree and Saturation

Node 1 (Color 1) 2 3 (Color 2) 4 (Color 4) 5 (Color 3) 6 7


Saturation _ 2 _ _ _ 2 3
Degree _ 0 _ _ _ 0 0

4.1.6 Final Schedule

Step 1 : Job 1 and 6 are scheduled at the same time. Time slot 1
Step 2 : Job 3 and 7 are scheduled at the same time. Time slot 2
Step 1 : Job 5 and 2 are scheduled at the same time. Time slot 3
Step 1 : Job 4 is scheduled at time slot 4

5 Assignment

Q1 Consider the following reservation problem with 10 activities and zero slack. There are
three identical resources in parallel.
(a) Find the schedule that maximizes the total amount of processing (i.e., the sum of the

Table 24: Data given

Job 1 2 3 4 5 6 7 8 9 10
pj 6 1 4 2 3 3 6 2 1 3
rj 2 7 5 2 1 0 4 8 0 0
dj 8 8 9 4 4 3 10 10 1 3

durations of the activities done) using CPLEX)


(b) What is the minimum number of resources needed to satisfy the total demand? Write
down the mathematical model for this problem and solve using CPLEX

Q2 Consider the following instance with eight activities and three resources.
(a) Find the schedule that maximizes the total weight using CPLEX)
(b)Select appropriate index functions Ij and g(νi,t+1 , ..., νi,t+pj ) and apply proper Algorithm.

Q3 Consider a hotel with two types of rooms: suites and regular rooms. There are n1 suites
and n2 regular rooms. If someone wants a suite, then the hotel makes a profit of w1 dollars
per night. If someone wants a regular room, the hotel makes a profit of w2 dollars per night

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

Table 25: Data given

Job 1 2 3 4 5 6 7 8
pj 4 3 10 9 4 6 5 3
wj 3 2 3 3 2 1 2 3
rj 8 5 0 2 3 2 4 5
dj 12 12 10 20 15 18 19 14
Mj {2} {1,3} {1,2} {1,2,3} {2,3} {1} {1} {1,2}

(w2 < w1 ). If a person wants a regular room and all regular rooms are taken, then the hotel
can put that person up in a suite. However, the hotel makes then only w2 dollars per night.
Assume that the hotel cannot ask the guest to change rooms in the middle of his stay; once
assigned to a room or suite the guest will stay there until he leaves (i.e., preemptions are
not allowed). Given n1 = 1, n2 = 3 and w1 = 3, w2 = 2. The following data is given
(a) Develop the mathematical model and solve using CPLEX)

Table 26: Data given

Guest 1 2 3 4 5 6 7 8 9
pj 4 3 10 9 4 6 5 3 4
type 1 1 2 2 2 2 2 2 2
rj 8 5 0 2 3 2 4 5 7
dj 12 12 10 15 15 15 13 14 13

Q4 Consider the following timetabling problem with tool sets.


(a) Can the tool sets be numbered in such a way that all the tools needed by each job are

Table 27: Data given

Job 1 2 3 4 5
pj 1 1 1 1 1
T ool1 1 0 0 1 0
T ool2 0 1 1 0 0
T ool3 1 1 0 1 1
T ool4 0 1 1 1 1

adjacent?
(b) Develop an algorithm for verifying whether the tool sets can be numbered in that way.
Q5 Consider the following timetabling problem with two types of personnel. The total
number of personnel of type 1 is W1 = 3 and the total number of personnel of type 2 is
W2 = 4. (a) Determine first which type of personnel is the most critical (the tightest).
(b) Use the information under (a) to develop a heuristic for this problem with two types of
personnel

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

Table 28: Data given

Job 1 2 3 4 5 6 7
pj 1 1 1 1 1 1 1
W1j 2 0 1 2 1 2 1
W2j 2 4 0 2 3 1 2

Chapter 09 Page 18

You might also like