Computers & Industrial Engineering: Rosmalina Hanafi, Erhan Kozan

You might also like

Download as pdf or txt
Download as pdf or txt
You are on page 1of 9

Computers & Industrial Engineering 70 (2014) 1119

Contents lists available at ScienceDirect

Computers & Industrial Engineering


journal homepage: www.elsevier.com/locate/caie

A hybrid constructive heuristic and simulated annealing for railway


crew scheduling q
Rosmalina Hana, Erhan Kozan
Decision Science Discipline, Mathematical Sciences School, Science and Engineering Faculty, Queensland University of Technology, 2 George Street, GPO Box 2434, Brisbane,
Qld 4001, Australia

a r t i c l e i n f o a b s t r a c t

Article history: Railway crew scheduling problem is the process of allocating train services to the crew duties based on
Received 12 May 2013 the published train timetable while satisfying operational and contractual requirements. The problem is
Accepted 6 January 2014 restricted by many constraints and it belongs to the class of NP-hard. In this paper, we develop a
Available online 16 January 2014
mathematical model for railway crew scheduling with the aim of minimising the number of crew duties
by reducing idle transition times. Duties are generated by arranging scheduled trips over a set of duties
Keywords: and sequentially ordering the set of trips within each of duties. The optimisation model includes the time
Railway crew scheduling
period of relief opportunities within which a train crew can be relieved at any relief point. Existing mod-
Mathematical programming
Constructive heuristics
els and algorithms usually only consider relieving a crew at the beginning of the interval of relief oppor-
Simulated annealing tunities which may be impractical. This model involves a large number of decision variables and
Combinatorial optimisation constraints, and therefore a hybrid constructive heuristic with the simulated annealing search algorithm
is applied to yield an optimal or near-optimal schedule. The performance of the proposed algorithms is
evaluated by applying computational experiments on randomly generated test instances. The results
show that the proposed approaches obtain near-optimal solutions in a reasonable computational time
for large-sized problems.
 2014 Elsevier Ltd. All rights reserved.

1. Introduction Models and algorithms are designed mainly for a specic case
and may not readily be applied in different applications.
The crew scheduling problem (CSP) in the transportation indus- Railway CSP aims at nding a minimum cost crew schedule. The
try represents a computationally difcult combinatorial optimisa- schedule should cover scheduled trips in a train timetable subject
tion problem. The large number of tasks (trips) to include and to various constraints. Morgado and Martins (1992) presented
the complicated operational and contractual requirements are early work on the crew scheduling application for the Portuguese
the main reason for the complexity of the problem. Nevertheless, railways. The system provides a possibility of generating alterna-
the CSP has been one of the most important focuses of the trans- tive schedules using different scheduling criteria and enables eval-
portation industry because it affects the companys protability uation of the cost of the solution considering a set of produced
and its service quality. An optimal crew schedule is essential to en- statistics. CSP is more frequently formulated mathematically, as
sure efcient and reliable operations of transportation services. either set covering problem or set partitioning problem, and then
Furthermore, the cyclic nature of the crew scheduling application solved by exact solution approaches and heuristics (see for exam-
makes the CSP a good candidate for optimisation. A small improve- ple in Caprara et al. (1997), Kroon and Fischetti (2001), and Freling
ment to the crew schedules can lead to accumulated savings to et al. (2004)). In both the set covering and the set partitioning for-
produce large annual cost savings. The difculty of solving CSP mulations, the decision variable is a binary integer variable that
yet its enormous practical signicance, have led to a large number represents whether or not a duty (roundtrip, pairing) is selected
of proposed solution techniques. However, unlike the airline CSP as work for a crew member. The constraint in the set covering
which has been intensively studied, the railway crew scheduling problem consists of a matrix of binary values, which denes that
is less cited in literature (Goumopoulos and Housos, 2004). each piece of work is covered by a duty at least once. Each column
Railway crew scheduling is domain specic and there has been represents one possible pairing or work to be performed by an
no developed solving method has yet to be applied universally. individual crew member over a dened period of time. The set par-
titioning problem is similar to the set covering problem, except
q that in the set partitioning formulation the constraint becomes
This manuscript was processed by Area Editor T.C. Edwin Cheng.
Corresponding author. Tel.: +61 7 3138 1029; fax: +61 7 3138 2310. equal to one, meaning that each task is covered exactly once. Aleri
E-mail address: e.kozan@qut.edu.au (E. Kozan). et al. (2007) proposed a set covering problem based on an implicit

0360-8352/$ - see front matter  2014 Elsevier Ltd. All rights reserved.
http://dx.doi.org/10.1016/j.cie.2014.01.002
12 R. Hana, E. Kozan / Computers & Industrial Engineering 70 (2014) 1119

