Integrating Flight Scheduling, Fleet Assignment, and Aircraft Routing Problems with Codesharing Agreements under Stochastic Environment

: Airlines face the imperative of resource management to curtail costs, necessitating the solution of several optimization problems such as ﬂight planning, ﬂeet assignment, aircraft routing, and crew scheduling. These problems present some challenges. The ﬁrst pertains to the common practice of addressing these problems independently, potentially leading to locally optimal outcomes due to their interconnected nature. The second challenge lies in the inherent uncertainty associated with parameters like demand and non-cruise time. On the other hand, airlines can employ a strategy known as codesharing, wherein they operate shared ﬂights, in order to minimize these challenges. In this study, we introduce a novel mathematical model designed to optimize ﬂight planning, ﬂeet assignment, and aircraft routing decisions concurrently, while accommodating for codesharing. This model is formulated as a three-stage non-linear mixed-integer problem, with stochastic parameters representing the demand and non-cruise time. For smaller-scale problems, optimization software can effectively solve the model. However, as the number of ﬂights increases, conventional software becomes inadequate. Moreover, considering a wide array of scenarios for stochastic parameters leads to more robust results; however, it is not enabled because of the limitations of optimization software. In this work, we introduce two new simulation-based metaheuristic algorithms for solving large-dimensional problems, collectively called “simheuristic.” These algorithms integrate the Monte Carlo simulation technique into Simulated Annealing and Cuckoo Search. We have applied these simheuristic algorithms to various problem samples of different ﬂight sizes and scenarios. The results demonstrate the efﬁcacy of our proposed modeling and solution approaches in efﬁciently addressing ﬂight scheduling, ﬂeet assignment, and aircraft routing problems within acceptable timeframes.


Introduction
The airline industry is highly competitive, especially with the emergence of low-fare airlines.It is characterized by variable demand, high operating costs, heavy traffic, and strict regulations, all of which contribute to the tight competition in the market.Furthermore, an airline's sole product is its aircraft seats, which are not sold until the flight takes off.Therefore, managing supply and demand fluctuations effectively is a significant challenge for airline companies.Accurate models and solution methodologies with narrow margins of error are necessary to address this issue [1].
Airline operation planning is a complex process of making decisions with many important decisions that directly affect a company's profitability.The planning process is divided into sub-problems to manage these decisions [2].The flight scheduling (FS) problem defines the frequency of flights to each destination and how the flights should be planned to meet this frequency.The fleet assignment (FA) problem assigns fleets to appropriate flights, while the aircraft routing (AR) problem creates flight route plans for each aircraft, considering that maintenance constraints.The crew scheduling (CS) problem involves determining the crew members for each flight [3].
Airline companies aim to expand their airline networks to provide passengers with a wider range of destinations, regional connections, and seamless travel experiences with minimal schedule disruptions.However, achieving these goals often involves large investments in purchasing or leasing new aircraft and hiring additional crew members.Alternatively, airline companies can establish codeshare agreements with each other to reduce costs and improve their network coverage.
A codeshare agreement (CA) is a business arrangement between two airlines.One of them can market a flight that is operated by another airline on or off its network, without using their own aircraft.This airline is called a marketing carrier.The other airline operating the flight is called the operating carrier [4,5].These agreements are made as a result of alliances between two companies, and they allow airlines to expand their flight targets without incurring the huge costs associated with acquiring new aircraft.CAs provide more flight opportunities within an airline's network, which benefits both customer satisfaction and reduces delays.Additionally, such agreements lead to increased mutual revenues and market shares for the companies [6].
This study aims to simultaneously solve the FS, FA, and AR problems considering CA.It also creates airline schedules that affect profitability while assigning the most suitable fleet types to flights.This improves the company's service quality and profitability.
The paper is organized as follows: Section 2 includes a literature review of the FA, FS, and AR problem.Section 3 defines the problem and provides a new mathematical model.Section 4 introduces the proposed solution methods and includes a small sample.Section 5 presents computational experiments.Finally, Section 6 concludes the article and discusses future studies.

