Heuristics to Solve the Integrated Airline Crew Assignment Problem

Article Info Abstract Keywords: air transportation airline crew assignment combinatorial optimization heuristics A typical problem related to airline crew management consists of optimally assigning the required crew members to planned flights for a given period of time, while complying with a variety of labor regulations, safety rules and policies of the airline. This problem, called crew assignment problem (CAP), is of the NP-Hard class. So, it is usually divided into two independent subproblems, crew pairing problem (CPP) and crew rostering problem (CRP), modeled and solved sequentially. This division does not provide a global treatment to the CAP in terms of total cost and quality of the final solution. The state of the art involves the integrated solution of CAP, with both subproblems (CPP and CRP) solved simultaneously. It still requires high computational effort. Its combinatorial nature makes it difficult (or even impossible) to be solved by exact methods. The methodology proposed in this research provides an integrated solution of the CAP with heuristic procedures. The methodology was tested to solve instances related to small and medium-sized Brazilian airlines. The results were also compared with those obtained through an exact model adapted from the literature. Introduction This paper presents the main results of a research addressed to solve the crew assignment problem (CAP) with a proposed heuristic procedure. The importance of this type of approach is given by the combinatorial nature of the problem, which turns it impossible to be solved through exact models for large instances. The proposed heuristics presented results equal to or better than those obtained by exact models for the tested instances related to small and medium-sized Brazilian airlines (up to 894 flights and 36 crew members), with reduced CPU times (less than 5 seconds). Exact models led to feasible solutions in instances with up to 656 flights and 20 crew members. The CAP treated in this paper is defined as the problem of assigning the required crew members of the same category (only technical crew, in this case) to a set of flights of a given aircraft type, such that it minimizes the total cost of the aircrew, taking into consideration the proper legislation and the satisfaction of the crew members. CAP has been decomposed in the literature into two subproblems, both of which are solved sequentially: crew pairing problem (CPP) and crew rostering problem (CRP). The CPP seeks to provide an optimal set of pairings …


Introduction
This paper presents the main results of a research addressed to solve the crew assignment problem (CAP) with a proposed heuristic procedure.The importance of this type of approach is given by the combinatorial nature of the problem, which turns it impossible to be solved through exact models for large instances.The proposed heuristics presented results equal to or better than those obtained by exact models for the tested instances related to small and medium-sized Brazilian airlines (up to 894 flights and 36 crew members), with reduced CPU times (less than 5 seconds).Exact models led to feasible solutions in instances with up to 656 flights and 20 crew members.
The CAP treated in this paper is defined as the problem of assigning the required crew members of the same category (only technical crew, in this case) to a set of flights of a given aircraft type, such that it minimizes the total cost of the aircrew, taking into consideration the proper legislation and the satisfaction of the crew members.
CAP has been decomposed in the literature into two subproblems, both of which are solved sequentially: crew pairing problem (CPP) and crew rostering problem (CRP).The CPP seeks to provide an optimal set of pairings that covers all the planned flights.Then, in the CRP, the best combination of rosters (composed by the pairings of CPP and other activities) to crew members is determined, seeking the optimal coverage of planned flights and, eventually, the balancing of the total flying time among the crew members (Andersson et al., 1998;Barnhart et al., 2003;Kohl and Karisch, 2004;Gopalakrishnan and Johnson, 2005).
Pairing (or crew rotation) is the work accomplished by crew member starting and ending at the same home base, featuring a cycle.A pairing can be formed by one or more duty periods, which are series of sequential flights comprising a workday for a crew member.
Subproblems CPP and CRP are usually modelled as a set partitioning (or covering) problem, and solved through approaches based on heuristics or metaheuristics.The exact methods are only used for small-sized problems (Andersson et al., 1998;Barnhart et al., 2003;Cabral et al., 2000;Kohn and Karisch, 2004;Gopalakrishnan and Johnson, 2005;Lucic and Teodorovic, 2007;Maenhout and Vanhoucke, 2010).
This decomposition does not incorporate all the crew members' attributes (availability, qualification, seniority and individual preferences), which does not lead to a real cost estimate.In the CPP, the total cost of the selected pairings is minimized, but the real cost of the crew schedule can only be calculated after the assignment of the pairings to the different crew members is accomplished, i.e. after the CRP is solved.Moreover, the availability of the different crew members is not considered in the CPP solution.Thus, conflicts may arise during the assignment of rosters to the crew members in the CRP, originating extra costs and affecting the quality of the final solution.
The state of the art of CAP involves an integrated solution, with both subproblems (CPP and CRP) solved simultaneously.
Approaches for an integrated solution of the CAP are still at an early stage of development in the literature.Zeghal and Minoux (2006), Souai and Teghem (2009), and Gomes and Gualda (2010) proposed integrated strategies in which the rosters of the crew members are formed from grouping the duty periods (instead of the pairings) with other activities, such as day offs, training periods, medical exams and others, thereby skipping the intermediate phase to obtain a pairing solution and leading to a more realistic solution.Zeghal and Minoux (2006) formulated the CAP as a large scale integer linear program, replacing the set partitioning (and covering) models.Since a feasible integer solution was not obtained in some test problems, the authors also proposed a heuristic approach based on a rounding strategy embedded in a partial tree-search procedure.The heuristic method achieved a better trade-off between solution quality and computational effort.Souai and Teghem (2009) adopted a hybrid genetic algorithm in which the crossover and mutation operators were applied alternately (instead of sequentially).Gomes and Gualda (2010) proposed a hybrid genetic algorithm inspired on the approaches introduced by Zeghal and Minoux (2006) and Souai and Teghem (2009), but incorporating new mechanisms for generating the initial population, crossover operator, and local search.Saddoune et al. (2011) developed a bi-dynamic constraint aggregation method to solve the CAP in one stage that exploits a neighborhood structure when generating columns (rosters) in the column generation method.However, this method does not take into account pre-assigned activities to the crew members such as vacations and training periods or crew member preferences.
This paper is organized as follows.Section 1 presents the problem description.Section 2 describes the proposed heuristics, and in Section 3 the results of tests and practical applications are reported.