column generation solution approach for scheduling train drivers procedures and higher level strategies to facilitate the algorithm
on a railway sub-network. Feasible duties are constructed from a for both escaping local optima and exhaustively searching a feasi-
set of trips to be serviced by a number of train drivers, with the ble region. Elizondo et al. (2010) proposed a constructive hybrid
aim of minimising the number of duties and maximising the approach to address operation management problems that emerge
robustness of the schedule. A heuristic procedure is applied to ob- in underground passenger transport. The results are compared
tain an initial feasible solution together with a heuristic branch- with two alternative methods based on tabu search and a greedy
and-price algorithm based on a dynamic programming algorithm heuristic. The tabu search technique provides better results with
for the pricing-out of columns. The main difculty in applying regard to idle time than both the hybrid and the greedy methods.
the exact methods to the CSP is that in determining all possible Dias et al. (2002) proposed a genetic algorithm for bus driver
solutions. For the CSP with a large number of trips, there can be scheduling, which is developed by using a new coding scheme
an unmanageably large number of possible roundtrips. As a conse- and considering a complex objective function.
quence, the problem becomes a time-consuming process of enu- Simulated annealing (SA)-based algorithms have been noticed
merating all the possible roundtrips. Bangert (2012) noted that to produce good solutions to several combinatorial optimisation
the method of enumeration is not realistic when the number of op- problems. Emden-Weinert and Proksch (1999) solved an airline
tions is too large and cannot be practically listed. CSP using a SA approach. The results show that the SA yields good
Generally, CSP involves a large number of decision variables and quality solutions but requires longer processing times than simpler
it is restricted by many constraints. Fischetti et al. (1987, 1989) heuristics. Lucic and Teodorovic (1999) applied a SA approach to
have shown that the bus crew scheduling belongs to the class of solve a multi-objective crew scheduling for an airline. In spite of
NP-hard problems. For this reason, there is a requirement of the potential application of SA algorithms to solve combinatorial
large-scale solution techniques such as column generation. The optimisation problems, there has been few crew scheduling related
concept of column generation is to solve a sequence of reduced applications in the literature using the SA algorithm.
problems (master problem) in which each reduced problem con- This paper presents a new mathematical model and a hybrid
tains a small fraction of the set of variables (columns). The sub- constructive SA (HCSA) algorithm to solve railway CSP. The math-
problem or an auxiliary problem is commonly formulated as a ematical programming model incorporates commonly encoun-
restricted shortest path problem. The restricted shortest path tered real-life railway crew scheduling constraints, particularly
problem however, is difcult to solve and it also needs other opti- the integration of the interval of relief opportunities. To the best
misation schemes such as dynamic programming algorithms or of our knowledge, the inclusion of the interval of relief opportuni-
branch-and-bound methods. Bengtsson et al. (2007) formulated a ties into models and algorithms has not been studied in depth. The
general crew pairing problem with the objective function being rest of this paper is organised as follows. In Section 2, a brief
to minimise the cost of selected pairing and the cost of violating description of the problem is presented. In Section 3, solution tech-
soft constraints. The research combines resource constraints, k- niques that include formulation of the mathematical programming
shortest path enumeration, and label merging techniques and model and the details of the proposed HCSA algorithm are given.
shows that a column generation approach is able to heuristically Results of the computational experiments on each approach are
solve large and highly complex railway pairing problems in a provided in Section 4. Finally, Section 5 provides the conclusion
reasonable time. Given the size and complexity of the railway and recommendations for further study.
operation, the researchers indicate the necessity of combined
optimisation techniques. Nishi et al. (2011) proposed a column
generation with dual inequality for railway crew scheduling. Com- 2. Problem description
putational results have shown that the proposed technique can
accelerate the convergence of conventional column generation The railway crew scheduling we are dealing with consists of a
for a large data set application. Yan and Tu (2002), however, stated set of crew home depots (HDs), a set of relief points (RPs), a set
that column generation based methods could be inefcient be- of scheduled train trips with xed starting and ending times at
cause when the crew scheduling is formulated as a traditional each location. The problem is to construct crew duties based on
set covering problem, the obtained optimal solutions could be the train timetable while satisfying operational and contractual
non-integer solutions. Other techniques should then be incorpo- requirements. The crew in this context is the train crew which con-
rated to rene the non-integer solutions. sists of a train driver and a conductor, and they are considered as a
De Leone et al. (2011) proposed a mathematical model to solve team.
a CSP. Since their proposed model can only handle small- to med- The rail network involves interconnected segments of train
ium-sized problems, a greedy randomised adaptive search proce- tracks where trains travel along specied train lines from one
dure has then been offered to solve large instances. Network station to a subsequent station. Each segment of train journeys
ow approach has also been used in several researches on CSP. consists of a sequence of trips that must be serviced. Fig. 1 illus-
An attempt towards this approach was proposed by Vaidyanathan trates an example of a train timetable. The route of trains can be
et al. (2007). They describe a network ow-based approach to solve traced by straightening the travelling path of trains in the train
a CSP arising in North American railroads. The CSP is formulated as timetable. Each trip in the timetable must be serviced by a train.
an integer program on a spacetime network enforcing the rst-in- The railway CSP is to specify the sequence of trips to be performed
rst-out requirement by including side constraints with the objec- by the crew. A train journey begins and ends at a crew HD, and can
tive of minimising several components of crew expenses. Due to be feasibly serviced by a single crew.
the difculty of applying the network ow approach to highly A train service is the overall journey accomplished by a vehicle
complex constraints, this method may be suitable only for small- from the time it begins at its rst station until it arrives at its last
to moderately-sized real-world problems. station. A vehicle block species the sequence of trips made by a
Metaheuristics have become a popular approach in tackling the train during a service workday. It contains pieces of segments in
complexity of practical optimisation problems. Although metaheu- which crew relief may be performed at both ends of each segment.
ristics cannot guarantee optimality of their solutions, they have Each crew belongs to one crew base (HD) and the crew has to start
shown a very good performance in solving real-world optimisation (sign-on) and end (sign-off) his/her duty (daily work shift) at the
problems. Metaheuristics represent a general type of solution same crew depot (HD). The spread time is the time elapsed be-
method that illustrates the interaction between local improvement tween the crew sign-on and the crew sign-off in a duty. A train
R. Hana, E. Kozan / Computers & Industrial Engineering 70 (2014) 1119 13

Distance / to the start of the MB, whereas the 2nd part of a duty is the period
Station no. from the end of the MB to the end of the duty. Transition time (idle
interval) between two consecutive trips in each partial duty is the
Station n /
time incurred between the departure time of the next trip and the
Depot B arrival time of the previous trip.
The railway transportation industry imposes a complex set of
operational and contractual requirements correspond to the work
Station n-1
regulations for the crew. For safety reasons, for example, there is
a restriction on the length of continuous driving time. A crew will
Station 2 be required to take a break when the total continuous driving time
on the same vehicle has reached a maximum limit. In the forma-
tion of duties, crew schedule should satisfy several constraints
Station 1 /
Depot A corresponding to work load regulations. There are predetermined
Time
maximum and minimum durations of a duty. A minimum of
0.5 h for a MB is required in a duty (shift). A crew takes a break
Fig. 1. An example of a train timetable. only at a RP and the changeover of trains is at the same RP.

