Modeling Flight Delays
The Question
What is the best way to increase the number of flights without delays? We will model airplane traffic between several airports and test two different modeling strategies to avoid flight delays and maintain flight turnaround efficiency.
Below is data collected in 2008 which details flights and delays. This data was narrowed to include only Delta (DL) and United (UA) flights between airports LAX, JFK, ATL, IAD, SEA. By using only flights between specific airports, we reduce the likelihood that the data is influenced primarily by the airport or the airline.
Year | Month | DayofMonth | DayOfWeek | DepTime | ArrTime | UniqueCarrier | ActualElapsedTime | AirTime | ArrDelay | ... | Origin | Dest | Distance | TaxiIn | TaxiOut | CarrierDelay | WeatherDelay | NASDelay | SecurityDelay | LateAircraftDelay | |
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
0 | 2008 | 1 | 1 | 2 | 613.0 | 1407.0 | UA | 294.0 | 278.0 | -24.0 | ... | LAX | JFK | 2475 | 3.0 | 13.0 | NaN | NaN | NaN | NaN | NaN |
1 | 2008 | 1 | 2 | 3 | 615.0 | 1435.0 | UA | 320.0 | 298.0 | 4.0 | ... | LAX | JFK | 2475 | 3.0 | 19.0 | NaN | NaN | NaN | NaN | NaN |
2 | 2008 | 1 | 3 | 4 | 607.0 | 1454.0 | UA | 347.0 | 299.0 | 23.0 | ... | LAX | JFK | 2475 | 8.0 | 40.0 | 0.0 | 0.0 | 23.0 | 0.0 | 0.0 |
3 | 2008 | 1 | 4 | 5 | 618.0 | 1523.0 | UA | 365.0 | 284.0 | 52.0 | ... | LAX | JFK | 2475 | 3.0 | 78.0 | 0.0 | 0.0 | 52.0 | 0.0 | 0.0 |
4 | 2008 | 1 | 5 | 6 | 615.0 | 1416.0 | UA | 301.0 | 282.0 | -15.0 | ... | LAX | JFK | 2475 | 4.0 | 15.0 | NaN | NaN | NaN | NaN | NaN |
... | ... | ... | ... | ... | ... | ... | ... | ... | ... | ... | ... | ... | ... | ... | ... | ... | ... | ... | ... | ... | ... |
10152 | 2008 | 2 | 29 | 5 | 2128.0 | 2311.0 | DL | 103.0 | 77.0 | -2.0 | ... | ATL | IAD | 533 | 8.0 | 18.0 | NaN | NaN | NaN | NaN | NaN |
10153 | 2008 | 2 | 29 | 5 | 1858.0 | 2041.0 | DL | 103.0 | 79.0 | 0.0 | ... | ATL | IAD | 533 | 7.0 | 17.0 | NaN | NaN | NaN | NaN | NaN |
10154 | 2008 | 2 | 29 | 5 | 1455.0 | 1646.0 | DL | 111.0 | 78.0 | 5.0 | ... | ATL | IAD | 533 | 5.0 | 28.0 | NaN | NaN | NaN | NaN | NaN |
10155 | 2008 | 2 | 29 | 5 | 824.0 | 1002.0 | DL | 98.0 | 78.0 | -5.0 | ... | ATL | IAD | 533 | 4.0 | 16.0 | NaN | NaN | NaN | NaN | NaN |
10156 | 2008 | 2 | 29 | 5 | 957.0 | 1147.0 | DL | 110.0 | 82.0 | -2.0 | ... | ATL | IAD | 533 | 7.0 | 21.0 | NaN | NaN | NaN | NaN | NaN |
10157 rows × 21 columns
The Model
To model flights and delays, we will use a state object which keeps a list of planes and also keeps track of ticks with the time variable. These variables are global but change throughout, so putting them in the state object makes sense. To simulate the planes themselves, a Plane class is created, which contains any variables for the planes and several functions to update them.
Our model, obviously, is more simple than a real-life airport system. We have limited our traffic to only a few airports, and a small number of planes. We have also decided to focus on airport delays--effectively ignoring in-flight delays due to weather, diversions, or other spontaneous circumstances.
values | |
---|---|
planes | [] |
time | 0 |
For comparison we are using two different models for airlines, assuming each has only 2 planes, going between 2 airports.
Delta Airlines (DL) will be using a model where 1 plane is kept in reserve. Any time delta experiences a significant delay (variable maxDelay), the reserve plane will be called in to replace the original, instantly resetting the delay to 0.
United Airlines (UA) will be using a model where all planes are always in service, flying opposite directions between the 2 airports. Since there is no reserve plane, United makes turnarounds longer to maintain planes and reduce the impact of delays. However, if one of their planes exceeds a significant delay (variable maxDelay), the flight is cancelled, and the plane must wait until the next scheduled flight. Since the planes fly between two airports, this means two previously scheduled flights are cancelled.
The data will be obtained in the form of a ratio, comparing the number of successful flights for each airline. The variables for maximum delays and turnarounds are designed to be as close to real life as possile based on research. Running the simulation usually takes upwards of 2 minutes because of the vast quantity of data being processed. We experimented with smaller time scales and numbers but this resulted in very varied outputs.
The Results
The ratios of Delta's successful flights versus United's succesful flights are shown below. For each flight path, there are four ratios--each representing a test with a different number of planes. For reference, the flight paths are in order of shortest time to longest.This graph shows the ratio of successful flights from United to those of Delta. The higher the ratio, the more successful Delta is. The line at y = 1 represents the point at which Delta begins having more successful flights than United. The size of each bubble represents the length of the flight.
This graph shows the individual number of flights from United (blue) and Delta (red) that are successful. The size of each bubble represents the length of the flights.
The Interpretation
The data in these two plots shows most clearly that given a certain time period, more shorter flights can be completed than longer ones. This is no surprise, and more interesting is the ratios of United flights to Delta flights. With less planes, it is clear that United's model of using all of its planes works well, even if they have a slightly longer turnaround. However, as the airlines' fleets grow, Delta gains the advantage. This can best be explained by the fact that Delta constantly has 1 reserve plane, and so the ratio of reserve planes:in service planes decreases, while the advantage of having a reserve plane doesn't.Plot 1 shows the ratio increasing throughout (shifting towards Delta's side) but levelling off near the end. This could imply that Delta's strategy works better with more planes, but only up to a point, after which it is still beneficial, but stops improving relative to United.
Plot 2 shows a very significant change in the number of successful short flights, and a smaller change in the longer flights. This can be attributed to the fact that there are more shorter flights so any imbalances will compound much faster. However, it should also be noted that Delta's method definitely seems more effective with shorter flights. This can be seen in both plots, as in plot 1, the shorter flights (smaller bubbles) have a much larger ratio, and in the second plot, delta's short flights exceed those of United earlier than the long flights.
In conclusion, United's model tends to be better suited to longer flights and fewer planes, while the opposite is true for Delta.