1 Appendix I: Aircraft Flowchart Heuristic 1 pseudocode 1 Step 0: Initialization C res = C; Sa m1 = 0; Sy m1 = 0; Sg m1 = 0; a mn1 = A1 mn ; Sa m1 = Sa m1 + a mn1 ; C res = C res 1 + a mn1 ; y mn1 = Y 1 mn ; Sy m1 = Sy m1 + y mn1 ; g mn1 = G1 mn ; Sg m1 = Sg m1 + g mn1 ; arrange in non-decreasing order of y mn1 the available aircraft of squadron m arrange in non-decreasing order of g mn1 the grounded aircraft of squadron m for t = 1toT do Step 1: Production of maintenance plans for period t B res = B t ; ex mt = 0; Sh mt = 0; h mnt = 0; while B res > 0 and at least one grounded aircraft waiting for service exists do if at least one grounded aircraft with interrupted service from previous periods exists k = arg max S mt /(Sy mt + (ex mt Y )); m M: squadron m has at least one grounded aircraft with interrupted service among all grounded aircraft with interrupted service in squadron k k = arg max S mt /(Sy mt + (ex mt Y)); m M: squadron m has at least one grounded aircraft waiting for service among all grounded aircraft waiting for service in squadron k if B res g klt h klt = g klt ; Sh kt = Sh kt + h klt ; B res = B res h klt ; 1 The following additional notation is used in the AFH1 and AFH2 pseudocodes: Sa mt = number of available aircraft of squadron m in period t Sx mt = total flight time of squadron m in period t Sy mt = total residual flight time of squadron m at the beginning of period t Sh mt = total maintenance time of squadron m in period t Sg mt = total residual maintenance time of squadron m at the beginning of period t ex mt = number of aircraft of squadron m that exit the maintenance station at the end of period t B res = time capacity residual of the maintenance station C res = space capacity residual of the maintenance station.
2 C res = C res + 1; ex mt = ex mt + 1; remove this aircraft from the set of grounded aircraft waiting for service h klt = B res ; Sh kt = Sh kt + h klt ; B res = 0; Step 2: Decision on aircraft that will be grounded in period t + 1 Sx mt = 0; x mnt = 0; set of candidate aircraft includes all available aircraft while C res > 0 and the set of candidate aircraft is not empty do k = arg max (S mt Sx mt )/(Sy mt Sx mt + (ex mt Y )); m M: squadron m contains at least one candidate aircraft l = index of candidate aircraft with lowest residual flight time in squadron k if the check for grounding this aircraft is successful x klt = y klt ; Sx kt = Sx kt + x klt ; C res = C res 1; remove this aircraft from the set of candidate aircraft remove all the available aircraft of squadron k from the set of candidate aircraft Step 3: Production of flight plans for period t apply Procedure Sweep to compute the flight time (x mnt ) of each available aircraft update Sx mt end do Step 4: Update of status for period t + 1 Sa mt+1 = Sa mt ; Sy mt+1 = Sy mt ; Sg mt+1 = Sg mt ; if (a mnt == 0andh mnt == g mnt ) a mnt+1 = 1; Sa mt+1 = Sa mt+1 + 1; y mnt+1 = Y ; Sy mt+1 = Sy mt+1 + Y ; g mnt+1 = 0; Sg mt+1 = Sg mt+1 h mnt ; if (a mnt == 1andx mnt <y mnt ) a mnt+1 = 1; y mnt+1 = y mnt x mnt ; Sy mt+1 = Sy mt+1 x mnt ; g mnt+1 = 0;
3 if (a mnt == 1andx mnt == y mnt ) a mnt+1 = 0; Sa mt+1 = Sa mt+1 1; g mnt+1 = G; Sg mt+1 = Sg mt+1 + G; y mnt+1 = 0; Sy mt+1 = Sy mt+1 x mnt ; if (a mnt == 0andh mnt <g mnt ) a mnt+1 = 0; g mnt+1 = g mnt h mnt ; Sg mt+1 = Sg mt+1 h mnt ; y mnt+1 = 0; Appendix II: Aircraft Flowchart Heuristic 2 pseudocode Step 0: Initialization Same with Step 0 in AFH1 with the additional requirement that the available aircraft of the wing should be arranged in non-decreasing order of y mn1 and the grounded aircraft of the wing should be arranged in non-decreasing order of g mn1 at the end of this step for t = 1toT do Step 1: Production of maintenance plans for period t B res = B t ; Sh mt = 0; h mnt = 0; while B res > 0 and at least one grounded aircraft waiting for service exists do if at least one grounded aircraft with interrupted service from previous periods exists among all grounded aircraft with interrupted service among all grounded aircraft waiting for service k = index of the squadron the selected grounded aircraft belongs to if B res g klt h klt = g klt ; Sh kt = Sh kt + h klt ; B res = B res h klt ; C res = C res + 1; remove this aircraft from the set of grounded aircraft waiting for service h klt = B res ; Sh kt = Sh kt + h klt ; B res = 0;
4 Step 2: Decision on aircraft that will be grounded in period t + 1 Sx mt = 0; x mnt = 0; set of candidate aircraft includes all available aircraft while C res > 0 and the set of candidate aircraft is not empty do l = index of candidate aircraft with lowest residual flight time k = index of the squadron that aircraft belongs to if the grounding check for this aircraft is successful x klt = y klt ; Sx kt = Sx kt + x klt ; C res = C res 1; remove this aircraft from the set of candidate aircraft remove all the available aircraft of squadron k from the set of candidate aircraft Step 3: Production of flight plans for period t Same with Step 3 in AFH1 Step 4: Update for period t + 1 Same with Step 4 in AFH1 with the additional requirement that the available aircraft of the wing should be arranged in non-decreasing order of y mnt+1 after the status update of the aircraft of each squadron Appendix III Proof of Proposition 2 The dominating operation in Step 0 is the arrangement of the available and the grounded aircraft that requires time O(N max log N max ) and is executed M times. Therefore, the total time that Step 0 requires is O( M N max log N max ). The initialization commands in the first 7 lines of Step 1 require time O( M N max ). The check in the while command of Step 1 requires time O(1). Checking if an aircraft with incomplete service from previous periods exists requires time O(1). Finding the squadron with the highest priority index among all the squadrons with aircraft with interrupted service (or all the squadrons with aircraft waiting for service) requires time O(min(i, M )), wherei is the number of grounded aircraft (1 i C). Selecting the appropriate aircraft from that squadron requires time O(1), since the grounded aircraft of each squadron are always sorted in non-decreasing order of their residual maintenance times. The if- clause that decides the maintenance time of the selected aircraft requires time O(1). Sincemin(i, M ) = C in the worst case, the while-loop of Step 1 is repeated at most C times, with each repetition i (1 i C) requiring time O(C i + 1) for selecting the appropriate squadron and aircraft, and time O(1) for deciding its maintenance time. Since C + (C 1) + + 1 = C(C+1),thetotal time required for this is O(C 2 ). Note that this bound cannot be improved by sorting in 2 advance the squadrons with respect to their priority index, since one of these indices always changes in each iteration, imposing a rearrangement. Therefore, Step 1 requires time O( M N max ) + O(C 2 ) = O(max( M N max,c 2 )) in total.
5 The initialization commands in the first 7 lines of Step 2 require time O( M N max ).For the while-loop that follows, we distinguish two cases. The first case is when this loop is repeated M +C 1 times (C 1 successful checks for grounding an aircraft first, followed either by M 1 unsuccessful and one successful, or by M unsuccessful). This is the maximum possible number of times that this loop can be repeated. The sequence of checks implies that the maintenance station is initially empty. Moreover, simulating the operation of the maintenance station at the presence of i grounded aircraft requires time O(i 2 ), since there is a total of at most i iterations involved, where iteration k (1 k i) selects out of at most i k + 1 squadrons the one with the highest priority index (again a prearrangement is not sufficient to improve the bound, since one of these indices changes in each iteration) and assigns a maintenance time to a grounded aircraft that belongs to that squadron. It follows that repetition i (1 i C 1) requires time O( M ) for selecting the squadron with the highest priority index and time O(i 2 ) for checking the condition for grounding the associated aircraft, while each repetition i of the next M ones (C i M +C 1) requires time O( M +C i) for selecting the squadron with the highest priority index and time O((C 1) 2 ) for checking the condition for grounding the associated aircraft. Therefore, the total time required for the while-loop in this case is O(( M +1 2 ) + ( M +2 2 ) + + ( M +(C 1) 2 ) + ( M +(C 1) 2 ) + ( M 1 + (C 1) 2 ) + +(1 + (C 1) 2 )) = O((C 1) M +(1 2 + 2 2 + +(C 1) 2 ) + (1 + 2 + + M ) + M (C 1) 2 ) = O(C M M + (C 1)C(2(C 1)+1) 6 + ( M )( M +1) 2 + M C 2 + M 2C M ) = O( M 2 + M C 2 + C 3 ) = O(max( M 2, M C 2,C 3 )). The second case is when the while-loop is repeated M times ( M unsuccessful checks for groundinganaircraftfrom M distinct squadrons). In this case, repetition i (1 i M ) requires time O( M i + 1) for selecting the squadron with the highest priority index, leading to a total bound of O( M + M 1 + + 1) = O( M ( M +1) 2 ) = O( M 2 ) for all M selections (since the selected squadron is dropped at the end of each iteration, this bound can be improved to O( M log M ) by sorting in advance the M squadrons with respect to their priority index, but this is neither known in advance, nor can it improve the overall bound of Step 2 computed next). Additionally, since one aircraft is considered for entering the maintenance station at each iteration, there are at most C 1 grounded aircraft; thus, the time required for this check is O((C 1) 2 ). Hence, the total time required for the while-loop is O( M 2 + M (C 1) 2 ) = O(max( M 2, M C 2 )) in this case. Thus, considering the worst of the above two cases, Step 2 requires time O(max( M 2, M C 2,C 3, M 2, M C 2 )) = O(max( M 2, M C 2,C 3 )) in total. In Step 3, solving M times the problem defined by (38) (41) requires time O( M N max ) in total. Finally, updating the status of the system for period t + 1 in Step 4 requires time O( M N max ). Since Step 0 is executed once and each of Steps 1 4 is executed T times, the total time required by AFH1 is O( M N max log N max + T( M N max + C 2 + M 2 + M C 2 + C 3 + M N max + M N max )) = O(max( M N max log N max,t M N max,t M 2,T M C 2,TC 3 )). Appendix IV Proof of Proposition 3 The arrangement of the available and the grounded aircraft of each squadron in Step 0 requires time O(N max log N max ) and is executed M times in total. The arrangement of the available and the grounded aircraft of the wing requires time O(N log M ), since the aircraft of each squadron are already sorted. These are the two dominating operations in Step 0; therefore, the total time that Step 0 requires is
6 O( M N max log N max )+O(N log M ) = O( M N max max(log N max, log M )). The initialization commands in the first 7 lines of Step 1 require time O( M N max ). The check in the while command of Step 1 requires time O(1). Checking if an aircraft with interrupted service from previous periods exists requires time O(1). Selecting the grounded aircraft that should receive maintenance service next requires time O(1), since the grounded aircraft of the wing are always sorted in non-decreasing order of their residual maintenance times. The if- clause that decides the maintenance time of the selected aircraft requires time O(1). Since the while-loop of Step 1 is repeated C times in the worst-case, Step 1 requires time O( M N max ) + O(C) = O(max( M N max,c))in total. The initialization commands in the first 7 lines of Step 2 require time O( M N max ).For the while-loop that follows, we distinguish two cases. The first case is when this loop is repeated M +C 1 times (C 1 successful checks for grounding an aircraft first, followed either by M 1 unsuccessful and one successful, or by M successful). This is the maximum possible number of times that this loop can be repeated. The sequence of checks implies that the maintenance station is initially empty. In this case, repetition i (1 i M +C 1) requires time O(1) for selecting the appropriate aircraft and time O(1) for checking whether it should be grounded. Therefore, the total time required for the while-loop is O( M +C). The second case is when the while-loop is repeated M times ( M unsuccessful checks for grounding an aircraft from M distinct squadrons). In this case, each repetition requires time O(1) for selecting the appropriate aircraft, and time O(1) for checking whether it should be grounded (since the aircraft are treated as if they all belong to the same squadron, the simulation of the operation of the maintenance station is trivial). Hence, the total time required for the while-loop is O( M ). Thus, considering the worst of the above two cases, Step 2 requires time O( M +C) in total. In Step 3, solving M times the problem defined by (38) (41), requires time O( M N max ) in total. In Step 4, updating the status of the system for period t + 1 requires time O( M N max ) and sorting the available aircraft of the wing requires time O(N log M ), since the available aircraft of each squadron are already sorted. Therefore, the total time required by Step 4 is O( M N max + N log M ) = O( M N max log M ). Since Step 0 is executed once and each of Steps 1 4 is repeated T times, the total time required by AFH2 is O( M N max log N max + M N max log M +T(max( M N max,c)+ ( M +C) + M N max + M N max log M )) = O(max( M N max log N max,tc,t M N max log M )).