Literature Review
Airlines aim to maximize their profits by providing the optimum combination of fleet type and passengers' demand.Assigning an aircraft that is smaller than the required passenger capacity to a flight leads to a direct loss of customers due to capacity insufficiency.Conversely, assigning an aircraft that is larger than the required passenger capacity to a flight can result in unsold seats.As a result of this, it causes an inability to sell the seats and reduce operating profits.Therefore, the FA problem is a crucial decision for an airline's planning strategy [7].With this motivation, this study examines the FA problem, and Table 1 summarizes the features that contribute to the development of the problem and the studies that investigate these features.
There have been numerous studies on the FA problem in the literature since 1971.While the models of Abara [8] and Hane et al. [9] have contributed to the development of solutions to the problem, their applicability is limited due to certain assumptions such as fixed departure times for the same flight every day and deterministic passenger demand, which do not reflect real-life variability.Clarke et al. [10] developed a solution by incorporating the maintenance planning (MP) of aircraft at stations and crew issues into the FA model.
Berge and Hopperstad [11] suggested the re-flying concept to address demand fluctuations and used the demand-based dispatch approach to make capacity flexible allowing for fleet type assignments to occur closer to take-off.Talluri [12] extended their work in terms of opportunities and computation times.Levin [13] provided flexibility to the FA problem by allowing for variable take-off times and he was the first researcher to consider varying departure times with binary constraints by using integer programming.However, this model did not exclude the aircraft capacity and multiple fleet types.Rexing et al. [14] increased the flight connectivity possibilities by using a time window (TW) for departure times and optimizing time windows according to specific time zones.Belanger et al. [15] minimized the number of aircraft in the fleet by determining the fleet size (FSD).Thus, it aims for the utilization of the fleet (FU) optimally.ZEGHAL ET AL. [16] have addressed a flexible aircraft fleeting and routing problem, which is motivated by the Tunisian national carrier TunisAir.Flexible fleet (FF) is the ability to expand the fleet by renting an aircraft.Thus, more flights can be served.Barnhart et al. [17] considered the passenger demand based on an itinerary (IFAP) and passenger spill and rescue costs and analyzed the profitability of the model by taking into account the effect of the flight network.In real-life scenarios, unexpected situations and disruptions can occur, so it is necessary to create robust models.Rosenberger et al. [18] developed a robust model using the hub-and-spoke network structure and produced short cycles sensitive to flight cancellations.The robustness of such an assignment and rotation has been demonstrated by using simulations of airline operations.Cadarso and Marín [19] proposed a robust model for the integrated FS and FA problem that takes into account the number of misconnected passengers.The model uses the exponential distribution of passenger connection times (PCTs) to calculate the probability of passengers missing their flight.
Smith and Johnson [20] proposed the concept of station purity (SP) by limiting the number of fleet type or crew-compatible families.Because each airport cannot serve each fleet type, Sherali et al. [21] developed a demand-driven re-flight model that dynamically reassigns the fleet type.Jacobs et al. [22], Dumas et al. [23], and Pilla et al. [24] relaxed the deterministic assumptions set by the basic FA problem.Sherali and Zhu [25] developed a two-stage stochastic programming model for the FA problem.Pilla et al. [26] explicitly evaluated the passenger demand by including direct demand scenarios in Sherali and Zhu's [25] model.Naumann et al. [27] explained the uncertainty in demand as well as the uncertainty in fuel prices.Cadarso and Celis [28] developed a stochastic model that considers demand uncertainty (SD) and discrete passenger choice models for the FS and FA problem.The model aims to maximize the airline's profits while minimizing the number of misconnected passengers.The passenger spill and rescue effects are also modeled and it focuses on the probability of passengers choosing a route.Atasoy et al. [29] proposed a similar integrated model based on discrete choice models.
Different to the common features used in the FA problem, Pita et al. [30] considered airports with the slot constrained (SC) in their study.The slot can be defined as the row/time allocation to an aircraft.The aim is to reduce large delays by controlling air traffic.Kenan et al. [31] assigned fleets to flights which have stochastic demand and stochastic fare (SF) based on fare classes.Sherali et al. [32,33] emphasized the importance of considering fuel consumption (FUEL) in airline optimization decisions.Gürkan et al. [34] integrated the cruise time controllability (CTC) of the aircraft using cruise speed adjustments into FA and AR problems.Jamili [35] integrated all three decisions into a single model, but also developed flight programs from the ground up and addressed the issue of fleet type route delays by introducing buffers.Safak et al. [36] took into account passenger connection times, fuel consumption, and CO 2 emission costs associated with cruise speed settings by integrating the three decisions.
Kenan et al. [6] integrated CA into the FS, FA, and AR problems.It highlights that such agreements can significantly affect an airline's profit by using fewer aircraft, fewer delays, and more flights.They also added optional flight legs (OF) to the model, which can be canceled according to demand changes.Şafak et al. [37] developed a three-stage stochastic programming model for the FS, FA, and AR problems.Cacchiani and Gonzalez [38] aggregated the FS, FA, AR, and CS problems.Xu et al. [39] proposed an integrated model for the FS, FA, and AR problems that allows for spreading delays, on-demand flights, and passenger spills.The spill passenger (SPP) is the number of passengers who cannot be served for any flight.
Kenan et al. [6] and Şafak et al. [36,37,40] have made significant contributions to solving the FA problem.However, Kenan's study did not detail the costs related to passengers in the model, only considering the delay costs (DC) in the objective function.Şafak et al. [36,37] have discussed costs in detail, and CTC has been used to compensate for the uncertainty of non-cruise time (NCTU).However, different costs have been incurred by increasing the cruise time for new flights or leasing alternatives.
The objective of this study is to maximize the profitability of airline companies, which hinges on the revenue generated from ticket sales to passengers.To efficiently serve a greater number of passengers on each flight, it is imperative to assign appropriate fleet types.Assigning aircraft with a lower capacity than the demand may result in unserved passengers, constituting a spill passenger cost.Furthermore, ensuring timely departures and arrivals is crucial to enhancing passenger satisfaction levels.Delays caused by aircraft idling at airports can lead to disruptions in consecutive flights.These delays, in turn, may cause passengers to miss their connections, especially when the required connection times cannot be met on connecting flights.The impact of these factors on the service quality translates into costs for the companies.Operational costs are incurred by companies for the use of aircraft on each flight, necessitating revenue generation above these costs to ensure profitability.For flights that may not be profitable on their own, companies can opt for less expensive CA to mitigate costs.To the best of our knowledge, there is no study in the literature that handles stochastic demand and stochastic non-cruise times on delays while also considering the impact of CA on the FA problem.This study aims to fill this gap by providing the following main contributions:

