Modeling and Algorithms of the Crew Rostering Problem with Given Cycle on High-Speed Railway Lines

This paper studies the modeling and algorithms of crew roster problem with given cycle on highspeed railway lines. Two feasible compilation strategies for work out the crew rostering plan are discussed, and then an integrated compilation method is proposed in this paper to obtain a plan with relatively higher regularity in execution and lower crew members arranged. The process of plan making is divided into two subproblems which are decomposition of crew legs and adjustment of nonmaximum crew roster scheme. The decomposition subproblem is transformed to finding a Hamilton chain with the best objective function in network which was solved by an improved ant colony algorithm, whereas the adjustment of nonmaximum crew rostering scheme is finally presented as a set covering problem and solved by a two-stage algorithm. The effectiveness of the proposed models and algorithms are testified by a numerical example.


Introduction
Crew planning problem is known as crew scheduling and rostering in the transportation market-airlines, railways, mass transit, and buses.The common features for all these applications are: i both temporal and spatial features are involved, that is, each task is characterized by its starting time and location and its finishing time and location and ii all tasks to be performed by employees are determined according to a given timetable.Tasks are the smallest elements or building blocks and are obtained from the decomposition of flight, train or bus journey, or a trip between two or more consecutive stops in a bus line.
In recent decades, the research and applications of airline crew scheduling and rostering received extensive attention because of its enormous economic benefits and impact, and more articles have been devoted to methodologies and applications in this area than The determination of the given cycle of crew rostering plan is mainly dependent on the operating characteristics and the working regulations of crew members of high speed railway lines, which should also guarantee that the working time of crew members is in accordance with the working standard.Because the crew routes or crew legs got by the phase of crew scheduling plan generally have different working time, the crew roster schemes consisted by crew routes or crew legs usually have variance in working time.In the long run, the unbalance of working time between crew members can be relieved by letting crew members work underdifferent crew roster schemes in several cycles.However, from the viewpoint of plan-making, for all crew roster schemes, minimizing the variance of working time is helpful for keeping the workload balance of all crew members.
In the process of working out the crew scheduling plan, crew legs are further combined into crew routes.However, when it comes to the crew rostering plan, both crew routes and crew legs can be used as the fundamental data.In contrast, using crew legs to make up the crew rostering plan is more flexible, and actually includes the scenarios of making plan with the input of crew routes.Therefore, this paper only focuses on the implementation method of crew rostering plan with the input of crew legs.For the crew rostering plan with given cycles, we have two specific forms.
i Dividing all crew legs into several subsets which could form a feasible crew roster scheme subject to all constraints, and then the crew roster scheme is assigned to T crew members or T crew member groups to accomplish sequentially.
Crew rostering plan with this pattern has strong regularity, which is easy to be worked out and helpful for increasing the possibility to manage the crew members by groups.However, when applying crew rostering plan with this pattern, the crew roster scheme executed sequentially by T crew members may sometime use more crew members than the lower bound we really need.In order to explain this scenario, a term named as maximum crew roster scheme is defined at the first stage.

Maximum Crew Roster Scheme
For a feasible crew roster scheme, if the total working time exceeds the working time standard T w while connecting any other crew leg, this scheme will be regarded as a maximum crew roster scheme, and then the crew members needed to accomplish this scheme are equal to the cycle of the crew rostering plan T .
In crew rostering plan worked out by the first mode, the number of crew members used just equals kT where k is the number of crew roster schemes if all crew roster schemes are maximum crew roster scheme.If there is a nonmaximum crew roster scheme, some crews will be unnecessarily used if we still assign this scheme to T crew members.
ii Determining crew roster scheme for each crew member directly in crew rostering plan.In this circumstance, the matching problem between crew members and crew legs instead of crew routes is directly considered, which is beneficial to reduce the crew member arranged in crew rostering plan.
A feasible crew rostering plan worked out by this method is shown in Table 1, where the cycle of the plan is 9 days, of 7 days for work and 2 days for rest, 3 crew legs are accomplished by 4 crew members.Table 1 shows that the crew roster schemes for each crew member are not exactly the same.While the scale of the problem is large, the compilation and implementation of the plan will be relatively complicated.
In order to work out the crew rostering plan more easily and more convenient, an implementation strategy by integrating the advantages of the two methods discussed above is put forward.In this strategy, the first method is adapted to work out a crew rostering plan which has maximum crew roster schemes as much as possible.In summary, the implementation method of crew rostering plan with given cycle studied in this paper contains two steps: the first one realizes the decomposition of all crew legs, while the second one gives further adjustment to the nonmaximum crew roster scheme which may be obtained by the first step.For convenience, the two steps above are called as decomposition of crew legs and adjustment of nonmaximum crew roster scheme, and then the optimization model and algorithm for the two subproblems are studied.

