Chapter09 V2
Chapter09 V2
Timetabling
Contents
1.2 Example . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3
1.2.1 Iteration 0 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3
1.2.2 Job 7 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4
1.2.3 Job 6 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5
1.2.4 Job 1 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5
1.2.5 Job 4 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5
1.2.6 Job 5 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6
1.4 Job 3 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7
1.5 Job 4 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8
1.6 Job 1 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8
1.7 Job 2 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8
2.1 Example . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9
2.1.2 Step 1 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10
1
Ho Chi Minh City International University Scheduling
Industrial Systems Engineering Department Lecturer: Phan Nguyen Ky Phuc
2.1.3 Step 2 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10
2.1.4 Step 3 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11
2.1.5 Step 4 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11
3 Assignment 13
• Let νit denote the number of activities that may be assigned to resource i during in-
terval [t − 1, t].
• 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
Chapter 09 Page 2
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}
1.2 Example
1.2.1 Iteration 0
Activities 1 2 3 4 5 6 7
Ij 3 6.67 9 4 6 2.5 2
Chapter 09 Page 3
Ho Chi Minh City International University Scheduling
Industrial Systems Engineering Department Lecturer: Phan Nguyen Ky Phuc
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
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
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
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
1.2.2 Job 7
Chapter 09 Page 4
Ho Chi Minh City International University Scheduling
Industrial Systems Engineering Department Lecturer: Phan Nguyen Ky Phuc
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
1.2.3 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
1.2.4 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
1.2.5 Job 4
Chapter 09 Page 5
Ho Chi Minh City International University Scheduling
Industrial Systems Engineering Department Lecturer: Phan Nguyen Ky Phuc
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 0 0 0 0 0 0 0 0
J4, g3,t 2 2
1.2.6 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
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
6 @author : kyphuc
7 """
8
9 import f u n c t o o l s
10 import i t e r t o o l s
11 import numpy a s np
12 import copy
Chapter 09 Page 6
Ho Chi Minh City International University Scheduling
Industrial Systems Engineering Department Lecturer: Phan Nguyen Ky Phuc
13 c l a s s Job :
14 d e f __init__ ( s e l f , ∗ a r g s , ∗ ∗ kwargs ) :
15 s e l f . j o b I d=kwargs [ ’ j o b I d ’ ]
16 s e l f . pro=kwargs [ ’ pro ’ ]
17 s e l f . w e i g h t=kwargs [ ’ w e i g h t ’ ]
18 s e l f . r e l e a s e=kwargs [ ’ r e l e a s e ’ ]
19 s e l f . duedate=kwargs [ ’ duedate ’ ]
20 s e l f . machine=kwargs [ ’ machine ’ ]
21 s e l f . p r i o r i t y=sum ( s e l f . machine ) ∗ s e l f . pro / s e l f . w e i g h t
22 s e l f . i s S c h e d u l e d=F a l s e
23 s e l f . i s P r o c e s s e d=F a l s e
24 s e l f . b e g i n n i n g=None
25
26
27 d e f __str__( s e l f ) :
28 r e t u r n f " Job ID : { s e l f . j o b I d}−−b e g i n n i n g : { s e l f . b e g i n n i n g}−−i s P r o c e s s e d
: { s e l f . i s P r o c e s s e d }"
29
30
46 c u r _ s c h e d u l e=np . z e r o s ( (NUM_MACHINE,END+1) )
47 r e t u r n cur_res , c u r _ s c h e d u l e
48
53 j o b _ f e a s i b l e=F a l s e
54 j o b _ l o s s =10000
55 job_from=None
56
Chapter 09 Page 7
Ho Chi Minh City International University Scheduling
Industrial Systems Engineering Department Lecturer: Phan Nguyen Ky Phuc
60 i f f e a s i b l e F l g and j o b _ l o s s >=l o s s :
61 job_from=t
62 j o b _ f e a s i b l e=True
63 j o b _ l o s s=l o s s
64
85 cur_res =[]
86 f o r m i n r a n g e (NUM_MACHINE) :
87 resMat=np . z e r o s ( (NUM_JOB+1,NUM_DAY) )
88 f o r j i n r a n g e (NUM_JOB) :
89 c j o b=j o b L i s t [ j ]
90 i f not c j o b . i s S c h e d u l e d and c j o b . machine [m]==1:
91 resMat [ j ] [ c j o b . r e l e a s e : c j o b . duedate ]=1
92 resMat [NUM_JOB] [ : ] = np . sum ( resMat [ 0 :NUM_JOB ] [ : ] , a x i s =0)
93 c u r _ r e s . append ( resMat )
94 r e t u r n cur_schedule , c u r _ r e s
95
Chapter 09 Page 8
Ho Chi Minh City International University Scheduling
Industrial Systems Engineering Department Lecturer: Phan Nguyen Ky Phuc
106
116 i f __name__=="__main__" :
117 j o b 1=Job ( j o b I d =1, pro =3, w e i g h t =2, r e l e a s e =5, duedate =12 , machine = [ 1 , 0 , 1 ] )
118 j o b 2=Job ( j o b I d =2, pro =10 , w e i g h t =3, r e l e a s e =0, duedate =10 , machine = [ 1 , 1 , 0 ] )
119 j o b 3=Job ( j o b I d =3, pro =9, w e i g h t =3, r e l e a s e =2, duedate =20 , machine = [ 1 , 1 , 1 ] )
120 j o b 4=Job ( j o b I d =4, pro =4, w e i g h t =2, r e l e a s e =3, duedate =15 , machine = [ 0 , 1 , 1 ] )
121 j o b 5=Job ( j o b I d =5, pro =6, w e i g h t =1, r e l e a s e =2, duedate =18 , machine = [ 1 , 0 , 0 ] )
122 j o b 6=Job ( j o b I d =6, pro =5, w e i g h t =2, r e l e a s e =4, duedate =19 , machine = [ 1 , 0 , 0 ] )
123 j o b 7=Job ( j o b I d =7, pro =3, w e i g h t =3, r e l e a s e =5, duedate =14 , machine = [ 1 , 1 , 0 ] )
124 j o b _ l i s t =[ job1 , job2 , job3 , job4 , job5 , job6 , j o b 7 ]
125
130 f o r m i n r a n g e (NUM_MACHINE) :
131 p r i n t ( f " P o t e n t i a l r e s o u r c e u s a g e o f machine {m} : " )
132 p r i n t ( c u r _ r e s [m] )
133 p r i n t ( ’−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−− ’ )
134 unschedule_num=l e n ( j o b _ l i s t )
135
152 f o r job in j o b _ l i s t :
Chapter 09 Page 9
Ho Chi Minh City International University Scheduling
Industrial Systems Engineering Department Lecturer: Phan Nguyen Ky Phuc
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
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
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
Job 1 2 3 4
Ij 1 1.5 0.25 1
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
Chapter 09 Page 10
Ho Chi Minh City International University Scheduling
Industrial Systems Engineering Department Lecturer: Phan Nguyen Ky Phuc
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
1.5 Job 3
1.6 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
1.7 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
Chapter 09 Page 11
Ho Chi Minh City International University Scheduling
Industrial Systems Engineering Department Lecturer: Phan Nguyen Ky Phuc
1.8 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
Chapter 09 Page 12
Ho Chi Minh City International University Scheduling
Industrial Systems Engineering Department Lecturer: Phan Nguyen Ky Phuc
2.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.
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
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
Node 1 2 3 4 5 6 7
Degree 5 2 5 4 5 2 3
Chapter 09 Page 13
Ho Chi Minh City International University Scheduling
Industrial Systems Engineering Department Lecturer: Phan Nguyen Ky Phuc
2.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
Node 1 (Color 1) 2 3 4 5 6 7
Saturation _ 1 1 1 1 0 1
Degree _ 1 4 3 4 2 2
2.1.3 Step 2
2.1.4 Step 3
Node 5 is selected.
Coloring node 5 with Color 3, then update the staturation and degree of other node
2.1.5 Step 4
Node 4 is selected.
Coloring node 4 with Color 4
Chapter 09 Page 14
Ho Chi Minh City International University Scheduling
Industrial Systems Engineering Department Lecturer: Phan Nguyen Ky Phuc
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
1 #! / u s r / b i n / env python3
2 # −∗− c o d i n g : u t f −8 −∗−
3 """
4 Created on F r i Dec 15 0 9 : 4 2 : 3 2 2023
5
6 @author : kyphuc
7 """
8
9 import f u n c t o o l s
10 import i t e r t o o l s
11 import copy
12 c l a s s Job :
13 d e f __init__ ( s e l f , ∗ a r g s , ∗ ∗ kwargs ) :
14 s e l f . j o b I d=kwargs [ ’ j o b I d ’ ]
15 s e l f . r e s o u r c e=kwargs [ ’ r e s ’ ]
16 s e l f . d e g r e e=None
17 s e l f . c o l o r=" "
18
19
20 d e f __str__( s e l f ) :
21 r e t u r n f " Job ID : { s e l f . j o b I d}−− c o l o r : { s e l f . c o l o r } "
22
Chapter 09 Page 15
Ho Chi Minh City International University Scheduling
Industrial Systems Engineering Department Lecturer: Phan Nguyen Ky Phuc
34 confVec [ j ]=1
35 else :
36 confVec [ j ]=0
37 c o n f M a t r i x . append ( confVec )
38 # c a l c u l a t e the degree
39 f o r i i n r a n g e ( numJob ) :
40 j o b L i s t [ i ] . d e g r e e=sum ( c o n f M a t r i x [ i ] )
41 # return the degree
42
43 d e g L i s t =[ j o b . d e g r e e f o r j o b i n j o b L i s t ]
44 return degList , confMatrix
45
58 f o r i i n r a n g e ( numJob ) :
59 j o b L i s t [ i ] . d e g r e e=sum ( updateMatrix [ i ] )
60
61 d e g L i s t =[ j o b . d e g r e e f o r j o b i n j o b L i s t ]
62 p r i n t ( f ’ Degree L i s t : \n{ d e g L i s t } ’ )
63 #p r i n t ( f ’ Update Matr : \n{ updateMatrix } ’ )
64 r e t u r n d e g L i s t , updateMatrix
65
66 i f __name__=="__main__" :
67 j o b 0=Job ( j o b I d =0, r e s = [ 1 , 1 , 0 , 1 ] )
68 j o b 1=Job ( j o b I d =1, r e s = [ 0 , 1 , 0 , 0 ] )
69 j o b 2=Job ( j o b I d =2, r e s = [ 0 , 1 , 1 , 1 ] )
70 j o b 3=Job ( j o b I d =3, r e s = [ 1 , 0 , 0 , 1 ] )
71 j o b 4=Job ( j o b I d =4, r e s = [ 1 , 0 , 1 , 1 ] )
72 j o b 5=Job ( j o b I d =5, r e s = [ 0 , 0 , 1 , 0 ] )
73 j o b 6=Job ( j o b I d =6, r e s = [ 1 , 0 , 0 , 0 ] )
74 j o b L i s t =[ job0 , job1 , job2 , job3 , job4 , job5 , j o b 6 ]
75 d e g L i s t , c o n f M a t r i x=f i n d C o n f l i c t M a t r i x ( j o b L i s t )
76 p r i n t ( f ’ C o n f l i c t matrix : \n{ c o n f M a t r i x } ’ )
77 p r i n t ( f ’ Degree l i s t \n{ d e g L i s t } ’ )
78 colorNum=1
79 d e g L i s t , updateMat=c o lo r G r a ph ( con fMat rix , j o b L i s t , d e g L i s t , colorNum )
80
81 w h i l e sum ( d e g L i s t ) >0:
Chapter 09 Page 16
Ho Chi Minh City International University Scheduling
Industrial Systems Engineering Department Lecturer: Phan Nguyen Ky Phuc
82 colorNum+=1
83 d e g L i s t , updateMat=c ol o r G r a ph ( updateMat , j o b L i s t , d e g L i s t , colorNum )
3 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
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
Q2 Consider the following instance with eight activities and three resources.
(a) Find the schedule that maximizes the total weight using CPLEX)
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}
(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
(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)
Chapter 09 Page 17
Ho Chi Minh City International University Scheduling
Industrial Systems Engineering Department Lecturer: Phan Nguyen Ky Phuc
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
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).
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
(b) Use the information under (a) to develop a heuristic for this problem with two types of
personnel
Chapter 09 Page 18