•
The development of a new third-stage stochastic non-linear programming model that combines FA with operational FS decisions and AR problem using codesharing agreements.

•
The consideration of stochastic demand and stochastic non-cruise times simultaneously in the model.

•
Turnaround time: It is the time required for a fleet type to prepare for flight.This period includes the cleaning of the aircraft, passenger, and baggage movements.

•
Cruise time is the time of flight that falls between climb and descent.

•
Non-cruise time: It is the sum of the taxi in and out times between an aircraft's landing and take-off.In other words, it is the time that the aircraft moves on the ground.

•
Tax in: It is the duration of the aircraft moving towards the apron after landing.

•
Taxi out It is the duration of the aircraft moving from the apron to the take-off field.

Problem Description
In order to effectively tackle the complex FA problem, it is imperative to consider the interrelated decisions pertaining to FS and AR while also accounting for codesharing agreements.To address the uncertainty associated with demand and non-cruise time, this study presents a novel and integrated approach that models the problem as a three-stage stochastic mixed-integer non-linear programming (TSS_MINLP) framework.
In line with union regulations, the airline industry necessitates operational decisions to be made 2-3 months prior to the scheduled flight.Similarly, codesharing agreements are strategic decisions that require meticulous planning well in advance.However, the uncertainty surrounding the demand for flights during this period poses a significant challenge (as highlighted by Kenan et al. [6]).Thus, this approach first focuses on making decisions regarding FA, routing, and CA for the previously scheduled flights, followed by determining the number of passengers to be accommodated as the flight date approaches, based on these decisions.Consequently, the fleet type route schedule is adjusted accordingly.Thus, the proposed three-stage decision-making model, illustrated in Figure 1, integrates the FA, FS, and AR decisions in a cohesive framework that effectively addresses the uncertainty associated with demand and non-cruise time.
Aerospace 2023, 10, x FOR PEER REVIEW 6 of 26 • Turnaround time: It is the time required for a fleet type to prepare for flight.This period includes the cleaning of the aircraft, passenger, and baggage movements.

•
Cruise time is the time of flight that falls between climb and descent.

•
Non-cruise time: It is the sum of the taxi in and out times between an aircraft's landing and take-off.In other words, it is the time that the aircraft moves on the ground.

•
Tax in: It is the duration of the aircraft moving towards the apron after landing.

•
Taxi out It is the duration of the aircraft moving from the apron to the take-off field.