Description
The decomposition problem divides all crew legs into several subsets, and each set could form a feasible crew roster scheme.Because the number of crew members used affects directly the total cost of daily operation, the first target of this problem is usually to minimize the crew members arranged.Meanwhile, for the working time in each crew roster scheme could be different, and consequently, the working load between all crew roster schemes should also be considered when dividing the crew legs.As mentioned above, the crew members needed to accomplish a maximum crew roster scheme is exactly equal to the cycle of crew rostering plan.But for a nonmaximum crew roster scheme with m crew legs, if a crew member could only undertake one crew leg in one day, then the lower bound of crew members needed to accomplish the nonmaximum crew roster scheme is m × T /T w .
The decomposition problem is essentially a set partitioning problem, which could be described by the representation according to feasible schemes.While generate feasible crew roster schemes, the following regulations and constraints should be considered.
i One crew member could undertake at most one crew leg in one day.
ii Within the given cycle, the accumulated working time of crew members should not exceed the working time standard T w .
iii The connection time between two adjacent crew legs should satisfy the corresponding standard.
iv Within the given cycle, each crew member used should at least assign a continuous rest T r .
Through the above analysis, the optimization objectives put forward in this paper for crew legs partitioning problem are as follows.
i Minimizing the number of feasible crew roster schemes, which means maximize the number of maximum crew roster schemes at the same time.
ii Minimizing the number of crew legs in the nonmaximum crew roster scheme if there is one in the crew rostering plan.
iii Realizing the most equalized working time distribution of all maximum crew roster schemes.

Crew Legs Partitioning Model
x i a ij 1, j 1, 2, . . ., n, 3.4 where m is the total number of feasible crew roster schemes, x i is a 0-1 decision variable equals 1 if feasible crew roster scheme i is chosen in the final solution, and 0 otherwise, σ i is a 0-1 variable equals 1 if feasible crew roster scheme i is a maximum crew roster scheme, and 0 otherwise, t i is the total working time of all crew legs in feasible crew roster scheme i, k i is the number of crew legs contained in feasible crew roster scheme i, α is the control parameter for calculate the proportionality of crew roster schemes, a ij is a 0-1 variable that equals 1 if feasible crew roster scheme i contains crew leg j, and 0 otherwise, n is the total number of crew legs.Objective functions 3.1 -3.3 correspond to the optimization objectives in Section 3.1, respectively.Constraint 3.4 represents that each crew leg belongs to one crew roster scheme; constraint 3.5 is the 0-1 restriction of decision variable.

Ant Colony Algorithm with Bipheromone and Biheuristic Information
The model founded above is a set partitioning model with multiobjective, for which finding a feasible solution is NP-hard.In order to solve the model easily, the problem is converted into a network optimization problem by treating the crew legs as nodes, and treating the connections between crew legs as arcs, then the new problem needed to be solved is to find a Hamilton chain, which covered all crew legs.The Hamilton chain is composed by some subchains, each of which represents a feasible crew roster scheme.The issue of finding

Mathematical Problems in Engineering
Hamilton chain in a network could be executed by algorithms based on construction strategy.Ant colony algorithm is a kind of bionic algorithm simulating the mode of finding route in the real world by ants, which has already performed well when applied in problems that can be solved by construction strategy 5, 12 .For this reason, the ant colony algorithm is chosen to solve the converted problem.The critical operations of ant colony algorithm which are different from the common use are as follows.
i The Construction of the Solution Ant k starts from the crew leg with the earliest ending time and continueus the construction process by adding new crew legs one by one.If the working time of the sequence of crew legs does not exceed the working standard, then the next crew leg will be chosen by the probability P k ij , otherwise, it should make clear a new feasible crew route scheme has already been found, after recording the scheme and indexes, setting the value of variable that record the working time of crew leg sequence to 0, and now, the ant chooses a crew leg as the start node for a new crew roster scheme by the probability P k i .While all crew legs have been selected, the key issue is to determine whether the last crew roster scheme is a maximum crew roster scheme or not, calculate all indexes, and finish the construction process of ant k. ii