Problem description
Each flight requires a technical crew composed of a pilot (or instructor) and a co-pilot (or instructor).An instructor is a pilot who can replace a pilot or a co-pilot when needed.
Each crew member has an individual calendar of availability, which takes into account a set of previously assigned activities (such as training periods, vacation, medical exams, days off, alert duties and reserve duties).In addition, each crew member is stationed on a home base (or crew base), which is the location where he receives the days off.
In some cases, crew members can fly as passengers in a duty period.This type of flight is called a deadhead.Deadheads are typically used to reposition a crew member to a city where he/she is needed to cover a flight, or to enable the crew member to return to his home base at the end of a duty period.
Crew members receive a fixed salary related to a minimum number of flight credits (minimum guarantee), and an additional salary for extra flight credits exceeding the minimum guarantee.The flight credits are hours of flight and the equivalent ones for ground activities such as training periods, union meetings, and others.Besides, crew members receive daily meals (breakfast, lunch, dinner and supper) when they are working or are available to the airline.Airlines also pay the rest periods (transfer and hosting) out of their home bases.
CAP constraints are derived from labor regulations, collective agreements, safety rules and airlines' policies, and can be classified into two types: regular and additional ones.The regular constraints are obligatory, i.e. must be satisfied to constitute a legal solution.The additional constraints are optional and improve the quality of the solution.

Proposed heuristic
A constructive heuristic based on the optimization of duty periods coverage is proposed.Duty periods are series of sequential flights comprising a crew member's workday.They can represent both the activities related to flights operation and ground activities.
Duty periods related to both flights operation and days off are enumerated in an initial stage of the constructive heuristic.Duty periods related to the other activities are pre-assigned to crew members as CAP data input.The model includes attempts to balance flight credits and to attend crew demands for days off or duty periods in specific dates.

Solution
CAP solution is represented by a matrix = ( ) | |×| | , where is the set of crew members and is the set of days in the planning horizon.A cell takes a positive and integer value ∈ ∪ ∪ ∪ , which means that crew member is assigned to duty period on day .Value uniquely identifies each duty period during the solution of CAP and is sequentially defined in the initial enumeration of the duty periods (Sections 2.2 and 2.3).
In this case, is the set of duty periods related to flights operation ∈ that start on day ( = ⋃ ∈ ), is the set of duty periods related to days off that start on day ( = ⋃ ∈ ), is the set of duty periods related to preassigned activities (and obligatory) to crew members ∈ on day ( = ⋃ ∈ ), and is the set of duty periods related to activities (and not obligatory) requested by crew members ∈ on day ( = ⋃ ∈ ).The constructive heuristic does not guarantee the coverage of all planned flights and deadheads can be used.Hence, the cost of the solution is penalized as per number of non-covered and over-covered flights.
The total cost of the solution is computed through a mathematical model based on Zeghal and Minoux (2006), whose objective function has been modified to be more flexible to cover the flights (allowing the non-coverage or over-coverage of a flight), and to incorporate crew satisfaction criteria: where ! is the total cost of solution ?; / # is the cost of assigning crew member to duty period ; $ # takes value 1 if crew member is assigned to duty period and zero otherwise; , is the cost of flight credit exceeding the minimum guarantee of crew member (crew member's variable salary); -./ is the number of extra flight credits of crew member ; 1 2 is the penalty associated with non-coverage of flight i; 3 2 is the number of crew members that are additionally needed to satisfy the crew requirements of flight ; 6 2 is the penalty associated with over-coverage of flight ; -2 is the number of extra crew members assigned to flight ; is the bonus associated with seniority of the crew member ; ; is the total number of flight credits assigned to the crew members.
Term 1 of Equation ( 1) represents the cost associated with duty periods, which / # is computed through Equation ( 2): where @ # is the daily meals cost for assigning crew member to duty period ; A # is the rest period cost for assigning crew member to duty period ; B # is the artificial cost associated with the number of aircraft swaps in duty period .
Term 2 corresponds to the cost associated with extra flight credits that exceed the minimum guarantee.Term 3 is the penalty related to non-covered flights and term 4 is the penalty related to over-covered flights.In summary, 3 2 represents the number of crew members that must be contracted by the airline to cover flight (or determines the cancellation of flight ) and -2 represents the number of extra crew members used to cover flight .
The crew satisfaction is treated in terms 5 and 6.Term 5 is a bonus for meeting the crew members' requests of days off or duty periods in specific dates; it takes into account the seniority criteria.Term 6 includes the balancing of the flight credits among the crew members.The minimum number of flight credits assigned to each crew member increases with the minimization of −; (i.e. the number of flight credits will be closer to the average value of the flight credits, which corresponds to the total credits of the flights network divided by the number of crew members).