Problem Description
In order to effectively tackle the complex FA problem, it is imperative to consider the interrelated decisions pertaining to FS and AR while also accounting for codesharing agreements.To address the uncertainty associated with demand and non-cruise time, this study presents a novel and integrated approach that models the problem as a three-stage stochastic mixed-integer non-linear programming (TSS_MINLP) framework.
In line with union regulations, the airline industry necessitates operational decisions to be made 2-3 months prior to the scheduled flight.Similarly, codesharing agreements are strategic decisions that require meticulous planning well in advance.However, the uncertainty surrounding the demand for flights during this period poses a significant challenge (as highlighted by Kenan et al. [6]).Thus, this approach first focuses on making decisions regarding FA, routing, and CA for the previously scheduled flights, followed by determining the number of passengers to be accommodated as the flight date approaches, based on these decisions.Consequently, the fleet type route schedule is adjusted accordingly.Thus, the proposed three-stage decision-making model, illustrated in Figure 1, integrates the FA, FS, and AR decisions in a cohesive framework that effectively addresses the uncertainty associated with demand and non-cruise time.The problem at hand can be divided into three main steps.The first step involves determining the flights that will be operated by the airline and those that will be operated under CA.Based on this, an appropriate fleet type is assigned to each flight, and the routes are created while accounting for the maintenance planning required for the fleet type.Once consecutive flights are completed, the starting and final stations for each aircraft are determined.
Moving on to the second step, the estimated departure time for the airline's flights is selected from a predetermined time window.This ensures that the departure time is optimized, keeping in mind the operational constraints and other factors that may influence The problem at hand can be divided into three main steps.The first step involves determining the flights that will be operated by the airline and those that will be operated under CA.Based on this, an appropriate fleet type is assigned to each flight, and the routes are created while accounting for the maintenance planning required for the fleet type.Once consecutive flights are completed, the starting and final stations for each aircraft are determined.
Moving on to the second step, the estimated departure time for the airline's flights is selected from a predetermined time window.This ensures that the departure time is optimized, keeping in mind the operational constraints and other factors that may influence the timing of the flight.
In the final step, the timetable of the routes assigned to each aircraft is updated, and the number of passengers to be carried by the aircraft is determined.This step is critical in ensuring that the aircraft is utilized optimally while adhering to safety standards and operational efficiency.By determining the number of passengers to be carried, the airline can ensure that the aircraft is optimally utilized, and that the entire operation runs smoothly.
Overall, this three-step approach, which involves determining flights and fleet types, optimizing departure times, and updating the timetable while considering passenger count, enables the airline to operate efficiently and effectively.
The problem has several assumptions which are given as follows: • The analysis of data obtained from the BTS [57] revealed that non-cruise times follows a normal distribution.

•
It is assumed that demand follows a uniform distribution with lower and upper parameters covering the minimum and maximum fleet type capacities.

•
The departure and arrival times of flights are also pre-determined.

•
A time window is used for departure times, and delays that exceed this time window result in additional costs that are included in the objective function.

•
Maintenance planning is conducted at either the first or the last airport.

•
Codeshare flights are not included in the airline's routes, and a specific budget is allocated for CA.

•
The cruising speed of the fleet type is allowed to vary at certain rates.

•
If there are connecting flights for passengers, a minimum time is given for passengers to switch to the next flight, and if this time is not sufficient, passengers miss their connections.

Mathematical Model
Aerospace 2023, 10, 1031 1) aims to maximize the expected profit of an airline, which is calculated as the difference between the income from passengers and the associated costs.The costs include flight cost per passenger, codeshare costs, cost of spilled passengers, fleet type idle time cost, delay cost, and passenger misconnection costs.Equations ( 2)-( 22) are constraints.The decisions of the first stage are determined by Equations ( 2)- (9).Equation ( 2) ensures that each planned flight leg is covered by exactly one fleet type, while Equation (3) maintains the route structure of the network.Equation ( 4) specifies that the total number of aircraft which is used should not exceed the number of aircraft available.Equations ( 5) and ( 6) identify the first and last airports of each fleet type.These airports serve as maintenance stations for the aircraft.Equation (7) ensures that the total investment in CA between operators and flight legs does not exceed the allocated budget.The airline being considered is a marketing carrier that operates its own flights and may also serve as the operator for other flights.Hence, Equation (8) specifies that the ratio of the total number of seats purchased to the total capacity of all available aircraft should not exceed the value of (θ).Equation (9) specifies that the number of codeshare flights should not exceed the number of the company's own flights.The second-stage decision is determined by Equation (10), which ensures that the announced departure time of the airline's own flights falls between determined lower and upper limits.Equations ( 11)-(21) determine the third-stage decisions of the model.Equations ( 11) and ( 12) allow for delays between the announced departure times of the first stage and the actual departure times.Since these delays can impact other flights on the route, they are considered as costs in the objective function.Equation ( 13) calculates the arrival times for each flight based on the actual departure times.Equation ( 14) determines the departure times of successive flights on a route, as well as the minimum idle times of fleet type.Equations ( 15) and ( 16) impose upper and lower cruise time limits for each flight.Equation ( 17) accounts for passengers who miss their connecting flights due to the absence of sufficient transit time, which creates a cost for the company.Equations ( 18) and (19) specify that the number of passengers admitted to a flight leg must not exceed the capacity of the aircraft or the capacity in the selected contract.Similarly, Equations ( 20) and (21) ensure that the number of passengers accepted on a flight leg does not exceed the demand for the flight leg.Finally, Equation (22) defines the domain of all variables.
The proposed model is subjected to a range of diverse scenarios, characterized by distinct levels of passenger demand and non-cruise time of flights.The resulting thirdstage decisions and corresponding objective function values exhibit significant variability across these scenarios.To effectively account for these real-world complexities, the model employs a probabilistic weighting approach.Specifically, the outcomes for each scenario are multiplied by their respective probabilities, and subsequently summed to derive the expected value of the objective function.This approach enables the model to incorporate and adapt to the diverse conditions encountered in practical settings.