Representation of Phenomena
The ant colony algorithm in this paper has bi-phenomena representation methods that both record the phenomena of all arcs τ ij and all nodes τ i in the solution construction graph.τ ij is the degree of the expectation for crew leg i connecting crew leg j, while τ i is the expectation for selecting crew leg i as the start node for the next crew roster scheme.
iii Selection Strategy During the selection process, the probability of choosing next crew leg for ant k located at node i is related with its current state.
When the node i where ant k is located is not an "origin" node, the formula of probability for selecting the next crew leg is as follows: where η ij is the heuristic information calculated by the following formula: where T i is the accumulated working time of all crew legs in current sequence, t ij is the connection time between crew leg i and crew leg j, t j is the working time of crew leg j, m is the number of all crew legs after connecting crew leg j, and t * is the average working time of all crew legs.
When the node i where ant k is located is an "origin" node, the formula of probability for selecting the next crew leg as the start node of a new crew roster scheme is as follows: 3.8 The heuristic information η j is calculated by the following formula, in which t e j is the end time of crew leg j:

iv Evaluation Function
It is inconvenient to evaluate the solutions constructed by the ants since the model contains three optimization objectives.Thus, these objectives are considered in one formula by weight when establishing the evaluation function where α, β, γ, are the weigh factors of each optimization objective, respectively, t max is T w times of the working time of crew leg which has longest working time.It is obvious that the first part of formula 3.10 is an integer and the values of other parts are within the interval 0,1 .Since the number of crew member arranged is the objective that most concerned by the management organization, and the importance of other two objectives reduce, gradually, the values of α, β, γ, are set to 1, 1, and 0.1, and the value of each part belongs to 0,m , 0,1 , and 0,0.1 , respectively.

Description
The essence of the adjustment of nonmaximum crew roster scheme is to work out a new crew rostering plan with the crew legs contained by the nonmaximum crew roster scheme.At this time, the second strategy for the implementation of crew rostering plan is used and its main objectives are still minimizing the crew members arranged and equalizing the working time distribution of all crew roster schemes.While adjusting the nonmaximum crew roster scheme, the constraints in Section 3.1 should be satisfied.Moreover, any crew leg must be assigned to one and only one crew member.

Multiobjective Model
The optimization model founded for the second subproblem in this paper is as follows min M, 4.1 where M is the crew members needed to finish all the task; N is the total number of crew legs in nonmaximum crew roster scheme; x k ij is a 0-1 decision variable that equates 1 if crew member i undertakes crew leg j on day k, and 0 otherwise; T is the given cycle of crew rostering plan; T w is the working time while T r is the continuous rest time for crew members in cycle T; T con is the standard for the connection of crew legs; t j is the work time of crew leg j; t s j is the start time while t e j is the end time of crew leg j; θ is an infinite positive number.The feasible crew roster schemes in crew rostering plan are all loops consisting of crew legs, so the connection time between each two adjacent crew legs should satisfy the standard.Hence, the following function is designed to reflect this characteristic: Objective function 4.1 is designed to minimize the crew members arranged in the crew rostering plan, while objective function 4.2 means the most equalized working load among all crew roster schemes.Constraints 4.3 -4.7 correspond to the restrictions in Section 3.1, respectively.The the formula is tenable while one of the adjacent jobs is not the crew leg.Constraint 4.8 is the restriction of 0-1 decision variable.

Two-Phase Algorithm
It is hard to solve the model founded above by traditional optimization algorithms because it includes both linear constraints and constraints based on the description.Therefore, this paper designs an algorithm with two phases.The first phase represents the converted problem by set covering model, and then the initial feasible crew rostering plan with minimal crew members arranged is obtained.On the basis of the result of the first phase, an algorithm with the ideology of simulated annealing is used in the second phase to implement further improvement until a better crew rostering plan is obtained.
Phase 1.Initial crew rostering plan with minimal crew members arranged.The adjustment of nonmaximum crew roster scheme is converted into a standard set covering problem by representing the feasible crew roster scheme with 0-1 string, and then all feasible crew roster schemes are found.Finally, the initial crew rostering plan with minimal crew members is obtained by solving the set covering model.The generation of crew roster scheme, the conversion of feasible scheme, and other issues are as follows.

(i) The Generation and Conversion of Feasible Crew Roster Scheme
The crew roster schemes obtained by the decomposition of crew legs contains at least one nonmaximum crew roster scheme, in which the crew legs contained must be less than T w .Therefore, all the feasible crew roster schemes can be easily found by a deep search method.The generated crew route schemes are represented by the real index of crew legs, thus a 0-1 string with the length of M is used to represent the crew leg for one day in the scheme.The crew leg i is undertaken by crew members when the ith element of the string equals 1, and the crew member is assigned a rest while all elements in the string equal 0. Therefore, a 0-1 string with the length of MT can be used to represent the situation of all the schemes with T days.Thanks to the conversion from feasible crew roster schemes, there does not exist the situation that more than 2 elements in the substring equal 1 in one day.