Enumeration of the duty periods associated with flights operation
A method based on the parallel version of the savings heuristic introduced by Clarke and Wright ( 1964) is adopted to enumerate duty periods associated with flights operation.Thus, it seeks to reduce the number of crew members needed to cover all flights.
At first, each flight ∈ represents a duty period and must be assigned to a distinct technical crew.Then, iteratively, duty periods are aggregated based on savings 2 = 2D + D − 2 , where 2 is the savings achieved by aggregating flights and in the same duty period, 2D is the debrief time of flight in city /, D is the brief time of flight in city /, and 2 is the time interval between flights and .

Enumeration of the duty periods associated with days off
Duty periods associated with days off are enumerated through a method which examines the opportunities available of day off after the end of duty periods.
At first, for any day ∈ , a set * = { : ∈ ∪ ∪ } is built with the duty periods related to flights operation ∈ , pre-assigned activities and crew members' requests.Then, each duty period ∈ * is examined.If the destination airport of the current duty period ∈ * is a home base, a new duty period ∈ related to day off is enumerated, considering: the start time equal to end time of duty period ∈ * plus the minimum interval (rest period) between two consecutive duty periods; the departure airport equal to arrival airport of duty period ∈ * ; and, the elapsed time equal to 24 hours.This method controls the viability of new duty periods ∈ and does not allow the enumeration of repeated duty periods.

Constructive heuristic
The constructive heuristic iteratively explores days ∈ , wherein the schedule is built to the first day of the planning horizon, then for the second, and so on.The method is finished when all crew members are assigned.
For each day ∈ , the construction of the solution begins with the enumeration of both duty periods related to flights operation and days off.Besides, the set of crew members ∈ able to receive an assignment on day is determined.Crew members ∈ are sorted in an ascending order of priority assignment, considering four groups: first, crew members ∈ * ⊆ who must receive a day off on day to satisfy the days off constraints per period or per month; second, crew members ∈ 0 ⊆ who must receive a day off until +1 (i.e. must receive a duty period on day allowing the return to their home base, or receive a day off on or +1); third, crew members ∈ 5 ⊆ who must receive a duty period or a day off on to satisfy a pre-assigned duty period on day +1 or +2 and to keep the solution feasible, in terms of sequence in the time and space; fourth, crew members ∈ 7 ⊆ who must not receive a duty period or day off on to keep the solution feasible.
The assignment of duty periods and days off to the crew members of the first three groups is prioritized in relation to the fourth group.The maximum number of consecutive days in which a crew member can work without receiving a day off and the minimum number of days off that a crew member must receive per month are used to determine if a crew member ∈ must or must not receive a day off on or +1.The fourth group is further sorted in an ascending order of accumulated flight credits.This strategy seeks to reduce the unbalance of flight credits among the crew members.In the assignment of a new duty period, for example, the crew member with the lowest number of accumulated flight credits will have priority over all others.Finally, the coverage of flights ∈ is updated (extra crew members can be used).
Therefore, the constraints of the crew members (in terms of number of days off and sequence in time and space) are prioritized in relation to constraints of the flights coverage, since a solution with non-covered flights is not unfeasible.