Solution Methodology
Optimization packages are limited in their ability to solve the TSS_MINLP, especially when the number of flights and scenarios is increased.Therefore, the development of heuristic or metaheuristic methods is necessary [34][35][36]38,39,55].
Simheuristics are an extension of metaheuristics for solving optimization problems under uncertainty.They have been widely applied to different problems such as production planning, supply chain design, flexible flow shop scheduling, resource allocation, transportation, and healthcare scheduling [58][59][60][61][62][63].Simheuristics combine metaheuristics with simulation methods, allowing for stochastic variables to be considered in mathematical models [64].This means that a simheuristic algorithm includes a special simulation for stochastic variables, making them efficient and effective in overcoming stochastic optimization problems [65].In the proposed solution method, scenarios with varying demand and non-cruise times are generated using the Monte Carlo simulation method.

Simulated Annealing
Simulated annealing (SA) is a search algorithm that is inspired by the physical annealing process of a solid material.Physical annealing involves gradually cooling a heated solid to its minimum energy state [66].SA begins by performing a broad search of the solution space, accepting even suboptimal solutions with a high probability.As the algorithm progresses, it performs a more focused search around the current solution, with the goal of finding the global optimum.At each iteration, SA compares the current solution to a neighboring solution.If the neighboring solution is better, it is accepted as the new current solution.If the neighboring solution is worse, the algorithm may still accept it with a certain probability, to avoid getting stuck at a local minimum.The best available solution is also retained.The acceptance probability is based on the change in profit and the temperature parameters.This process is repeated at each temperature level, with the temperature gradually decreasing according to a predetermined cooling schedule [67].
SA is a stochastic search algorithm used to reach the global optimum hidden among local optima.It has the great advantage of having a diverse and deep neighborhood structure.It is also a simple and fast algorithm with few parameters [68].In the literature, strong results have been obtained in most applications [69].Therefore, this study uses SA as a metaheuristic method, integrated with the Monte Carlo simulation (MC).The flow diagram of the simheuristic method (SA + MC) is shown in Figure 2, and the detailed pseudocode is given in Algorithm 1.The flowchart is divided into smaller rectangles, numbered, and drawn with dashed lines to aid in explanation.The integration of SA and MC allows for the efficient and effective optimization of complex problems with stochastic variables.
Figure 2 provides an overview of the proposed methodology, which comprises several iterative stages.In the first red rectangle, an initial solution is generated by creating routes that are suitable for flights.Next, the fleet type with the closest capacity to the flight with the highest expected demand on each route is assigned to that route.The resulting assignment and routing decisions are evaluated using a short Monte Carlo simulation (e.g., 100 runs) to calculate the expected objective function value of the problem, as shown in the second red rectangle.