(ii) The Generation of the Set of All Feasible Crew Roster Schemes
Because the execution process of crew roster scheme is a circulation, the feasible crew roster scheme got by the deep search method can just represent a specific situation in the cycle.In order to generate all feasible crew roster schemes, a duplication process is used to copy the schemes found in step i .Each crew roster scheme can be duplicated T schemes for the cycle of the scheme equals to T .For a crew rostering plan with the cycle of 4 days, in which 3 days are working and 1 day is resting.Since a feasible crew roster scheme is 2-1-3, the schemes duplicated are shown in Table 2.
All feasible crew roster schemes could be obtained after the duplication to the searched schemes, but some of them are exactly the same ones e.g., a scheme 1010 will become two 1010 and two 0101 after the duplicate .In order to keep the uniqueness of all schemes, a procedure that checks the repetition and deletes the repeated schemes is then applied.After the above operation, the problem of adjusting nonmaximum crew roster scheme becomes
iii The Generation of Initial Crew Tostering Plan The set covering problem above can be solved by various mature algorithms, such as genetic algorithm, ant colony algorithm, and algorithms based on the application of column generation principle, and interested readers are referred to the related references 13-15 .
By solving the set covering model, an initial crew rostering plan with minimal crew members arranged can be obtained accompanied by the scenario where some of the crew legs may be covered more than once.We assume that crew leg i is covered k i times in the solution of set covering problem, then the initial feasible crew rostering plan of this problem will be obtained by deleting k i -1 extra covers of crew leg i randomly.Using the opposite process of the duplication while all crew legs appear only one time during the solution, then, the crew rostering plan based on the original description is obtained with minimal crew members.
Phase 2. Adjustment for equalized workload based on the ideology of simulated annealing.
When designing the algorithm for most equalized workload of crew roster schemes, two concepts are defined firstly.

Feasible Swap
In the kth day of crew rostering plan, while the crew roster schemes obtained by swapping the jobs work or rest of crew member i and j still satisfy all the restrictions, the operation adopted is called as a feasible swap.

Positive Swap
A feasible swap is called a positive swap while the equilibrium of workload has improved after the adoption of this swap the variation of equilibrium Δ i is a positive number .On the contrary, a feasible swap, which reduces the equilibrium, is a negative swap.
According to the definitions, the essence of the adjustment of nonmaximum crew roster scheme is to improve the equilibrium of workload by finding and adopting positive swaps, until a crew rostering plan with high equilibrium is found.For providing a relative lager searching space, ideology of simulated annealing is merged in the designed algorithm, which means that the selection of negative swaps is allowed in the operation.
The details of the algorithm are as follows.
Step 1.Let the initial temperature t equal t 0 , the start day k for searching feasible swap equals 1, calculate the working time T i of each crew roster scheme in initial crew rostering plan, the average working time T * of all crew roster schemes, and the equilibrium of initial plan.
Step 2. Search all feasible swaps from the first crew roster scheme at day k.
Step 3. Let k k 1, if k > T, which means that all feasible swaps has already been found and turn to the next step, otherwise, turn to Step 2.
Step 4. Calculate the variation Δ i of each feasible swap, and then calculate the probability P i for each swap to be selected.
Step 5. Select a feasible swap by probability P i , the probability for accepting the swap selected equals 1 when the variation Δ i is a positive number, and equals P accept when the variation Δ i is a negative number.Record the swap used and update the equilibrium of crew rostering plan, and then turn to next step.This step is repeated once the selected swap is refused because the probability P i is lower than P accept .
Step 6. Implement the update of temperature by the update function and determine whether the updated temperature reaches the lowest point t min .Turn to next step if the temperature equals t min , otherwise, let k equals 1 and return to Step 2.
Step 7. Once the adjusting process of the equilibrium of all crew schemes is finished, the best crew rostering plan is outputted.
The parameters in the simulated annealing algorithm above are similar to the common usage except the selection probability of feasible swaps which is described here only.Assume that there are n feasible swaps at one status in Step 5 of the algorithm above, then the probability P i for choosing feasible swap i is represented as follows: where Δ min is the minimal variation of workload equilibrium of all feasible swaps, which is usually a negative number.Δ i is the variation of workload equilibrium of feasible swap i. ε is a small positive number used to ensure that the probability of the feasible swap with minimal variation does not equal zero.In the algorithm designed above, the probability for the acceptance of negative swap is relatively high when at a high temperature and reduced gradually with the decreasing of temperature.When the temperature reaches the lowest level, this probability tends to zero and the algorithm converges finally.

