Planning and management of aircraft maintenance using a genetic algorithm

The process of planning and management of aircraft maintenance is one of the key processes determining the effective functioning of an organization (both military and civil) dealing with air transport. Effective planning [14,20] and management of ac maintenance[23,40,47] is aimed at ensuring the continuity of the process of transport tasks. Aircraft maintenance planning at work has been defined as the determination of maintenance schedules, i.e. the days of directing of the ac to the maintenance facility together with the indication of the facility carrying out the maintenance, while maintenance management has been defined as the assignment of crew (personnel) to the maintenance facility. Maintenance may be performed at the airport where the aircraft is operated or at specialist maintenance facilities located outside the stand of the aircraft. Both the crew assignment and the identification of the maintenance facility is a decision making issue depending on technical factors such as the distance of the airport from the maintenance facility, or economic factors such as the cost of repair at the facility or the cost of maintenance carried out by personnel. While an aircraft is performing its tasks, it is used [10]. The duration of the ac use depends, among other things, on type of ac and the number of tasks performed, which are determined by the number of flights from a specific airport to which ac is assigned. Each type of aircraft is limited by the permissible duration of use. Therefore, the comprehensive approach to solving the problem of the aircraft maintenance planning and management proposed by the authors of the article is presented in the form of four phases, Fig. 1. Keywords


Introduction
The process of planning and management of aircraft maintenance is one of the key processes determining the effective functioning of an organization (both military and civil) dealing with air transport. Effective planning [14,20] and management of ac maintenance [23,40,47] is aimed at ensuring the continuity of the process of transport tasks.
Aircraft maintenance planning at work has been defined as the determination of maintenance schedules, i.e. the days of directing of the ac to the maintenance facility together with the indication of the facility carrying out the maintenance, while maintenance management has been defined as the assignment of crew (personnel) to the maintenance facility. Maintenance may be performed at the airport where the aircraft is operated or at specialist maintenance facilities located outside the stand of the aircraft. Both the crew assignment and the identification of the maintenance facility is a decision making issue depending on technical factors such as the distance of the airport from the maintenance facility, or economic factors such as the cost of repair at the facility or the cost of maintenance carried out by personnel.
While an aircraft is performing its tasks, it is used [10]. The duration of the ac use depends, among other things, on type of ac and the number of tasks performed, which are determined by the number of flights from a specific airport to which ac is assigned. Each type of aircraft is limited by the permissible duration of use. Therefore, the comprehensive approach to solving the problem of the aircraft maintenance planning and management proposed by the authors of the article is presented in the form of four phases, Fig. 1.