Cuckoo Search Algorithm (CS)
The CS algorithm draws inspiration from the aggressive breeding techniques employed by cuckoos.Cuckoos lay their eggs in the nests of other birds that are randomly selected.If the host bird discovers the cuckoo egg, it may either remove the egg or abandon the nest entirely.The eggs that survive form the next generation [70].
The study by Rakesh and Mahesh [71] describes the successful application of the nature-inspired cuckoo algorithm, with various variations, to comprehensive global optimization problems.CS has been shown to outperform other metaheuristics in terms of speed and accuracy in solving the traveling salesman problem (TSP) [72].Additionally, it has demonstrated a superior ability to find higher quality solutions for constrained optimization problems than genetic algorithm and particle swarm optimization.Its stochastic nature makes it particularly effective in exploring the search space, allowing for its successful application to highly constrained optimization problems such as job scheduling, multi-objective scheduling, flow shop scheduling, and TSP.However, in such problems, some modifications may be required to produce new solutions with Levy flights [73][74][75].New solutions can also be produced with the help of heuristics without using the Levy distribution.Gao et al. [76]'s study contains many examples.In this study, improved new solutions with local search heuristics (Algorithm 3) are produced without using levy flights.The local search (Algorithm 4) is also used in the SA + MC algorithm.
The CS algorithm initially starts with a certain number of candidate solutions, then evaluates new solutions and repeats a certain number of bad solutions.The search process in this solution space shows that it has potential to better balance exploitation and exploration.The algorithm has also fewer adjustable parameters [77].The reason for using CS is that it has these advantages along with its performance in the literature.
The flow diagram of the resulting simheuristic method (CS + MC) is shown in Figure 3.The detailed pseudo code of this flowchart is given in Algorithm 3. The flowchart is divided into small rectangles drawn with dashed lines and numbered to aid in explanation.
Figure 3 illustrates the multi-stage process of the proposed methodology for solving the airline profit maximization problem using the CS algorithm.In the first red rectangle, an initial solution equal in size to the population is generated, following the same approach as is depicted in Figure 2.
In the second red rectangle, the expected objective function value of each initial solution is calculated using a short Monte Carlo simulation (e.g., 100 runs).The initial population is then fed into the CS algorithm, as shown in the third red rectangle.
At each iteration, a randomly selected solution is updated using the local search algorithm outlined in Algorithm 4, as shown in the third red rectangle.The updated solution is then compared to another randomly selected solution from the population, and the best solution and objective function value are updated accordingly.This process is iteratively repeated until the stopping criterion is satisfied.
Finally, the objective function value of the best solution is updated using a long Monte Carlo simulation (e.g., 1000 runs), as shown in the fourth red rectangle.This comprehensive approach ensures that the optimal solution is robust and reliable, accounting for the inherent complexities and uncertainties of real-world airline operations.Figure 3 illustrates the multi-stage process of the proposed methodology for solving the airline profit maximization problem using the CS algorithm.In the first red rectangle, an initial solution equal in size to the population is generated, following the same approach as is depicted in Figure 2.
In the second red rectangle, the expected objective function value of each initial solution is calculated using a short Monte Carlo simulation (e.g., 100 runs).The initial population is then fed into the CS algorithm, as shown in the third red rectangle.
At each iteration, a randomly selected solution is updated using the local search algorithm outlined in Algorithm 4, as shown in the third red rectangle.The updated   The problem has been solved for two scenarios by using the GAMS/BARON optimization package and the proposed solution methods.The solutions, presented in Table 4, show that the GAMS/BARON and proposed solution methods have obtained the same assignments and routes for each scenario.According to the solution, Flights 1, 2, and 3 are codeshare flights and are operated with aircraft under the second type contract.Therefore, these flights are not included in the airport's route plan.Flights 4, 5, and 6 are operated by the airline's second type of aircraft, specifically, the A321-200.The expected objective function value has been obtained by averaging the objective functions of the scenarios.The results of the SA + MC and CS + MC are consistent with GAMS result.Therefore, the validation and verification of the proposed methods have been successfully completed.The detailed plan for each scenario that includes the actual departure time, actual arrival time, cruise time, idle time, delay time, and non-cruise time are listed in Table 5.

Data Descriptions
Four test problems have been generated using data obtained from the "Airline On-Time Performance Data" open access database (BTS) [57].The flight information has been filtered to include only flights departing and landing at Los Angeles City airport (LAX) from American Airlines.The resulting test problems have 30, 78, 127, and 180 flights, respectively, and include six fleet types.Table 6 provides general information about the fleet types used in the test problems.In the context of codeshare flights, the model assumes the existence of two contract types, which entail the operating carrier receiving 30% and 23% of the ticket price, respectively.The passenger capacities associated with these contracts are set at 56 and 80.To obtain the codeshare ticket prices, the model leverages data from the airline's website.It should be noted that the total passenger capacity on codeshare flights is subject to the constraint that it cannot exceed one third of the airline's overall aircraft capacity.
It is worth mentioning that the model relies on a number of parameters that have been previously determined by Şafak et al. [36,37].These parameters are critical to ensuring the validity and reliability of the model's outputs:

•
A 10 min tolerance period is added to the departure times.

•
The turnaround time of each fleet type is multiplied by the complexity coefficient of the airport for each flight and fleet type to obtain the turnaround time for that flight.