Numerical Example
According to the operational characteristics of China high-speed railway currently, this paper generates several crew legs as the basic data to work out the crew rostering plan with given cycle.Assume that the earliest starting time and the latest ending time of all crew legs are 6:00 and 24:00, respectively, which will be 360 and 1440 when represented by minute.The working time of each crew leg equals the time span between start time and end time.The connection time standard between two crew legs is 960 min, and all crew legs start and end at the same crew base.The details of the 24 generated crew legs are shown in Table 3, in which the start time, end time, and working time of all crew legs are represented by minute.
First, with the data generated above, this paper works out a crew rostering plan with the cycle of 8 days, in which 6 days are for working and 2 days for rest, the results are shown in Table 4.It is easily obtained from Table 4 that the 4 crew roster schemes in the crew rostering plan are all maximum crew roster schemes which means each scheme contains 6 crew legs that equals the working time criterion.Under this circumstance, the adjustment procedure is not needed and the number of crew members arranged in the crew rostering plan equals the product of the plan cycle and the total number of crew schemes, which has already been minimal and the plan can be executed with high regularity.
Moreover, the crew legs above are used to work out a crew rostering plan with the cycle of 7 days in which 5 days for work and 2 days for rest, the outcome obtained by the decomposition of crew legs is shown in Table 5.
It can be concluded from Table 5 that the previous 4 crew roster schemes are all maximum schemes, and the crew members used in each scheme are equal exactly to the cycle of the crew rostering plan.The 5th crew roster scheme see the last row in Table 5 is a nonmaximum crew roster scheme.If still using 7 crew members to undertake this scheme at this time, one or more crew members will be not required actually.Actually, the lower bound of crew members needed for the last crew roster scheme is 4 × 7 /5 6.Therefore, the second phase is needed to adjust the 5th crew roster scheme.The initial crew rostering plan is worked out with the crew legs in the 5th crew roster scheme by the algorithm designed in Section 4.3.The initial crew rostering plan of adjustment of nonmaximum crew roster scheme is shown in Table 6, in which the number 0 represents no crew leg is assigned to this crew member on this day.It is obvious that the crew member arranged to the 5th crew roster scheme is 6 which is equal to the lower bound of the crew member needed.However, the accumulated working time varies from 1271 min to 2123 min, and the proportionality is not optimal.In order to improve the proportionality, the algorithm based on the ideology of simulated annealing is used and the improved crew rostering plan is shown in Table 7.
After the adjustment of the initial crew rostering plan, the variations of accumulated working time among all crew roster schemes are relatively small, and the proportionality of the plan is much better than before.

Conclusion
This paper studies the compilation method of crew rostering plan with given cycle of highspeed railway lines.By merging two different compilation principles, the problem is divided into two subproblems which are the crew legs partitioning problem and the adjustment of nonmaximum crew roster scheme.The division of the problem gives consideration to both of the complexity for compilation and the convenience for execution, and the algorithm designed is effective for finding an optimal solution.By studying this problem, we found that under the assumption that each crew member undertakes at most one crew leg in a day, the lower bounds of crew members needed are m/T w × T and m × T /T w when work out the crew rostering plan with the two forms discussed in the beginning separately, respectively.While compiling the crew rostering plan by merging the two strategies, which is used in this paper, the lower bound is m/T w × T m − m/T w × T/T w .When m/T w is an integer, the value of all lower bound are equal no matter what compiling pattern we use, and the minimal crew members arranged may be still equal.The compiling method of crew rostering plan put forward in this paper has its own advantages, but unexpectedly, sacrifices both objectives to some extent.The algorithms applied in this paper can also be used separately when working out the crew rostering plan with single requirement.When compile crew rostering plan by set covering model, it should be aware that the scale of the problem will affect both the difficulty of the algorithm design and the execution efficiency.

Table 1 :
A crew rostering plan with given cycle of 9 days.

Table 2 :
Duplication of feasible crew roster scheme.

Table 3 :
Details of generated crew legs.

Table 4 :
Crew rostering plan with the cycle of 8 days.

Table 5 :
Crew rostering plan with the cycle of 7 days.

Table 6 :
Initial crew rostering plan of adjustment of non-maximum crew roster scheme.

Table 7 :
Optimal crew rostering plan of adjustment of nonmaximum crew roster scheme.