Solving the High School Scheduling Problem Modelled with Constraints Satisfaction
using Hybrid Heuristic Algorithms
541
6.
(1)
1
(1)
0()
1()
G
iDNl j
i
iDNl j
if r
if r
τ
τ
τχ
τχ
−⋅⋅+
=
−⋅⋅+
≠
⎧
⎨
=
⎩
∑
≤ M
χ
(χ
j
) for j = 1, 2, …, C and l = 1, 2, 3, …, D·N
At any point in time l, room χ
j
can have at most M
χ
(χ
j
) groups as defined by the set Χ
M
in the input entered data.
As it was described in the previously published material (Chorbev et al., 2007, Jolevski
et al., 2005b) the constraints classes implemented in the Constraint Solving Library
(CSL) were created to be universal and applicable to different problems. Therefore, in
this constraint the class CSetCover (generic constraint) was used. The set of values to be
covered was Χ
M
. In the constraint-variable network, practically the model of the
problem, there were D·N copies of this constraint. There was a copy for each time slot
(lesson) in the work week. However, every copy is in fact the same instance of the
generic CSetCover constraint, since the set of values to be covered was always Χ
M
. In
every different copy, the classroom coordinate of the variables for different groups for
that lesson was taken in consideration.
7. b
τ
(τ
i
) ∈ Α ∧ i ≠ l
ν
(ν
k
) ∧ (b
τ
(τ
i
)≠b
τ
(τ
i-1
) ∨ i = f
ν
(ν
k
))⇒ b
τ
(τ
i+1
) = b
τ
(τ
i
) for i = 0, 1, …, G·D·N-1,
and k = i div N.
If subject b
τ
(τ
i
) must be taught in blocks of 2 lessons, and τ
i
is not the last lesson in the
day k, and subject b
τ
(τ
i
) is different from the previous subject b
τ
(τ
i-1
) or τ
i
is the first
lesson in a day, then the next lesson needs to be for the same subject b
τ
(τ
i+1
).
8. b
τ
(τ
i
) ≠ b
τ
(τ
j
) for k = 0, 1, …, G-1 and l = 0, 1, …, D-2, where i = l
ν
(ν
n
) and j = f
ν
(ν
n+1
), n =
k·D+l. n is the index of the variable ν
n
that defines the index i for the last lesson τ
i
in day
l for group γ
k
.
Subject b
τ
(τ
i
) for the last lesson in a day except for the last day in the week (usually Friday)
and subject b
τ
(τ
j
) for the first lesson in the previous day for any group must be different.
9. b
τ
(τ
i+f
) ≠ b
τ
(τ
i+f+1
) ≠ … ≠ b
τ
(τ
i+l
) for all b
τ
(τ) ∉ Α, for k = 0, 1, …, G-1 and l = 0, 1, …, D-1, i
= k·D·N +l·N, where n = k·D+l, f = f
ν
(ν
n
), l = l
ν
(ν
n
). n is the index of the variable ν
n
that
defines the indices for the first and last lessons τ
i+l
and τ
i+l
in day l for group γ
k
.
Subjects for all lessons τ
i+f
to τ
i+l
in a day l must be different for all subjects that can not
be taught in blocks of two lessons b
τ
(τ) ∉ Α.
10. a
α
(p
τ
(τ
i
), j, m
λ
(λ
l
), k) = 1 for l = 0, 1, …, G-1; j = 0, 1, 2, …, D-1; k = 0, 1, 2, …, N-1; where i
= l·D·N +j·N+k.
For all groups (l = 0, 1, …, G-1), all days (j = 0, 1, …, G·D-1), and all lessons (k = 0, 1, 2,
…, N-1), the teacher p
τ
(τ
i
) must be available for the lesson τ
i
.
11. B
α
(b
τ
(τ
i·N+j
), j) = 1 for i = 0, 1, …, G·D-1; j = 1, 2, …, N.
For all groups and all days (i = 0, 1, …, G·D-1), the subject b
τ
(τ
i·N+j
) taught at any lesson (j
= 1, 2, …, N) must be allowed by the set ΒΑ.
12. e
β
(b
τ
(τ
f·D·N +j·N+k
))= e
β
(b
τ
(τ
(f+1)·D·N +j·N+k
))=…= e
β
(b
τ
(τ
l·D·N +j·N+k
)) for i = 0, 1, …, Y-1; j = 0, 1, …,
D-1; k = 0, 1, 2, …, N-1; where f=f
ψ
(ψ
i
) and l=l
ψ
(ψ
i
).
For all school years (i = 0, 1, …, Y-1) and all days (j = 0, 1, …, D-1), and all lessons in a
day (k = 0, 1, 2, …, N-1), the elective/non-elective property of the subject is equal for all
groups.
13. y
γ
(γ
i
) = y
γ
(γ
j
) ⇒ s
λ
(γ
i
) = s
λ
(γ
i
) for i = 0, 1, …, G-1; j = 0, 1, …, G-1; i ≠ j
If two groups γ
i
and γ
j
are in the same school year y
γ
(γ
i
) = y
γ
(γ
j
), then they are in the same
shift s
λ
(γ
i
) = s
λ
(γ
i
).