•
The connection time for the passengers is set at 30 min.

•
The highest and lowest cruise times are calculated by subtracting 20 min from the total flight time.The lowest cruise times are then compressed by 15% of the highest cruise time.

•
The profit from one passenger is defined as the basic spill cost of a lost passenger.The passenger spill cost for each flight has been calculated by multiplying the basic spill cost by the airport complexity coefficient.

•
The cost of a missed connection is set at USD 50 per passenger.
In order to solve the problem with 1000 scenarios, 30 flights, and 6 fleet types, the corresponding TSS_MINLP formulation has 704,532 constraints, 518,577 variables, and 3,122,383 non zeroes after the pre-solve is completed.This calculation also describes the complexity of the algorithm.As the size of the problem increases, it becomes more difficult to solve.Therefore, simheuristic solution methods have been used to solve the test problems.Based on experimental studies, the following parameters have been used for the SA algorithm: an initial temperature of 500, a final temperature of 10, a search for 100 neighbors in each step, and a temperature reduction ratio of 0.99.For the CS algorithm, the population size is set to 20, the rate of changing bad solutions is set to 0.2, and the maximum number of iterations is set to 500.

Computational Results
The proposed methods for solving large-scale problems have been implemented using a C# program and utilized to solve the test problems.Their performances have been compared by using the same stochastic values.Each test problem has been executed with 100 scenarios in a short simulation and 1000 scenarios in a long simulation, with the number of aircraft and flights per fleet type varying based on the problem size.The test problems have been solved using the proposed solution methods for the same total run times, and the best results have been given in Table 7.The number of algorithm runs during these periods and the results obtained in each run are presented in Figure 4a-d.The results indicate that CS + MC achieved better profits than SA + MC, possibly due to the CS algorithm's population-based approach, which expands the search space with more diverse solutions.Furthermore, unlike in Şafak's study [37], where scenarios have been grouped and tested, this study tested many scenarios using metaheuristics and obtained fast and effective results.ber of aircraft and flights per fleet type varying based on the problem size.The test problems have been solved using the proposed solution methods for the same total run times, and the best results have been given in Table 7.The number of algorithm runs during these periods and the results obtained in each run are presented in Figure 4a-d.The results indicate that CS + MC achieved better profits than SA + MC, possibly due to the CS algorithm's population-based approach, which expands the search space with more diverse solutions.Furthermore, unlike in Şafak's study [37], where scenarios have been grouped and tested, this study tested many scenarios using metaheuristics and obtained fast and effective results.

Effect of Codeshare Flights
To analyze the impact of the codesharing strategy, test problem 4 (180 flights) has been solved again without the codesharing option, and the obtained solutions are presented in Table 8.In these solutions, the number of single-flight routes represents the number of dead flights, which incur additional costs for the airline since the aircraft has to fly to the starting city of the other route without passengers.The solutions obtained by considering the CA for the same problem are given in Table 9, including the number of routes and the number of flights made with the CA.The effect of codesharing on the profits in each algorithm is shown in Figure 5a,b.These results confirm that codesharing has a significant contribution to increasing the airline's profit.Since airline operations have a complex structure, there are differences between the planned and actual schedule.Evaluating scenarios containing uncertainty can minimize these differences.The results obtained in this study were obtained by using many scenarios and two algorithms.Looking at the literature, software programs are available to simulate airline operations.For example, open data and open source simulation programs are available for air traffic management (AirTrafficSim, BlueSky).The programs quickly simulate operations and take into account a large number of scenarios.They are easy-to-use and accessible programs [78,79].The effectiveness of the results in the scenarios we produced in our study can be seen by testing them with such simulators.Additionally, better results can be achieved with more scenarios.Since airline operations have a complex structure, there are differences between the planned and actual schedule.Evaluating scenarios containing uncertainty can minimize these differences.The results obtained in this study were obtained by using many scenarios and two algorithms.Looking at the literature, software programs are available to simulate airline operations.For example, open data and open source simulation programs are available for air traffic management (AirTrafficSim, BlueSky).The programs quickly simulate operations and take into account a large number of scenarios.They are easy-to-use and accessible programs [78,79].The effectiveness of the results in the scenarios we produced in our study can be seen by testing them with such simulators.Additionally, better results can be achieved with more scenarios.