crew duty contains a meal break (MB) which begins after the com- 3. Solution approaches
pletion of the third hour and nishes before the completion of the
sixth hour, relative to the start of the duty. For example, crews sign Two solution approaches are proposed for the problem. The rst
on at 08:00 and sign off at 16:00, then the earliest MB will be at is the exact method of a new mathematical programming model.
11:0011:30 and the latest MB will be at 13:2913:59. The time The mathematical model is formulated based on the information
interval between the earliest break and the latest break corre- provided by Queensland Rail (QR), Australia. The inclusion of the
sponds to the transition period between two consecutive pieces ROP in this model offers exibility, because it allows a train crew
of duty, and is dened as a relief opportunities period (ROP). The to be relieved at any RP within the interval of ROP. Existing models
ROP is a period of time within which a train crew is allowed to usually only consider relieving crew at the beginning of the inter-
be relieved. Any RP can be chosen for crew relief within the two val of ROP which may be impractical. Allowing the train crew to be
limits of the ROP. The set of crew HDs is a subset of the set of relieved at any RP during the ROP will provide better representa-
RPs. This transition period includes the time spent for taking a tion of real-world conditions and improve the robustness of the
meal and other crew relieving related activities such as handling schedule. The second solution approach is the metaheuristic which
over a train to (from) another train crew. An example of vehicle consists of two phases. The rst phase constructs initial solutions
blocks and a crew duty with ROP is shown in Fig. 2. by a constructive heuristic and the second phase improves the ob-
The path of a train is indicated by the blue lines and the purple tained solutions by applying a hybrid constructive SA.
lines, as shown in the diagram of Fig. 2. The blue lines show the
movement of a train from the Station 1 (Depot A) to the terminal 3.1. The mathematical programming model
at Station n, with transition times (short dwell times) at each sta-
tion. Crew arriving at stop n can be relieved at this point and take a This section presents a mathematical model for railway crew
MB at an away depot (Depot B). The relieved crew may then con- scheduling. The following notations are used through the descrip-
tinue with another vehicle block passing through the same termi- tion of the model.
nal station or RP. Alternatively, the crew may return directly along
the route in the opposite direction (the purple lines) and take a MB 3.1.1. Notations
at the home depot (Depot A). When more trips are considered, the
network becomes denser and more paths need to be evaluated. A
duty covers a set of consecutive trip segments in a block. The 1st Indices
part of a duty (duty stretch) is the period from the start of a duty i, i0 trips
j, j0 duties
k, k0 shifts
ohd originate at crew home depot
Distance /
Station no. thd terminate at crew home depot
orp originate at relief point
ROP ROP trp terminate at relief point
Station n /
ots originate and terminate at any station
Depot B
Sets
I set of all trips
Station n-1
Iohd set of trips that originate at crew home depot
(Iohd # I)
Station 2 Ithd set of trips that terminate at crew home depot
(Ithd # I)
Iorp set of trips that originate at relief point (Iorp # I)
Station 1 /
Depot A ROP ROP
Itrp set of trips that terminate at the relief point (Itrp # I)
1st part of Time Iots set of trips that can be sequential in the same duty
2nd part of
a duty a duty (Iots # I)
A crew duty J set of duties
(shift)
(continued on next page)
Fig. 2. An example of vehicle blocks with ROP.
14 R. Hana, E. Kozan / Computers & Industrial Engineering 70 (2014) 1119

XX
Ji set of duties which can contain trip i (Ji # J) v ijk 1 8i 2 I 2
K set of shifts k2K j j2J i

Kj set of shifts for duty j (Kj # K)


This equation implies that no deadheading is allowed. A crew
Parameters
has to wait for the next trip at a RP and the changeover of trains
tijk driving time of trip i in duty j of shift k
is at the same RP. When the assignment of trip i is followed by trip
fiijk
0
transition time from trip i to trip i0 of the jth duty of
i0 in the same duty, a sequence of the trips is enforced via con-
shift k
straint (3). Trips i and trip i0 are consecutive only in the case that
0
fiijj0 k transition time from trip i of the 1st duty to the trip i0 0
the binary variable xiijk 1. Similarly, constraint (4) denotes that
of the 2nd duty of shift k
ujk minimum duration of 1st part of duty in shift k the assignment of trip i in duty j is followed by trip i0 at the next
0
u0jk maximum duration of 1st part of duty in shift k duty j0 . The transition variable ziijj0 k is activated when both v ijk and
0
d0j0 k minimum duration of 2nd part of duty in shift k v i
jk are equal to one. As a result, one transition from trip i to trip
dj0 k maximum duration of 2nd part of duty in shift k i0 occurs at the end of any duty if and only if trip i0 is assigned in
dti departure time of trip i the subsequent duty.
ati arrival time of trip i 0 0 0 0
xiijk P v ijk v ijk  1 8i; i 2 Ik ; i i ; j 2 J; k 2 K j 3
dsi departure station of trip i 0 0 0 0
asi arrival station of trip i ziijj0 k P v ijk v ij0 k  1 8i; i 2 Ik ; i i ; k 2 K j 4
Wtmax normal working time per shift
Constraint (5a) ensures that no overlap is allowed. The start
Wtmin minimum working time allowed per shift
time of trip i0 in any duty requires the completion of the previous
Wtk actual driving time in shift k
trip. Constraint (5b) and constraint (5c) are included to ensure a
Stk spread time of shift k
connectivity of the trip sequences.
Stmax maximum spread time allowed per shift
0 i0
atijk fiijk 6 dt jk 8 i; i0 2 Ik ; i i0 ; j 2 J; k 2 K j 5a
0
i
asijk dsjk 8 i; i0 2 Ik ; i i0 ; j 2 J; k 2 K j 5b
The decision binary variables are dened as follows:
 i0 0
1 if trip i is assigned in duty j of shift k; asijk dsj0 k 8 j; j 2 J; k 2 K j 5c
v ijk
0 otherwise Constraint (6a) and constraint (6b) denote the relation between
 the start and completion times in a duty. The completion time of
1 if trip i is the first trip of duty j of shift k; the last trip in a duty is greater than or equal to the start time of
wijk
0 otherwise the rst trip plus the total driving time and the total transition
( time in the duty.
0
0
1 if trip i is followed by trip i in the same duty; i
X
xiijk atijk P dt jk t ijk v ijk 8 j 2 J; k 2 K j 6a
0 otherwise i2Ik
X X ii0 0
 #ijk P rijk t ijk v ijk fjk xiijk 8 j 2 J; k 2 K j 6b
1 if trip i is the last trip in duty j of shift k;
yijk i2Ik i;i0 2Ik
0 otherwise
Constraint (7a), along with constraint (7b), constraint (8a), and
8 0
>
> 1 if there is a transition from trip i to trip i constraint (8b), indicate that the total continuous driving time in
>
< 0 the 1st part of a duty should be greater than or equal to the mini-
0 in the end of any partial duty and trip i
ziijj0 k mum allowable duration of the 1st part of a duty in shift k (ujk) and
>
> is assigned in the subsequent partial duty;
>
: the total continuous driving time of the 2nd part of a duty should
0 otherwise be less than or equal to the maximum duration of the 2nd part of a
 
8 duty in shift k d0jk . Otherwise, the total continuous driving time of
> 1 if there is a transition between trip i
>
>
< at the end of a shift to be followed by trip i
0 the 1st part of a duty should be less than or equal to the maximum
0  
ziikk0
>
> at the beginning of the subsequent shift; duration of the 1st part of a duty in shift k u0jk and the total con-
>
:
0 otherwise tinuous driving time of the 2nd part of a duty should be greater
than or equal to the minimum duration of the 2nd part of a duty
Additionally, the non-negative continuous variables rijk and #ijk  
denote the start time of trip i in duty j of shift k and the completion in shift k d0j0 k . The set of constraints satisfy a condition in which
time of trip i in duty j of shift k, respectively. U is a binary variable. a train crew takes a MB at the earliest or latest times or in any time
The objective function is designed to minimise the total number between the two limits.
of duties by minimising idle transition times. The idle transition X X ii0 0
times includes the idle intervals between trips and an idle transi- tijk v ijk fjk xiijk P ujk U 8 j 2 J; k 2 K j 7a
i2Ik i;i0 2Ik
tion during a MB. The function consists of driving period and
X X ii0 0
non-driving period. tijk v ijk fjk xiijk 6 u0jk 1  U 8 j 2 J; k 2 K j 7b
0 1 i2Ik i;i0 2Ik
XX X X ii0 0 X ii0 0
Min@ t ijk v ijk fjk xiijk fjj0 k ziijj0 k A X X ii0 0
j2J i i2Ik j2J i i;i0 2Ik i;i0 2Ik
1 tij0 k v ij0 k fj0 k xiij0 k 6 dj0 k U 8 j; j0 2 J; k 2 K j 8a
0 0 0 i2Ik i;i0 2Ik
8i; i 2 I; i i ; j; j 2 Ji ; k 2 K j
X X ii0 0 0
Eq. (2) is the trip assignment. It enforces every trip i to be allo- tij0 k v ij0 k fj0 k xiij0 k P d0j0 k 1  U 8 j; j 2 J; k 2 K j 8b
i2Ik i;i0 2Ik
cated in exactly one duty j of shift k.
R. Hana, E. Kozan / Computers & Industrial Engineering 70 (2014) 1119 15

Eq. (9a) calculates the total actual driving time in shift k(Wtk), 3.2. The metaheuristic
which is equal to the total working time of all partial duties in
the shift. Constraint (9b) states that the total actual driving time Most practical optimisation problems involve high complexity
within the shift must not exceed the upper bound (Wtmax) and and require extensive computational times because of the number
the lower bound (Wtmin). of potential solutions. The approximate methods are generally ap-
plied to resolve this type of problems. These methods are based on
XX XX ii0 0
t ijk v ijk fjk xiijk 6 Wtk 8 j 2 J; k 2 K j 9a an iterative exploration of the search space to nd a good quality
J2J i i2Ik j2J i i0 2Ik solution in reasonable computational times. These approximate
methods, among others are the neighbourhood methods, such as
Wt min 6 Wt k 6 Wtmax 9b
local search and SA.
Constraint (10) restricts the spread time of a shift from exceed-
ing the maximum allowed total spread time. Spread time of a shift 3.2.1. Initial solution generation by constructive heuristic (CH)
(Stk) is equal to the total working time plus the transition time be- Local search explores the neighbourhood N s of a current solu-
tween each partial duty (MB). tion iteratively and nds a better solution sb 2 N s according to
some criterion. The initial solution is constructed by means of CH
XX X X ii0 0 X 0 0
tijk v ijk fjk xiijk fiijj0 k ziijj0 k 6 St max 8 j; j0 2 J; k 2 K j 10 algorithm from an ordered list of trips with their attributes to form
j2J i i2Ik 0
j2Ji i;i 2Ik 0
i;i 2Ik crew duties. We break down this phase into two sub-phases. The
rst is the initialising phase that includes listing all vehicle blocks
Considering that each duty consists of at least one trip, only one
in ascending order of start time, vb = {vb1, vb2, . . . , vbn}; and grouping
trip can be the rst or the last one in each duty. Eq. (11) expresses
them based on the length of run, lr = {lr1, lr2, . . . , lrn}. Cutting vehicle
the requirement that the rst trip in the 1st part of a duty which is
blocks into trip segments is also performed in this phase ts = {ts1,
also the rst trip of the corresponding duty (shift) should originate
ts2, . . . , tsn}. Some vehicle blocks may have sufcient length to be di-
from a HD. Eq. (12) states that the last trip in a duty should termi-
vided into two straight runs that are approximately equal to the
nate at a HD or at a RP. Eq. (13) ensures that each trip, except the
length of regular working hours (8 h) each. Other vehicle blocks
rst trip, is assigned after another trip. Similarly, Eq. (14) ensures
may be divided into one straight run of 8 h with a piece left over.
that each trip, except the last trip, is assigned before another trip.
The remaining of the vehicle blocks do not need to be divided as they
Eq. (15) expresses that for each trip which terminated the 1st part
have sufcient length to form one straight run with no pieces left
of a duty, there is a transition time (MB) from this trip to the rst
over. The second is combining phase which is joining trip segments
trip in the subsequent part of a duty. Similarly, Eq. (16) expresses
by progressively selecting uncovered trip segments from a block to
that for each trip which originated a duty, there is a transition time
create feasible duties. The CH method is described in a pseudo code
from the last trip of the previous duty to the current duty. Eq. (17)
form in Algorithm 1 in the Appendix. It is desirable to construct fea-
ensures that for each trip which terminated a duty (shift), there is a
sible schedules that will minimise idle transition times and maxi-
transition time from this trip to the rst trip of the next duty (sign
mise the length of the route per cycle time. The cycle time is the
off to sign on). Similarly, Eq. (18) ensures that for each trip which
time spent to drive a round trip plus idle intervals on a route.
originated a duty (shift), there is a transition time from the last trip
of the previous duty (shift) to the rst trip of the current duty
3.2.2. Solution improvement by hybrid constructive SA (HCSA)
(shift).
SA is motivated by an analogy to the physical process of anneal-
X ing, where the temperature of a material is reduced to achieve its
wijk 1 8 j 2 J; k 2 K j 11 thermal equilibrium (Kirkpatrick et al., 1983). This principle is ap-
i2Iohd
X plied in combinatorial optimisation problems to optimise the
yijk 1 8 j 2 J; k 2 K j 12 objective function value. The advantage of this technique is that
i2Ithd [Itrp
X it can avoid local optima by occasionally allowing the acceptance
0 0
xiijk v iijk  wijk 8 i0 2 Iots ; j 2 J; k 2 K j 13 of non-improving solutions in the hope that a better solution
i2Iots ;ii 0
may be found later on.
X 0
xiijk v ijk  yijk 8 i 2 Iots ; j 2 J; k 2 K j 14 We utilise the SA metaheuristic to improve solution and to de-
i0 2Iots ;i0 i
rive a near-optimal solution. The design of SA algorithm to solve
X 0 0 the railway crew scheduling generally consists of four components,
ziijj0 k wij0 k 8 i0 2 Iohd [ Iorp ; j 2 J; k 2 Kj 15 an objective function (analogue of energy) to be optimised; the
i2Ithd [Itrp
X 0
neighbourhood structure that denes how to efciently generate
ziijj0 k yijk 8 i 2 Ithd [ Itrp ; j 2 J; k 2 Kj 16 random solutions from neighbourhood; an acceptance criterion
i0 2Iohd [Iorp that is a criterion for accepting or rejecting a new generated solu-
X 0 0
ziikk0 wijk0 8 i0 2 Iohd ; j 2 J; k 2 Kj 17 tion; and a cooling schedule. Implementation details of the pro-
i2Ithd [Itrp posed HCSA algorithm are given as follows:
X 0
ziikk0 yijk 8i 2 Ithd [ Itrp ; j 2 J; k 2 Kj 18
(a) Initial sequence. An initial schedule is obtained from the best
i0 2Iohd [Iorp
schedule returned by the CH algorithm. This schedule is
Generally, these constraints can be divided into three groups. assumed as the current solution. A set of scheduled trips,
The rst group focuses on the scheduling and sequencing trips I fi1 ; i2 ; i3 ; . . . ; in g, that need to be serviced during a
(Eqs. (2)(6)); the second group addresses the duty restrictions dened period of time is identied by its departure station,
(Eqs. (7)(10)); and the remaining group determines the assign- departure time, arrival station, arrival time, represented by
ment and sequencing of trips in a duty (Eqs. (11)(18)). Because vector dsi, dti, asi, ati, respectively. The algorithm sorts an
of the large number of decision variables and constraints of the array I fi0; . . . ; in  1g of n trips in increasing order
proposed model, it is difcult to solve this model by exact meth- of departure time. Every iteration removes an element from
ods, especially for large-sized instances. Therefore, we propose a the input data, inserting it into the correct position and
hybrid constructive heuristic with the SA metaheuristic for solving simultaneously moves the data in the already-sorted
the problem. This is presented in the next section. list, until no input elements remain. Initialising can be
16 R. Hana, E. Kozan / Computers & Industrial Engineering 70 (2014) 1119

considered as the process of queueing all the trips in the feasible set of crew duties to cover a given set of trips. A feasible
right order to their assigned duties. The constraints consid- crew duty (shift) includes one or two partial duties, a period of
ered in this case are connectivity restrictions, travelling MB, idle transition times, and the sign-on and sign-off activities.
times and transition times. The accumulated time represents the total crew working time.
(b) Neighbourhood structure. The neighbourhood structure The exact solution of the mathematical model was obtained
denes a method of generating alternative solution from a using Xpress Optimizer (FICO) algorithms for mixed integer prob-
current solution. We generate the neighbourhood using lems. We considered 3 HDs and 5 RPs. The number of trips varied
swap and insert mechanisms. The neighbourhood structure between 25 and 120 for instances solved by Xpress Optimizer and
proposed in Elizondo et al. (2010) is adapted for our the HCSA algorithm. Whereas the number of trips varied between
problem. Two different duties sx and sy, with the number 258 and 732 for instances solved by the CH and HCSA algorithms.
of trips v and w, respectively, are selected and denoted as, We divided all trips in a day into four different intervals, 05.00
sx = {ix1, ix2, . . . , ixm, ix,m+1, . . . , ixv} and sy = {iy1, iy2, . . . , iyn, 08.59; 09.0012.59; 13.0016.59; and 17.0022.59. Normal daily
iy,n+1, . . . , iyw}. The swap operation is performed on the working time was xed to 8 h and maximum spread time allowed
selected duties by exchanging the position of trip segments was 12 h. The minimum length and maximum length of working
(ts) between two blocks. Thus periods of the 1st part of a duty were 3 h and 5.5 h, respectively.
  Whereas the minimum length and maximum length of working
fix1 ; ix2 ; . . . ; ixm ; ix;m1 ; . . . ; ixv g periods of the 2nd part of a duty were set to 2 h and 4.5 h, respec-
swapt sx ; t sy
fiy1 ; iy2 ; . . . ; iyn ; iy;n1 ; . . . ; iyw g tively. The length of the ROP was 2.5 h within which a MB of min-
The swap operation is only performed on duties with trip segments imum 0.5 h is required between the third and the sixth hours of an
originate and terminate at the same crew depot. The insert opera- 8 h duty. There was a time allowance of about 10 min for sign-on
tion is performed by moving one trip segment to another duty. This or sign-off when a crew starts or ends his duty at a HD. Table 2
operation is only applied to the trip segments that arrive and depart gives computational results, i.e. number of feasible duties, total
from stations with a local connection. objective values, driving times, and run times in seconds.
(c) Acceptance criterion. Given the initial conguration, a small All small-sized instances were solved to optimality by Xpress
perturbation is performed by exchanging a piece of the trip Optimizer. As can be seen from Table 2, the computational time in-
between two duties and moving a piece of the trip within creases signicantly as the size of the instance become larger. The
one duty to another. The change in the objective function largest instance was solved by Xpress Optimizer with a reasonable
value is then calculated. If it gives a better solution, the computational time. The HCSA algorithm was able to solve all
new solution is accepted. Otherwise it still has a chance to small-sized problems with computational time less than one sec-
be accepted with a particular condition that is the value of ond. We used relative percentage deviation as a performance mea-
the function f(DE) = eDE/T is greater than a randomly gener- sure to further evaluate the obtained solutions for the small-sized
ated value between 0 and 1. When the solution is accepted, problems. This was calculated by the following equation;
the current neighbourhood conguration is updated as the
Gap% fSAlg  SExt =SExt g  100%
algorithm proceeds.
(d) Cooling schedule. An annealing or a cooling schedule consists
of (i) the initial value of temperature parameter T0, (ii) the where S(Alg) is the objective value of the solution obtained by the
cooling factor (a method of gradually decreasing the value HCSA algorithm and S(Ext) is the objective value of the optimal solu-
of Tc), (iii) the number of iterations to be performed at each tion given by the Xpress Optimizer.
Tc before it is decreased, and (iv) the stopping criterion to The proposed algorithms were implemented in C# and run on
terminate the algorithm. an Intel Core 2 Duo 1.96 GHz Processor with 3.46 GB of RAM under
Microsoft Windows XP operating system. The computational re-
The overall method of the proposed algorithm is captured in the sults obtained from both the CH algorithm and the HCSA algorithm
pseudo-code form in Algorithm 2 in Appendix A. are summarised in Table 3. The number of trips per duty varies be-
cause of the length of a trip also varies. On average, the number of
trips in each duty varies from 3 to 6 trips. The problem of smaller
4. Computational experiments size corresponds to a higher percentage of driving time with less
computational times. This is because smaller sized problems can
To evaluate the scheduling methods presented in this paper, we be better optimised due to a more exhaustive search. For larger
generated benchmark instances for the problem with 24-h problems, long idle transition times remain high as indicated by
scheduling horizons. A sample train schedule with 12 trips is given a lower percentage of driving time. This is due to the fact that ser-
in Table 1. The railway crew scheduling in this study is to create a vices at different times of the day have different frequency. Early
Table 1
morning and late afternoon hours have higher service frequency
A sample train schedule with 12 trips. than that of the middle day. It seems that the more the trips we in-
clude the higher probability of the delay.
Train Dep. station Dep. Time (dt) Arr. station Arr. time (at)
ID (ds) (hh:mm) (as) (hh:mm)
The driving time is used to measure the performance of the ob-
tained schedules (productivity rate). Driving time of the crew is the
L001 A 05:00 B 05:24
L002 A 05:30 B 05:54
ratio between the total working time (Wt) and the total spread
L003 A 06:00 B 06:24 time or elapsed time (Et) in a duty. Excess cost (Ec) is calculated
L001 B 05:25 C 06:35 as follows. Ec(%) = {(Et  Wt)/Wt}  100%. Both the CH and the
L002 B 05:55 C 07:03 HCSA algorithms produced acceptable solutions, although the pro-
L003 B 06:25 C 07:34
duced solutions are not guaranteed to be an optimal solution. The
L201 C 04:28 B 05:41
L202 C 04:59 B 06:08 CH algorithm was sometimes unable to include some trip seg-
L203 C 05:27 B 06:37 ments and left them out unscheduled. In all cases, the HCSA algo-
L201 B 05:42 A 06:08 rithm was able to produce better solutions than the CH in terms of
L202 B 06:08 A 06:38 the solution quality and the run time. As can be seen from Table 3,
L203 B 06:38 A 07:02
the HCSA algorithm signicantly improves the solution produced
R. Hana, E. Kozan / Computers & Industrial Engineering 70 (2014) 1119 17

Table 2
Computational results by the mathematical model and the HCSA algorithm.

Instance No. of trips Feasible duties Objective value Driving time (%) CPU time (s) (ext) Objective value CPU time (s) (HCSA) Gap (%)
(FDs) (ext) (HCSA)
DM-01 25 6 2944 0.95 0.42 2944 0.0001 0
45 11 5407 0.93 0.88 5407 0.0001 0
65 16 7851 0.93 1.09 7851 0.0002 0
DM-02 70 23 11,288 0.94 1.73 11,288 0.0004 0
90 28 13,710 0.91 3.50 13,710 0.0006 0
105 33 16,205 0.92 9.24 16,205 0.0019 0
DM-03 110 35 17,166 0.87 121.51 17,166 0.0033 0
115 36 17,685 0.82 2262.04 17,685 0.0085 0
120 38 18,601 0.80 15927.33 18,601 0.0127 0

Table 3
Computational results of the CH and the HCSA algorithms.

Instance No. of Initial solution by Constructive Heuristic (CH) Hybrid Constructive Simulated Annealing (HCSA)
trips
No. of Objective Total elapsed Driving Excess CPU No. of Objective Total elapsed Driving Excess CPU
duties value time (min) time (%) cost (%) time duties value time (min) time (%) cost (%) time
(m:s) (m:s)
DH-01 258 112 54,882 60,376 90.90 10.01 00:12 105 51,345 54,045 95.00 5.26 00:07
DH-02 350 121 60,257 66,935 90.02 11.08 00:20 117 58,146 62,526 92.99 7.53 00:14
DH-03 425 139 68,943 78,522 87.80 13.89 00:28 133 65,825 72,338 91.00 9.89 00:18
DH-04 455 156 79,095 91,125 86.80 15.21 00:43 142 71,722 79,693 90.00 11.11 00:32
DH-05 470 153 85,526 96,218 88.89 12.50 00:57 145 80,762 87,805 91.98 8.72 00:48
DH-06 485 160 80,480 89,425 90.00 11.11 01:07 157 78,657 85,476 92.02 8.67 00:55
DH-07 550 157 84,309 95,807 88.00 13.64 01:29 155 83,120 92,352 90.00 11.11 01:04
DH-08 582 162 82,135 94,413 87.00 14.95 01:52 162 81,840 92,007 88.95 12.42 01:33
DH-19 607 169 82,810 97,538 84.90 17.79 02:04 167 81,679 93,884 87.00 14.94 01:56
DH-10 625 172 84,795 97,712 86.78 15.23 02:26 172 84,965 96,404 88.13 13.46 02:10
DH-11 660 176 87,120 102,294 85.17 17.42 05:41 174 86,371 97,999 88.13 13.46 05:36
DH-12 732 182 89,874 105,704 85.02 17.61 09:55 178 88,255 100,285 88.00 13.63 09:42

Fig. 3. Q values for the CH and HCSA solutions.

by the CH. The HCSA algorithm increases the average driving time values of solutions obtained by both the CH and HCSA algorithms
by 3.06% and decreases the average excess cost by 3.35%. Further- can be seen in the chart of Fig. 3. The Q value shown in Fig. 3 is en-
more, the number of leftovers in the HCSA is smaller than that in ough to validate the quality of the proposed algorithms.
the CH. Overall, the HCSA algorithm increases the total crew work- With regard to the SA algorithm, the initial temperature T0 was
ing time and reduces the number of crew duties for all data sets. As set to be large to allow the search exploring some areas of the solu-
the number of crew duties corresponds to the number of crew tion space with low level quality solutions hence, accepting a
needed, signicant savings can be gained on the annual cost of worse solution at the beginning of the search. A large neighbour-
crew related expenses. hood is more attractive because it tends to nd much better solu-
To measure the quality of solutions obtained by the algorithms, tion in one local search step than in the small neighbourhoods.
the upper and lower bound values are calculated as follows. However, a large neighbourhood is associated with long search
Q = (objective value  LB)/(UB  LB) where 0 6 Q 6 1 (Burdett process to come up with a better neighbouring solution. Large
and Kozan, 2010). The equation describes approximately the qual- neighbourhood may also lead to a potential bottleneck for local
ity of the solution in the search space. If Q value is close to zero search when searching a better neighbouring solution. The temper-
then the obtained solution is near to the optimal solution. The Q ature was updated in each iteration by applying geometric cooling
18 R. Hana, E. Kozan / Computers & Industrial Engineering 70 (2014) 1119

schedule where Tc = aTc. We applied a cooling factor of 0.93, 0.95, a cooling rate
and 0.97 as the temperature reduction should be controlled by a imax maximum iterations
constant cooling factor with the value approximately close to one
(Kirkpatrick et al., 1983). Altering this parameter however, did
not have a signicant effect on the nal objective value after 500 The pseudo code of the HCSA algorithm is as follows:
iterations. Begin

5. Conclusion Algorithm 1. Generating initial solutions

In this paper, a mathematical model and algorithms for railway Input all relevant data: trip list, vehicle blocks, parameters,
crew scheduling problem are presented. The objective of the model and constraints
and algorithms is to minimise the number of crew duties by mini- Output: initial solutions S0
mising total idle transition times. The idle transition times includes begin Initialisation ()
idle intervals between trips and an idle interval between partial du- rst phase
ties. These unproductive parts of a crew duty contribute the most to i l to I(I total number of trips), "i 2 vb;
the optimisation potential for crew scheduling. The mathematical vb {vb1, vb2, vb3, . . . , vbn} in ascending starting
model includes the interval of relief opportunities, allowing a train time order, " i 2 vb;
crew to be relieved at any relief point during the ROP. The problem lr {lr1,lr2, . . . , lrn} "i 2 vb;
is mathematically intractable due to the number of possible trip ts {ts1, ts2, . . . , tsn} "i 2 vb;
combinations and the complexity of the involved constraints. To second phase
handle the difculty due to the combinatorial explosion of the fn l to N (N number of trip segments);
problem, a constructive heuristic coupled with the SA algorithm list trip segments sequentially;
is proposed to solve the problem. The overall results indicate that S0 =
the proposed algorithms can produce near-optimal railway crew fn
schedules of large-sized problem instances within an acceptable while(fn 6 tsn  1) do
computational time. This study also shows the effectiveness of allocate trip segments into time slots based on
the hybridization of a SA based algorithm in solving a highly con- the starting time of the trip;
strained combinatorial optimisation problem. A further analysis S0 S0 [ {fi};
on the performance of the model and algorithms by varying param- fn fnn{fi};
eter settings is going to be done in the near future. determine possible trip segment combinations;
Although we have developed a model for railway crew schedul- end while
ing, this model can be applied to other modes of transportation. S0 S0 + 1;
The model and solution techniques presented in this paper can end
be improved and extended in several ways such as: return(S0)

 The proposed model deals with the construction of duties


(shifts) with one period of relief opportunities (straight runs).
This model can be extended to model a situation in which a Algorithm 2. Simulated Annealing
duty may contain more than two pieces of work (split runs).
 The model can be applied to the integration of vehicle and CSPs Input: initial solutions S0
with ROP. Output: duties
 Accessing and comparing the performance of the SA algorithm begin Simulated Annealing ()
by implementing other metaheuristics such as Tabu Search step
and Genetic Algorithm. select an initial solution and set it as the current
solution
sc s 2 S;
Appendix A calculate Scmax
sb sc;
The following notations are used through the description of the    
b
f Smax f Scmax ;
HCSA algorithm.
select an initial temperature, T0
S set of feasible solutions Tc T0;
N s set of neighbourhood solutions select maximum iterations imax
s0 generated solution (sample solution from select temperature reduction function, a (cooling
neighbourhood) s0 2 S rate)
sc current solution initialise step counter i 0;
sb best solution found dene neighbourhood structure ();
 
f S0max function value of neighbourhood solution iterative step
 c 
f Smax function value of current solution while (i < imax and Tc > T0)
 
f Sbmax function value of best solution search neighbourhood;
generate solution from neighbourhood, s 2 N s;
T0 initial temperature
s0 s 2 N s
Tc current temperature
apply the swap and insert mechanisms;
R uniformly distributed random number between 0
evaluate sample solution from neighbourhood;
and 1
R. Hana, E. Kozan / Computers & Industrial Engineering 70 (2014) 1119 19

    Bengtsson, L., Galia, R., Gustafsson, T., Hjorring, C., & Kohl, N. (2007). Railway crew
DE f S0max  f Scmax pairing optimization. Algorithmic methods for railway optimization. Lecture notes
if DE < 0 then in computer science (LNCS) (Vol. 4359). Springer.
sc s0 Burdett, R. L., & Kozan, E. (2010). A disjunctive graph model and framework for
 c    constructing new train schedules. European Journal of Operational Research,
if f Smax < f Sbmax then 200(1), 8598.
    Caprara, A., Fischetti, M., Toth, P., Vigo, D., & Guida, P. (1997). Algorithms for railway
f Sbmax f Scmax crew management. Mathematical Programming, 79(13), 125141.
DeLeone, R., Festa, P., & Marchitto, E. (2011). A bus driver scheduling problem: A
end if new mathematical model and a GRASP approximate solution. Journal of
else Heuristics, 17(4), 441466.
generate random number R  0; 1; Dias, T. G., de Sousa, J. P., & Cunha, J. F. (2002). Genetic algorithms for the bus driver
scheduling problem: A case study. Journal of the Operational Research Society,
Paccept = eDE/T 53(3), 324335.
if R < P accept ) then Elizondo, R., Parada, V., Pradenas, L., & Artigues, C. (2010). An evolutionary and
sc s0 constructive approach to a crew scheduling problem in underground passenger
 c    transport. Journal of Heuristics, 16(4), 575591.
f Smax f S0max Emden-Weinert, T., & Proksch, M. (1999). Best practice simulated annealing for the
end if airline crew scheduling problem. Journal of Heuristics, 5(4). 419-419.
Fischetti, M., Martello, S., & Toth, P. (1987). The xed job schedule problem with
Tc aTc spread-time constraints. Operations Research, 35(6), 849858.
i i+1 Fischetti, M., Martello, S., & Toth, P. (1989). The xed job schedule problem with
end if working-time constraints. Operations Research, 37(3), 395403.
update temperature T; Freling, R., Lentink, R. M., & Wagelmans, A. P. M. (2004). A decision support system
for crew planning in passenger transportation using a exible branch-and-price
Tc Tc(i) algorithm. Annals of Operations Research, 127, 203222.
  
return sb ; f Sbmax Goumopoulos, C., & Housos, E. (2004). Efcient trip generation with a rule modeling
system for crew scheduling problems. Journal of Systems and Software, 69(12),
end while 4356.
Kirkpatrick, S., Gelatt, C. D., & Vecchi, M. P. (1983). Optimization by simulated
end
annealing. Science, 220(4598), 671680.
Kroon, L., & Fischetti, M. (2001). Crew scheduling for Netherlands Railways
Destination: Customer. In S. Vo & J. R. Daduna (Eds.), Computer-aided
scheduling of public transport. Lecture notes in economics and mathematical
systems (Vol. 505, pp. 181201). Berlin: Springer.
Lucic, P., & Teodorovic, D. (1999). Simulated annealing for the multi-objective
End aircrew rostering problem. Transportation Research Part A, 33(1), 1945.
Morgado, E. M., & Martins, J. P. (1992). Scheduling and managing crew in the
Portuguese railways. Expert Systems with Applications, 5(34), 301321.
References Nishi, T., Muroi, Y., & Inuiguchi, M. (2011). Column generation with dual
inequalities for railway crew scheduling problems. Public Transport, 3(1), 2542.
Aleri, A., Kroon, L., & Velde, S. (2007). Personnel scheduling in a complex logistic Vaidyanathan, B., Jha, K. C., & Ahuja, R. K. (2007). Multi-commodity network ow
system: A railway application case. Journal of Intelligent Manufacturing, 18(2), approach to the railroad crew scheduling problem. IBM Journal of Research and
223232. Development, 51, 325344.
Bangert, Patrick (2012). Optimization for industrial problems. Berlin, Heidelberg: Yan, S., & Tu, Y. P. (2002). A network model for airline cabin crew scheduling.
Springer-Verlag. European Journal of Operational Research, 140(3), 531540.

You might also like