Keywords
This is an open access article under the CC BY license (https://creativecommons.org/licenses/by/4.0/) aircraft operation, maintenance, multi-criteria optimization, genetic algorithm.
The aim of the article was to develop a tool to support the process of planning and managing aircraft (ac) maintenance. Aircraft maintenance management has been presented for scheduled technical inspections resulting from manufacturers' technical documentation for ac. The authors defined the problem under investigation in the form of a four-phase decisionmaking process taking into account assignment of aircraft to airports and maintenance stations, assignment of crew to maintenance points, setting the schedules, i.e. working days on which aircraft are directed to maintenance facilities. This approach to the planning and management of aircraft maintenance is a new approach, unprecedented in the literature. The authors have developed a mathematical model for aircraft maintenance planning and management in a multi-criteria approach and an optimisation tool based on the operation of a genetic algorithm. To solve the problem, a genetic algorithm was proposed. The individual steps of the algorithm construction were discussed and its effectiveness was verified using real data. The phases shown can be described as follows: Phase 1 -Assignment of a certain number of aircraft of a given type to a given airport. All ac must be assigned to the airports. The limit is the number of ac at a given airport. Phase 2 -Decision to direct the aircraft for maintenance based on the maintenance schedule. Phase 3 -Assigning the aircraft to relevant maintenance facilities. Phase 4 -Assigning crews to maintenance facilities.
In phase 1 of the aircraft maintenance planning and management, aircraft must be allocated to airports in such a way that the difference between the ac's permissible operating hours and the operating hours resulting from the tasks assigned is maximum. This guarantees a long service life of the aircraft and thus fewer decision-making situations resulting from directing the ac to the maintenance facility. The assignment of ac to airports with different flight demand intensity affects the service life of a particular aircraft and thus the moment/time when maintenance is required (Phase 2). This emphasizes the fact that the phases shown in Figure 2 are closely interrelated and the decisions taken in each phase influence the decisions in the subsequent phases. The main factor influencing the process of ac maintenance planning is the time (day, month) of making a decision to direct the ac to the maintenance facility. This decision may be made within the permissible time of the ac use, in case of exceeding the calendar operating life, maintenance must be carried out absolutely. In the case of ac maintenance planning and management, it is important to indicate such time, e.g. the date on which the aircraft is being directed to the maintenance facility. The decision to direct the aircraft to the maintenance facility when it is fit for performance of tasks is essential. The ac must be directed to the maintenance facilities in such a way as to ensure that a minimum number of aircraft capable of completing all the tasks assigned are available each day.
The number of crews assigned to a maintenance facility depends on the number of stations intended for performance of ac maintenance. The crews may serve different maintenance facilities depending on the maintenance demand. The function of the criterion in the assessment of the crews assigned to the maintenance facility is the cost of the maintenance depending on the type of maintenance performed.
The mathematical model for the management of ac maintenance developed in point 3 supports the assignment of the aircraft type to an airport by minimising its intensity of use, the assignment of aircraft for repair, the assignment of the repair crew and the determination of optimum moments at which maintenance is to be performed. In order to determine ac maintenance schedules, an optimization tool based on the operation of a genetic algorithm was developed, determining the analysed problem in a multi-criteria approach. Genetic algorithms are representatives of heuristic algorithms. The necessity of applying heuristic algorithms in the analysed problem is dictated by the fact that the computational complexity of the problem of planning and managing aircraft maintenance increases exponentially, non-linearly (introduction of an additional airport, additional maintenance facility, additional crew generates exponential increase of decision variables solving the given mathematical model). For this reason, classical methods and algorithms solving linear decision-making problems do not work in this problem. The exponential nature of the problem classifies it into problems described in the literature as NP-Hard [41].
The presented innovative optimization tool based on a genetic algorithm solves the examined problem in a multi-criteria approach according to the adopted global criterion function consisting of partial criterion functions. The application of classical multi-criteria optimisation algorithms is difficult due to two aspects [5]: the problem is NP-Hard and in the presented mathematical model the decision variables are variables of different types (binary and integer). It is therefore advisable to develop new optimization tools, adequate to the solution of the problem under investigation.
The following thematic issues were distinguished in the article: a thorough analysis of the state of the art on the issue of ac maintenance planning and management was carried out, a mathematical model was presented with defined input data, variable decisional constraints and criterion functions, a genetic algorithm was described and its correctness was verified on real data.

Literature review
In the context of optimisation problems, aircraft maintenance management is a complex decision-making issue consisting of the problem of allocation of resources to tasks [32], which may concern different transport areas [10,17,19,18] and the problem of scheduling repair actions for individual aircraft over a certain period of its operation [36]. In the case of aircraft maintenance, the issue of allocation concerns the assignment of aircraft to airports where transport tasks are carried out [3,8], the assignment of aircraft to maintenance facilities where maintenance tasks are carried out [9,31,38] and the assignment of crew to maintenance facilities [1]. The issue of assignment of resources to tasks as well as construction of work schedules are optimization problems widely discussed in operational research or graph theory. In general, the assignment of resources to tasks consists in such assignment of resources, e.g. equipment, employees to the commissioned tasks, that the profit resulting from the assignment of these resources to tasks is optimal. Profit is usually defined as the cost or time of task performance. Limitations result from the number of resources allocated or tasks performed. The problem with schedule preparation, on the other hand, is to arrange the tasks for individual contractors in such a way that the profit also aims at optimal value. It is therefore crucial to determine the start and end points of the tasks. These points can be defined by hours, days or months.
The problem of ac maintenance planning and management in the literature is mainly analysed in the context of problems connected with planning and organization of the aircraft operation and assigning it to particular tasks in situations of failure of the aircraft performing current transport tasks [37,39]. Maintenance planning is defined as the determination of actions necessary to restore the aircraft to operational condition such as ordering missing parts, assigning staff to maintenance operations [36]. Maintenance of aircraft is often determined on the basis of reliability models of damage of individual components leading to the shutdown of the aircraft. At work [46,51] the authors have developed a model for assessing the reliability of aircraft analysing the periods in which the aircraft will operate without failure. Further models assessing the reliability of aircraft are described in [42,43]. The linear model for damage forecasting and maintenance schedule setting is presented in publications [11,12] and a stochastic model of damage forecasting for aircraft with a non-linear target function taking into account the relationship between repair costs and failure costs is presented in the publication [6]. A risk analysis and a study of the impact of the maintenance organisation on task delays, flight cancellations and safety during combat are presented in [28,29,35]. An important aspect of aircraft maintenance planning is to organise maintenance in such a way as to be able to maintain continuity in the performance of tasks, so it is important to take into account the availability of resources in the planning process [22,26,37]. In the publication [34] the authors have developed an algorithm for aircraft routing, taking into account reliability aspects, in order to mitigate the impact of unexpected events, which is important for planning and organising aircraft maintenance. Maintenance planning is one of the stages in the development of flight schedules that take into account the time of departure and arrival of the aircraft at the airport, the time of transfer of the crew, rest times as well as the time of possible repair or maintenance [38,39]. Aircraft maintenance involves assigning personnel to specific maintenance activities [2,44]. The quality of maintenance depends on human errors, maintenance management models in terms of identifying staff errors are described in [25]. The optimisation of personnel planning for aircraft operation using integer programming models is presented in [1]. A model for the allocation of technical personnel to maintenance services, taking into account their qualifications, their maintenance certificates, their skills, is presented in [48,49]. The application of multi-criteria support in the selection of the decision to allocate service crews to maintenance services using the AHP method is described in [4], while the use of evolutionary algorithms to determine the multi-criteria assignment problem is described in [33]. Computer simulations are carried out to model the aircraft maintenance [1,13], which are an effective tool for assessing the quality of the maintenance provided.
After analysing the literature, it can be concluded that maintenance publications mostly focus on the stage of determining aircraft performance reliability, i.e. determining the probability of failure, the maintenance organisation stage is reduced to the procurement of materials and spare parts only [7,21] and the assignment of staff to the maintenance without taking into account the mobility of maintenance staff to other maintenance facilities.
Having analysed the literature, it can also be concluded that, most of the publications concern random maintenance events, the management of maintenance resulting from scheduled technical inspections as defined in the aircraft manufacturer's technical documentation is not analysed.
Many authors analyse the issues of damage reliability and spare parts order planning using artificial neural networks [27,24]. The use of neural networks in aircraft maintenance planning and management may be the subject of further research.

Mathematical model for aircraft maintenance planning and management
In order to develop a mathematical model, the following determinations of data and parameters of the research problem were introduced: -the permissible operating time of the aircraft type as specified by the manufacturer (number of flight hours); tp(s,n) -the lower limit of the aircraft operation after which the aircraft can be directed for maintenance (number of flight hours); tk(s,n) -the upper limit of the aircraft operation before which the aircraft should be directed for maintenance (number of flight hours); α(s,n,v,t) -number of flight hours (flight intensity) to be performed by the aircraft of a given type on a given day of operation at a given airport, value determined on the basis of the schedule of planned flights (number of flight hours);

N1(s,v)
-the number of aircraft of the type necessary for the tasks to be performed at the airport, this number shall include the surplus resulting from the decommissioning of aircraft at the expense of maintenance;

N2(v1,o)
-number of maintenance stations at a given maintenance facility intended for a given maintenance service; -required number of aircraft on a given day of operation at a given airport; d ((s,n),v,t) -the average distance travelled on a given working day by the aircraft of a given type assigned to a given airport; d1 (v,v1) -the distance between the airport and the maintenance facility; ks(s,n) -unit cost of fuel consumption for given aircraft; ko (s,o,v1) -the cost of operating a given maintenance station for a given type of vessel carrying out a given service; to(o,s,n) -the maintenance time for aircraft of a given type, expressed in days, assumed by a given airport to which the aircraft is assigned; this time is needed to establish the aircraft's continuous operation schedules for each working day; ta (s,v1,o) -the time of the aircraft's stay at a particular maintenance facility providing the maintenance service, this time is determined by the maintenance facility; -the accepted distance of allocation to a given maintenance facility from a given airport; -the cost of the execution of a given maintenance service by a given crew at a given maintenance facility; The problem is, as already pointed out in item 1 of the Article, planning and managing aircraft maintenance in such a way that aircraft of a particular type can be assigned to a particular airport with a view to minimising the intensity of its operation and identify the maintenance facilities for aircraft with the assignment of the maintenance crew and the determination of the optimum times for maintenance to be carried out. For such a problem three types of binary variables and one type of natural variable, i.e. variable forms, were defined: -a binary variable specifying the assignment of ac of a particular type to a particular airport, , 1 x s n v = when ac of a certain type is assigned to a particular airport, , , , , : , , , , , , , , , -a binary variable specifying the assignment of ac of a particular type to a maintenance facility at a particular airport on a particular working day for the provision of a service, ( ) ( ) 2 , , , , 1, 1 x s n o v v t = when a given ac type is assigned to a maintenance facility that carries out the service of that type on a specific working day, -a natural type variable specifying the day in the schedule, e.g. the first, second day of directing the aircraft of a particular type to a maintenance facility;  -a binary variable specifying the assignment of the crew to a maintenance facility on a particular day, performing the particular type of the maintenance service, when the crew has been assigned on a given working day to a maintenance facility carrying out a particular type of service, The limitations and boundary conditions of a solution to a decision-making problem concern: the allocation of the number of aircraft of a given type to a given • airport: particular aircraft that can only be assigned to one airport: the maintenance must be carried out within a given period of • time: the allocation of the number of aircraft to a given maintenance • facility carrying out the type of service: the distance from the allocation of aircraft to a given maintenance • facility: the maintenance time assumed by the airport must be greater than • or equal to the maintenance time offered by the maintenance facility: the required number of aircraft carrying out tasks on a given • working day: , , , , , , , the required number of crews at a given maintenance facility: the assignment of crews to aircraft, the number of aircraft subject • to maintenance at a given facility shall be equal to the number of assigned crews: assignment of crews to aircraft maintenance facilities, crews may • be assigned to only one maintenance facility on a given working day: The values of decision variables are therefore sought for the global function of the character criterion: to take the extreme, with the individual partial functions of the criterion defined as follows: Minimising aircraft operating time at all airports, the greater 1.
the difference between the permitted operating time of an aircraft type and the operating time at a given facility, the longer the operating time of individual aircraft: F X x s n v te s n s n v t s n s v t 1 1 1 (13) Fuel consumption: 2.
Costs associated with the operation of aircraft, i.e. the cost of 3.
transport plus the costs associated with the commissioning of the maintenance station: The cost of assigning the crew to a maintenance facility: 4.

General assumptions
Genetic algorithms have been applied as a practical optimization tool in complex decision-making problems, e.g. in the problem of a travelling salesman [30,45], assignment of tasks to contractors [15] setting the work schedules [50] or in the problems of location [16]. The main advantages of genetic algorithms that dominate over other optimization algorithms are the ability to search for the optimal point not from a single location in the search plane, but from multiple locations and to rely on information determined by the adaptation function rather than derivatives. Based on function values, criterion is a valuable advantage of genetic algorithms. It should be stressed that the genetic algorithm is one of the heuristic methods that provide nearoptimal solutions. Despite these inconveniences, genetic algorithms are successfully used in optimization problems. The genetic algorithm is an iterative algorithm, so the generated solution improves with each passing to the next iteration. Each individual in the population is assessed according to its adaptation function. The stages of the genetic algorithm developed for aircraft maintenance optimisation can be presented as: -Stage 1. Determining the structure processed by the algorithm. A matrix structure was used to represent the chromosome in allocation problems in transport issues. Such a structure of input data works successfully in complex decision-making problems, e.g. in the problem of a travelling salesman. The matrix structure determines all decision variables developed in the mathematical model. The matrix structure of the chromosome was randomly generated according to developed algorithms taking into account all the limitations of the mathematical model. The initial population consists of a certain number of matrix structures determined at the beginning of the algorithm. -Stage 2. Determining the adaptation function. The adaptation function is a function that evaluates a given structure. Based on the adaptation function, the final solution is determined. -Stage 3. Selection. The selection process in the genetic algorithm consists of selecting the best individuals (chromosomes) from the initial population to the next generation. The developed algorithm uses the roulette method, in which linear scaling was applied to counteract premature algorithm convergence in the initial iterations. Scaling coefficient C= 2.0 has been adopted. The principle of the roulette method consists in determining the probability of selecting a single chromosome (matrix structures) from a given population, and then determining the distribution function for each chromosome. The next step of the selection algorithm is to draw the number r from the range [0.1]. A k-th chromosome is selected with a distribution function value of q k fulfilling the dependence q k -1 < r ≤ q k . -Stage 4. Crossover. The algorithm for selecting chromosomes for crossover takes into account the whole process of selecting chromosomes for crossover, in the case of chromosome oddity it randomly selects the chromosome to pair, randomly pairs the two chromosomes, randomly selects the cutting points of the chromosomes and activates the crossover algorithm (exchanging structures between two chromosomes) adequate to the proposed matrix structure. -Stage 5. Mutation. The mutation process involves the exchange of genes in a given chromosome structure. Stages 1-2 are one-off stages, occurring at the beginning of the algorithm's operation, stages 3-5 are repeated with a certain number of iterations until the stop condition is reached. The stop condition is a certain number of iterations. The assessment of individuals is carried out on the basis of the adaptation function, which is developed based on the function of criteria.
The crossover and mutation algorithms occur with a certain probability defined as input data. The final effect of the genetic algorithm is a generated population that determines the optimal setting of decision variables in the mathematical model. The final structure is selected from the structures generated in the last iteration of the algorithm and has the highest value of the adaptation function of all structures.
In order to obtain correct results generated by the genetic algorithm, the sensitivity of the algorithm to changes in the input parameters, i.e. the likelihood of crossover and mutation, must first be analysed. The sensitivity analysis is carried out on the basis of a fixed set of input parameters, which are entered into the genetic algorithm. The quality of generated solutions depends on properly selected parameters. The maximum value generated by a genetic algorithm in a sensitivity analysis indicates the parameters of the algorithm that have determined this value. In the second place, the verification process of the genetic algorithm should be carried out. The process of verifying the genetic algorithm was carried out on the basis of comparison of the algorithm solutions with those obtained by means of a random algorithm. The number of comparisons is determined at the beginning of the algorithm verification.
If a random algorithm determines a better solution, the sensitivity step should be performed for a different set of parameters. If a genetic algorithm has generated a better result in each comparison with a random algorithm, the verification process is completed. The initial population of the algorithm was generated in a random way according to the assumptions presented when creating the chromosome structure.

Chromosome structure
The chromosome structure is a matrix structure and has been divided into four parts. Each of them is a representative of the decision variable of the mathematical model. It should be noted that the structure developed refers to a specific type of maintenance. The aircraft and crew are selected for assignment to a particular maintenance facility for the type of service already specified. Graphic interpretation of the chromosome structure processed by the genetic algorithm for the weekly aircraft operation schedule is shown in Figure 2.
In the first part, aircraft of different types are assigned to airports, the decision variable X1 is determined. The number of rows determines the number of aircraft of all types, while the number of columns determines the number of airports. Binary values are taken at random assuming that one aircraft can be assigned to one airport (formula 2), and a specific number of aircraft of a given type can be assigned to each airport (formula 1). Cells with a value of "1" indicate the assignment of a given type of aircraft to a given airport.
In the second part of the chromosome structure, the date of the aircraft's directing to a given maintenance facility is determined, the TPOCZ decision variable is determined. The lines of the structure have an interpretation of aircraft, the columns indicate the days of the week in the airport operating schedule. Binary values are taken at random, subject to the limit of checking the time interval when the aircraft is allowed to be directed for maintenance (Model 3, 4). Time windows are created in the schedule, in which the aircraft should be assigned to a particular maintenance facility. The creation of a given time window is optional and depends on whether the aircraft reaches the lower limit of use in a given week of the schedule. One binary value "1" is required in each time window. The size of the time window depends on the type of aircraft, the intensity of its use on a given working day. After selecting the moment when the aircraft is directed to the maintenance facility, its maintenance time is determined (blue genes in Fig. 2). For each set of aircraft assigned to airports a limitation of the required number of aircraft remaining at the airport and performing the assigned tasks is checked (Model 8).
In the third part of the structure, the allocation of aircraft to maintenance facilities is determined, the decision variable X2 is determined. The lines of the structure define the aircraft and the columns define the maintenance facilities. The binary values are adopted at random taking into account the limitations of the assignment of the number of aircraft to a particular maintenance facility (formula 5). Aircraft are assigned to such maintenance facilities which comply with the limitations of distance from airports (formula 6) and maintenance duration (formula 7). The number of substructures referring to the third part depends on the number of aircraft to be directed for maintenance in the second part. Each subsequent substructure for the third part applies only to those aircraft which are maintained in the overlapping period of time or which are maintained consecutively from one day to the next, e.g. in Figure 2 directing of aircraft no. 8 on the seventh day would introduce a new substructure referring to the third part and consequently another substructure referring to the fourth part.
In the fourth part, crews are assigned to the maintenance facilities concerned, the decision variable X3 is determined. The lines of the structure define the crews and the columns define maintenance facilities. Binary values are adopted at random taking into account the limitations of the required number of crews at a given maintenance facility (formula 9), the assignment of crews to aircraft (formula 10) and the assignment of crews to maintenance facilities (formula 11). It should be taken into account that the sum of all ones in the fourth part must be equal to the sum of all ones in the third part according to the limitation that the number of aircraft maintained in a given facility is equal to the number of crews assigned (formula 10).

Adaptation function
Based on the adaptation function, the genetic algorithm determines the final solution. According to the principle of genetic algorithm, this algorithm seeks maximum solutions. Taking this into account the different types of criteria functions included in the mathematical model, the adaptation functions for the k-th matrix structure M(i, k) may be presented as follows (K = {1, ..., k, ..., K}-a set of structures in the population, i -iteration of the algorithm): where:

( ) 2min
Fi -the minimum value of the structure from the entire population in a given iteration for the fuel consumption minimising function; ( )

3, F ki
-a function with an interpretation of the aircraft maintenance cost function designated for each structure in the iteration (formula 15); Fi -the minimum value of the structure from the whole population in a given iteration for the aircraft maintenance cost function; ( )

4, F ki
-a function with an interpretation of the cost of assigning crew to a maintenance facility designated for each structure in a given iteration (formula 16);

( ) 4min
Fi -the minimum value of the structure from the entire population in a given iteration for the cost of assigning crew to a maintenance facility function; Bearing in mind that a genetic algorithm seeks the maximum value of the adaptation function, and in order to be able to add values of partial functions of different types to each other, the adaptation function should be presented as follows: the first quotient of the adaptation function aims at the value "1" when the function ( ) 1, F ki is located in the quotient meter, other partial functions F ki set minimum values while maximising the adaptation function when placed in the denominator. The range of values taken by the adaptation function is in the set (0.4> . The value "4" is only achievable if each partial function of the criterion reaches its optimal value at the same time.

Crossover and mutation
The crossover process begins with a random selection of two chromosomes (matrix structures). In order to carry out the crossover process it is required to determine the crossover parameter. Crossover parameter determines the probability of how many individuals will be crossed. The crossover probability is determined at the beginning of the algorithm. With the chromosomes to be crossed, they are randomly combined into pairs. If an odd number of chromosomes is drawn, a randomly selected chromosome from the population must be added to complete the set to be crossed. The crossover process consists in drawing two cutting points identical to both chromosomes in relation to columns and rows in each substructure. Between these points, the Graphic interpretation of the crossover process is shown in Fig. 3a,  Fig. 3b, Fig. 3c. Since Parts II, III and IV are interrelated and the results in Part II determine the settings of the subsequent parts of the structure, only those lines of the structure that were drawn in Part II are selected for the crossover process for Parts III and IV. The cutting points for the columns are selected randomly. After the crossover process, a situation may occur where an incorrect structure is created that does not take into account all the limitations of the mathematical model, e.g. in Fig. 3b for Part Four in chromosome I the limitation (10) is not fulfilled because crew no. 6 is assigned to the maintenance facility to which no aircraft has been assigned in Part Three. The repair algorithm for Parts Three and Four checks the individual columns of these substructures for the limitation (5) for Part Three, i.e. the number of aircraft assigned to the maintenance facility, and in the event of an exceeding, it randomly eliminates the value "1" indicating the assignment of the aircraft to the maintenance facility until the limitation is met (5). In addition, the limitations of the distance from these facilities to the airports (formula 6) and the time of maintenance (7) are checked. If these limitations are not met, the algorithm removes the assignment. In Part Four, the sum of ones for the individual columns corresponding to maintenance facilities is to be equal to the sum of ones for the individual columns of Part Three according to the limitation (10). When the number of ones in Part IV is greater than in Part III, the algorithm randomly eliminates them until both values are equal. Where the number of ones is less, the algorithm will randomly assign the crews to a particular maintenance facility, taking into account the limitation to the required number of crews at the particular maintenance facility (9) and the assignment of crews to aircraft maintenance facilities (11). The structure of the chromosome after the repair process is shown in Fig. 3c (red values in Part IV are the values modified by the repair algorithm). The repair algorithm for Part I of the structure, when the limitation (1) for the required number of aircraft of a given type at a given airport is not met, adds another aircraft at random to the airport taking into account the limitation (2) that one aircraft is assigned to one airport. If the limitation (1) is exceeded, it randomly removes the selected assignment also taking into account the limitation (2). The repair algorithm for Part II comes down to correcting the time window limitations (3,4) and determining at random a new date of service if these limitations are not met. In addition, the algorithm removes the day on which a aircraft is assigned for maintenance if the aircraft is not assigned to any airport in Part I.
The mutation process consists in random selection of the part of the chromosome where the mutation is to take place and then the gene to mutate and random conversion from "0" to "1" or vice versa. Graphic interpretation of the mutation process is shown in Figure 4a and Figure 4b. In the case of an erroneous structure generated after the mutation process, a repair algorithm is started which works identically to the crossover process.

Input data
In order to verify the genetic algorithm determining the decision variables presented in the mathematical model, it has been assumed that there is one type of maintenance for one type of aircraft. Twelve aircraft are considered for use at four airports, two ac are used at each airport on each working day, one ac is used as an auxiliary in case the other one is directed for maintenance. It was assumed that there are five crews and six maintenance facilities available. There are two maintenance stations at each maintenance facility. The permissible service life of the ac is shown in Table 1. Data on the operation of the ac on each day of its operation were extracted from the aircraft continuing airworthiness information system database providing information on aircraft operations. A flight schedule of fifteen working days has been adopted, the number of flight hours of aircraft at each airport is shown in Table 2. It was assumed that in the analysed schedule of flights on each working day there is a possibility to send each ship for maintenance. The distance covered by individual aircraft is shown in Table 3, to simplify the recording of data, this distance is assumed to be the same for each day of the schedule (Table 3 shows only distances for the first day of the aircraft operation). The unit combustion cost of aircraft of a given type is presented in Table 4. The distances between the airport and the maintenance facility are shown in Table  5. It is assumed that all maintenance facilities are active and aircraft can be directed to them. The maintenance time forecast by the airport is 3 days.
The cost of commissioning a given maintenance facility and the maintenance time are shown in Table 6. The costs associated with hiring a given crew to perform the maintenance at a given maintenance facility are shown in Table 7.

Sensitivity analysis and verification of the genetic algorithm
The genetic algorithm has been implemented in programming language C#. The first step in performing a sensitivity analysis of the algorithm is to find a set of the best parameters that generate the best solution. The parameters taken for analysis included the probability of crossover p krzyż , the probability of mutation p mut . As a result of the experimental studies, the population number of 50 individuals and the number of iterations of 200 were determined. The algorithm parameters to be tested include the crossover operator assuming five values p krzyż = 0.2; 0.4; 0.6; 0.8; 1 and the mutation operator assuming three values p mut = 0.01; 0.03; 0.05. The following combinations were tested to determine the best parameter settings, Table 8. The best results generated in each parameter setting are shown in Table 9.
The sensitivity analysis showed that the best results were generated taking into account the following parameters: crossover parameter -0.8 and mutation parameter 0.05. An example of the operation of a genetic algorithm for selected settings of crossover and mutation input parameters is shown in Fig. 5 respectively. The best solutions are generated with a crossover parameter of more than 0.8, due to the complexity of the research problem and the need to search for new space of solutions that can generate optimal or suboptimal solutions. The lower probability of crossover generates worse solutions, because there is no competition between individuals in the population and thus no search for new areas generating suboptimal solutions. In addition, with small values of the crossover parameter, there is a risk of passing from the local optimum of worse quality than the algorithm determined in the initial iterations (Fig. 5 c and 5). The presented examples emphasize the fact that the key role in generating suboptimal or optimal results is played by the process of selection of parameters of the genetic algorithm. These parameters are selected in an experimental way. The moment of convergence of the algorithm to the optimum depends also on the proper selection of the algorithm input parameters, which can be observed in Fig. 5 a and b. (convergence to optimum in 150 iterations -(a) and 50 iterations -(b)). In order to verify the correctness of the genetic algorithm (AG), its results generated for the parameters: crossover -0.8 and mutation -0.05 were compared with random values generated by a random algorithm (AL). Random values are the values of chromosomes generated by the genetic algorithm before the crossover and mutation process according to the assumption that the initial population was generated at random. The value of the adaptation function for each algorithm is shown in Table 10. By analysing the results below, it can be concluded that the genetic algorithm in each comparison generated a better result than the random algorithm. Genetic algorithms belong to probabilistic algorithms, so they generate different, approximate final results. It is therefore recommended that several final solutions are identified and a maximum solution is selected. The adaptation function with the highest value is generated by decision variables for which the functions of the mathematical model criterion reach optimal values in     the sense of the Pareto solution. In the analysed example, the adaptation function reaches a value of 3.66 four times, which may indicate a suboptimal value. An example of the chromosome structure in graphic form is shown in Fig. 6. According to the structure presented, three aircraft are assigned to each airport. Aircraft number 1, 4, 6 and 9 have been assigned to maintenance. These aircraft are assigned to maintenance stations as follows: aircraft no. 1 to maintenance station no. 3, aircraft no. 4 to maintenance station no. 4, aircraft no. 6 to maintenance station no. 2, aircraft no. 9 to maintenance station no. 5. The following crews have been assigned to maintenance facilities: crew no. 1 to maintenance facility no. 2, crew no. 2 to maintenance facility no. 4, crew no. 4 to maintenance facility no. 5, crew no. 5 to maintenance facility no. 3.

Conclusions
In the article the problem of aircraft maintenance planning and management for scheduled maintenance specified in the manufacturer's technical documentation is presented in a comprehensive way taking into account not only the phase of assignment of aircraft to maintenance stations located in different facilities but also the phase of assignment of aircraft to airports, the phase of maintenance scheduling (days) as well as the phase of assignment of crews to maintenance of the aircraft types. The multi-criteria approach to the presented mathematical model additionally emphasizes the complexity of the analysed issue.
The effectiveness of the proposed genetic algorithm was verified by means of a random algorithm. The sensitivity analysis emphasized the fact that the process of selecting the input parameters characterizing the genetic algorithm is an experimental process. The number of iterations, population size has also been experimentally determined. Both the mathematical model and the genetic algorithm are new approaches of analysing a given research problem, so it is not possible to compare it with results generated by other optimisation algorithms. The mathematical model and the proposed optimisation algorithm can serve as a test function for other algorithms.   In the genetic algorithm, the classic roulette method was used to select individuals for the next generation. Further research may include testing of subsequent selection methods with the use of other selection algorithms described in the literature. The initial population was generated at random. Experiments are carried out to generate the initial population with other heuristic algorithms, e.g. ant colony optimization algorithm, which can improve the effectiveness of the genetic algorithm and the quality of generated solutions. In addition, the further direction of research may comprise the inclusion of random events in the model in the form of sudden failures and unplanned repairs.