# Resource Indexing and Querying in Large Connected Environments
## 5 Proposed Approach
### Index Generation Algorithm
We obtained the following results: 14/20 and 65/80 were successful queries for devices having c = 20, while for c = 100, 20/20 and 78/100 were successful queries. We obtained more successful queries than the one-path queries, due to the capability to resend the query to another zone in case of failure. We can see that in the four tests, in all cases (20, 40, 60, and 80), the number of successful queries increased as the capacity grew. We can also see that the number of queries that did not give a response with a capacity of 100 was very low. Moreover, it is worth noting that retry queries yielded a greater number of responses compared to one-path queries, particularly on devices with limited capacities. In Figure 12, guaranteed and default queries always responded regardless of the devices' capacity (20, 40, 60, 100), since they tried all possible paths. Figure 10: Success/failures in one-path queries. Figure 9: Capacity to response effect. In Figure 13, we evaluated the execution time for all query types. This was performed using an environment with 300 zones and 3000 devices. Obviously, one-path queries took the least time to execute (0.145 s), since they followed one path. In contrast, the default queries took the most time (0.192 s), since they required consequent processing before trying all possible paths. The expected results were reached during these experiments. ### Device Solicitation Experiment

During this experiment, we generated an environment of 10 zones and 20 devices, in which 10 of the devices had a capacity equal to 1 or 2. Twenty queries were executed during the experiment. As we can see in Figures 14 and 15, the total number of devices solicited for one-path queries was 85, while for retry queries, the number of devices solicited was 75, depending on the path taken. For guaranteed queries, since this is a broadcast query, all the devices were solicited, meaning that the total number of devices solicited is 20 \(\times\) 20 = 400. However, for the default type of query, if we set the condition that the device had to have a capacity greater than 2 in order to be involved, the number of devices solicited was 10 \(\times\) 20 = 200. Since one-path queries took the least amount of time to execute and only specific number of devices were

Figure 11: Success/failures in retry queries. Figure 12: Success/failures in guaranteed queries. Figure 3:0 Different query type time executions. involved they consumed the least amount of resources. Conversely, the default queries took the longest time and more devices were involved in this type of query, indicating that they consumed more resources than the other queries. ### Array of Things Experiments

To add further experiments on a real-scenario, we used the dataset from the project named \"array of things\" organized by the urban center for computation and data and others in Chicago. ([[https://arrayofthings.github.io/index.html](https://arrayofthings.github.io/index.html)]([https://arrayofthings.github.io/index.html](https://arrayofthings.github.io/index.html)), accessed on 29 November 2023) This dataset contains data concerning the location of different devices distributed in the city of Chicago, such as the location name and type (lakeshore, for example), the status (live, pending), the longitude, and the latitude. We placed the different device locations on a map, to visualize and cluster them into different zones. We note that a capacity of the devices was considered between 1 and 18 (\(1<C_{d}<18\)). As shown in Figure 16, the clustered environment contained 18 zones (10 covered and 8 uncovered) and 41 devices. The index was generated with \(\alpha=10\) and \(\beta=8\). It took 0.0087 s to generate the index (Table 2). We also note that all devices were included inside the index in this example. Figure 3:1 Device solicitation for one-path queries. Figure 3:2 Device solicitation for retry queries. After generating the global index, we executed 20, 40, 60, and 80 queries.