Tests and practical applications
Tests were run on a microcomputer PC Intel Core i5-2500K, 3.30 GHz, with 4 GB of RAM under the Microsoft Windows© 7 (Professional) operating system.
Three solution methods were compared: the integer linear programming model proposed by Zeghal and Minoux (2006), with duty periods exhaustively enumerated through the depth-first search adopted by Gomes and Gualda (2010), called Exact-DFS; the integer linear programming model proposed by Zeghal and Minoux (2006), with duty periods enumerated through the method introduced by Clarke and Wright (1964), called Exact-CW (see Section 2.2); and, the constructive heuristic (with the same duty periods of Exact-CW), called Heuristic.Note that the Zeghal and Minoux (2006) model was adopted with a modified objective function (Equation 1 in Section 2.1).
Exact models were solved through the optimization package Gurobi© Optimizer 5.0.2 without changing the execution parameters (including parallel processing), but with processing time limited to 3,600 seconds (1 hour).
The enumeration procedures of duty periods (depth-first search and Clarke and Wright method) and the constructive heuristic were implemented in C, using the Microsoft Visual Studio© 2010 (Professional), without taking into account parallel processing techniques and with unlimited processing time.

Results
Tests results are shown in Table 1 for seventeen instances created based on the network of two Brazilian airlines (A and B).In this table, the mean deviation of flight credits assigned to the crew members is computed by -J -3 J = ∑ K./ − ./LLL K/| | ∈ , where ./ is the number of flight credits assigned to crew member and ./LLL = ∑ .//| | ∈ is the mean of flight credits assigned to crew members.NJO% is the percentage interval between the value of objective function of the best solution obtained and the lower bound calculated by Gurobi© software.

Table 1 -Test results
The Exact-DFS model, with the duty periods enumerated through depth-first search, led to optimal solution (or near to optimal) only in 6 instances (A-02, A-03, A-07, B-08, B-11 and B-12).For other instances, the solutions obtained presented a gap higher than 42%.In the larger instances (B-14, B-15 and B-16), a feasible solution was not obtained, since a high number of non-covered flights was observed.In B-17, the method was not able to obtain an initial feasible solution.; 4 A gap equal to 0% represents that the obtained solution is optimal; *A feasible solution was not obtained in Gurobi© software; **An initial solution was not obtained in Gurobi© software.
The Exact-CW model, with the duty periods enumerated through the Clarke and Wright (1964) method (see Section 2.1), presented a better performance due to the reduction in number of duty periods (variables) associated with flights operation.In this case, the Exact-CW model led to the optimal solution in 6 instances (A-02, A-03, B-08, B-11, B-12 and B-13) and to near optimal solution in 2 instances (A-04 and A-07).In instances B-14, B-15 and B-16, the number of noncovered flights was reduced significantly.An initial feasible solution was obtained in the B-17 instance, but the high number of non-covered flights does not allow its implementation in practice.
The constructive heuristic led to optimal solutions in 6 instances (A-02, A-03, B-08, B-11, B-12 and B-13), to near optimal solutions in 2 instances (A-04 and A-07) and to better solutions than those obtained with the exact models for the other instances.In larger instances (B-14, B-15, B-16 and B-17), a feasible solution was obtained without non-covered flights.
Regarding the balance of flight credits among the crew members, the constructive heuristic led to the best solutions, with mean deviations less or equal than those of the exact models in 5 of the 7 instances (A-02, A-03, A-07, B-08, B-11, B-12 and B-13) when non-covered flights are not considered.

Conclusion
Crew assignment problem (CAP) is of fundamental importance for the airlines operational planning.It belongs to the NP-Hard class of problems.In this research, a model based on heuristic procedures was proposed.The model allowed the formulation and the solution of the crew pairing problem (CPP) and of the crew rostering problem (CRP) simultaneously.
The model encompasses a constructive heuristic and two enumeration heuristics.The constructive heuristic was based on the optimization of duty periods coverage, considering the regular and additional constraints.It included attempts to balance flight credits and to attend crew demands for days off or duty periods on specific dates.Enumeration heuristics were used at the initial stage of the constructive heuristic to enumerate duty periods related to both flights operation and days off.Duty periods related to the other activities were pre-assigned to crew members as CAP data input.
The total cost of the solution was computed through a mathematical model adapted from Zeghal and Minoux (2006), whose objective function was modified to allow the consideration of non-coverage and/or over-coverage flights and to incorporate crew satisfaction parameters.
The proposed heuristics for the integrated solution of the CAP presented results equal to or better than those obtained by the exact models (Exact-DFS and Exact-CW) in the tested instances related to Brazilian airlines (up to 894 flights and 36 crew members), with very small CPU times (less than 5 seconds).These methods can be used to solve small and mediumsized instances and to provide an initial solution for more sophisticated methods (such as meta-heuristics) in large instances.The exact models led to feasible solutions in instances with up to 656 flights and 20 crew members.