Conclusions
The aviation industry has witnessed a steady increase in demand owing to its speed, convenience, and reliability.Airlines face numerous challenges to serve a vast network of destinations.Foremost among these, there are the high costs of investing in a large fleet, personnel, and equipment.To mitigate these costs, airlines have resorted to forming strategic partnerships through codesharing, enabling them to leverage each other's flights.
In addition to this, airlines face the challenge of optimizing their operations across multiple domains such as FS, FA, and AR.While solving each of these problems independently may seem like an option, doing so may lead to local optima and increase operational costs.To overcome this, it is imperative to simultaneously address all these problems in a model that yields a more effective solution.
To address these challenges, this study proposes a novel model that integrates the FS, FA, and AR problems with codesharing options.Specifically, a three-stage stochastic nonlinear mixed-integer mathematical model is developed.The first step involves determining the flights that will be operated by the airline and those that will be operated under the CA.Based on this, an appropriate fleet type is assigned to each flight, and the routes are created.In terms of the second stage, the estimated departure time for the airline's own flights is selected from a predetermined time window.In the final step, the timetable of the routes assigned to each aircraft is updated, and the number of passengers to be carried by the aircraft is determined.
However, another critical challenge that makes solving the aforementioned optimization problems complex is the uncertainty surrounding customer demand and non-cruise times.Capturing these uncertainties accurately is crucial in modeling and decision-making problems.The developed model has the ability to model uncertainties in demand and noncruise time parameters stochastically.The variation in the values of stochastic parameters will have an impact on the decisions to be made.Therefore, evaluating a wide range of scenarios reflecting the different values of stochastic parameters will ensure robust results.In this study, the Monte Carlo technique is used to analyze a vast number of scenarios for stochastic parameters.
On the other hand, the increase in the number of flights and scenarios makes it impractical to solve the proposed model using optimization software.Therefore, in this study, the SA and CS algorithms are proposed for solving the non-linear mixed-integer model by integrating the Monte Carlo technique.Testing these algorithms on real-life data reveals that the proposed model accurately represents the problem and produces efficient and robust results with the proposed solution algorithms.The CS algorithm is shown to have a better performance than SA for the integrated FS, FA, and AR problems.
The proposed model assumes that all fleet types can use all airports.However, in reality, certain fleets may not be able to use certain airports for technical reasons, and this restriction is referred to as station purity.This limitation serves as a constraint for the proposed model.Additionally, the developed model neglects the option of overbooking, where airlines sell more tickets than the airplane's capacity.The model considers a single fare class but does not account for fare classes such as business class and first class.All these limitations present research potential for future studies.Finally, techniques such as Sample Average Approximation could be implemented to the metaheuristics to analyze stochastic parameters.

Figure 1 .
Figure 1.The inputs and outputs of the model stages.

Figure 1 .
Figure 1.The inputs and outputs of the model stages.

3 is: 3 is:
of flight i in scenario s i ∈ F, s ∈ S c 3 is : Actual arrival time of flight i in scenario s i ∈ F, s ∈ S d 3 iks : Cruise time of flight i with fleet type k in scenario s i ∈ F, s ∈ S, k ∈ K IT 3 iks : Idle time of flight i with fleet type k in scenario s i ∈ F, s ∈ S, k ∈ K del 3 is : Delay time of flight i in scenario s i ∈ F, s ∈ S π Number of accepted passengers in flight leg i under scenario s i ∈ F, s ∈ S πc Number of accepted passengers in flight leg i under scenario s in codeshare i ∈ F, s ∈ S w 3 ijs :

Figure 2 .
Figure 2. The flow diagram of SA + MC algorithm.Figure 2. The flow diagram of SA + MC algorithm.

Figure 2 .
Figure 2. The flow diagram of SA + MC algorithm.Figure 2. The flow diagram of SA + MC algorithm.

Figure 3 .
Figure 3.The flow diagram of CS + MC algorithm.

Figure 3 .
Figure 3.The flow diagram of CS + MC algorithm.

Figure 5 .
Figure 5.The effect of codesharing on profits with (a) SA + MC simheuristic algorithm and (b) CS + MC simheuristic algorithm.

Figure 5 .
Figure 5.The effect of codesharing on profits with (a) SA + MC simheuristic algorithm and (b) CS + MC simheuristic algorithm.

Table 1 .
Features added to the FA.

Table 2 .
Flight parameters of small example.

Table 4 .
Solution results of the sample problem.

Table 5 .
Solutions of the scenarios.

Table 6 .
Properties of fleet types.

Table 7 .
Comparison of results of test problems.

Table 7 .
Comparison of results of test problems.

Table 8 .
Results of proposed methods for 180 flights without codeshare flights.

Table 9 .
Results of proposed methods for 180 flights with codeshare flights.