## 4 Declarative Solution Approach
### The Method to Create a Possible Set of Sub-Missions  
Given are \(l\)-th flying time window: \(F_{l}\), \(vw_{l}=\left[\overline{vw_{l}},\underline{vw_{l}}\right]\), \(\theta_{l}\), \(CL_{m,l}\), \(d_{i,j}\), \(\varphi S_{i,j}\), \(t_{i,j}\)  
Question: _Does a set \(S_{m,l}=\left\{S_{1,m,l},\ \ldots,S_{q,m,l}\right\}\) of admissible sub-missions satisfying the energy constraints and collision avoidance exist?_  
Figure 4: Proposed solution approach. The method of creating a possible set of sub-missions for a cluster in a given flying time window has two stages as shown in Figure 5. Stage one creates a list of scenarios for the cluster and stage two creates sub-missions using the scenarios made in stage one. Stage one and stage two is executed for each cluster for each FTW. The sub-missions are created for each \(m^{\text{th}}\) cluster in each \(l^{\text{th}}\) FTW. This calculation provides a set of sub-missions for each cluster in each time window. All the sub-missions in all clusters in a flying-time window equal to the total number of sub-missions made for that flying time window. As the output, it provides sets of sub-missions for each flying time window. \(P_{i,j}\) is calculated assuming that UAV travels with maximum payload using (6). _Stage one:_ Create possible scenarios \((RL_{s,m,l}=\left(R_{r,m,l},P_{r,m,l},CS_{r,m,l}\right))\), which consist of routes with schedules and levels of customer satisfaction for a cluster in a FTW. Scenarios consist of a \(Ct\) number of customers and each customer receives a portion of materials which is equal to the payload of the UAV divided by \(Cn\). \(Cn\) is a parameter with the range of [1, max number of customers in the cluster]. Scenarios are created which have one customer to a maximum number of customers in the cluster. The desired number of scenarios are given as the input in this method and the method stops when, the list of scenarios (RL) consists of the desired number of scenarios. _Stage two:_ Input for stage two is the list scenarios (RL) for routes with plans and customer satisfaction levels made in stage one for a cluster. The sub-missions for each cluster are created as per the method shown in Figures 6 and 7. The elements are explained below. Step 1 takes all scenarios in the scenario list (RL) as input data, which comes from stage one, and move to condition \(a\). Input data includes the UAV fleet size, priority of UAVs and the desired number of sub-missions. An empty tab list (TL) is created in this step to store the pairs of scenarios. Condition \(a\) checks whether a pair of scenarios exist in R which do not exist in TL. If yes, it moves to step 2 and, if not, it moves to step 3. Step 2 adds R to TL and assign the UAVs to R. Then it moves to condition \(b\). Condition \(b\) checks whether the routes in R satisfies the collision avoidance constraint (2). If yes, it moves to step 1' (which goes as an input to condition \(e\) in Figure 7) and, if no, it moves to condition \(c\). Condition \(c\) checks whether schedules of R can be rescheduled in order to satisfy collision avoidance constraints (2). If yes it moves to step 6 and if not, it moves to step 4. Step 1' sends the output from Figure 6 as the input to Condition \(e\) in Figure 7.  
Step 3 deletes one scenario assigned to the UAV with less priority from R and moves to condition \(d\). Condition \(d\) checks whether there exists a scenario nR in RL, which does not make a pair R which is already in TL. If no, it stops the process and, if yes, it moves to step 5. Step 4 adds R to TL and moves to condition \(b\). Step 5 creates new schedules for R and move to step 1' (which goes as an input to condition \(e\) in Figure 7). Figure 5: Illustration of the method to create sub-missions for each \(m^{\text{th}}\) cluster in each \(l^{\text{th}}\) flying-time window (FTW). Step 2' takes the output from Figure 6 and moves to condition \(e\) where it checks whether there exists an available UAV in the fleet of UAVs. If yes, it moves to condition \(f\) and if not, it moves to step 10.