3.2. Energy Consumption Model
In accordance with Casals et al. [
26], the energy consumption involved in transmitting a LoRa packet can be segmented into distinct phases, encompassing end device’s waking up, radio preparation, signal transmission, radio deactivation, and post-processing. All these phases, except signal transmission, exhibit minimal or no dependency on resource allocation. Hence, they are assumed to be uniform across all end devices in the proposed model.
Energy consumption of the end device during LoRa packet transmission and reception according to [
27]:
Where:
- ToA for symbol,
kHz - bandwidth,
- number of symbols encoding the preamble (value specified in the "Regional Parameters LoRaWAN" [
28]) and extended by an additional 4.25 symbols by the radio transmitter, resulting in 12.25 symbols).
B - payload size,
B - header size,
if low data rate optimization is enabled (for SF=11 and SF=12),
for disabled,
- coding rate.
Then, transmission energy usage
and reception energy usage
for a single packet are as follows
The calculation results for the presented energy consumption model are included in
Table 1, and are utilized in the heuristic function described subsection 3.3 and in the simulation from
Section 5.
3.3. Heuristic Function
Each edge
is assigned a weight describing the quality of link between devices corresponding to nodes
u and
w. The formula of the determining an edge weigh is given by the heuristic function:
where
is the daily energy surplus (in mAs) of the relay candidate
w, calculated in basis on the device’s battery level and remaining operation time [
17].
is the relay’s reception energy usage depending on the weak node’s
u SF value,
is the relay’s transmission energy usage depending on the relay’s SF value, both taking from the
Table 1.
The weight function
12 estimates the attractiveness of connection between a weak node
and a relay node candidate
. The formula
12 consists of two main components, energy surplus per day
of the relay node candidate
, in the nominator, and relaying energy cost of weak node
in denominator, which consists of listening energy cost
and transmission energy cost
corresponding to a single packet of weak node
needs to be forward by a relay node
w.
The heuristic function
12 considers a key parameter of LoRa technology, the spreading factor
. It determines how many chirps (or symbols) are sent per second. Various spreading factor values result in significant differences in time-on-air (ToA) for transmitting symbol [
29]. With
, a symbol can encode
n information bits into a chirp, and the bit rate is given by
, so the symbol period is calculated by
. So, when the number of bits in the symbol increases only by one, its ToA doubles. However, a higher SF means more resistance to interference and noise, resulting in a more extensive communication range.
In the evaluation of the link quality between a weak node and a relay candidate, it is necessary to consider two values of the SF, both in the communication between a weak node and a relay candidate () and between a relay candidate and a LoRa gateway ().
The impact of those SFs is captured in appropriate proportions in the denominator of the function
12. The formula considers the energy cost associated with the relay node’s listening, related to receiving packets from the weak node, and the energy cost of retransmitting those packets. It directly corresponds to the daily cost of serving as a relay for a weak node.
Nodes capable of serving as relays for individual weak nodes for as long as possible are prioritized, aiming to minimize future switches from relay mode.
Listening energy usage component evaluates the node w in basis of the value of spreading factor in the communication between weak node u and the candidate for relay w.
Transmission energy usage component
evaluates the node
w in basis of the value of spreading factor
in the communication between node
w and the destination gateway
g. As
value decreases, the value of heuristic function
12 increases. Such approach considers power efficient relay nodes selection. The smaller the spreading factor to the destination LoRa gateway
, the less energy is used by the device represented by node
w in relay mode. The higher the weight function value, the more attractive node
is to be a relay for weak node
.
Such clear principle, which divides the surplus energy of a relay node candidate by the cost of operating as a relay, precisely reflects the quality of connection weak node - relay node candidate - LoRa gateway, considering the role of node as a relay for node .
The remaining operational time during which the device w must operate is already incorporated in the formula determining the device’s energy surplus .
Figure 1 depicts the 2D distribution of weight function
12 values depending on spreading factors in the communication between weak node - relay node candidate (
) and relay node candidate - LoRa gateway (
) for each
,
.
As the values of both spreading factors decrease, the edge weight function increases. The heatmap effectively highlights the differences in the objective function values for the cases , and , , where . The SF in communication between the relay and the gateway () has a more significant impact on the relay’s energy consumption than the spreading factor in communication between the relay and a weak node (). The heatmap aims to depict SFs’ characteristic influence and visualize their impact on outcomes. It is generated for a constant surplus energy value (the exact value is not significant, as the distribution characteristics will be preserved).
3.5. Computational Complexity
While establishing the running time of the ACO relay selection algorithm 1, I considered the worst-case scenario, i.e., a scenario where the bipartite graph is complete. In the analysis, I focused on the most computationally significant components of the procedure where the negligible steps characterized are omitted.
In
Table 2 and
Table 3, the computational cost and the multiplicity of operations for the algorithm 1 are presented, necessary for determining the pessimistic execution time of the algorithm. According to [
30] that each execution of the
kth line takes
time, where
is a constant.
Let , and
Then, considering the pessimistic execution time of the algorithm 1 is presented as follows
then, considering the asymptotic growth of the running time algorithm runs in time
In
Table 4, the time complexity of the proposed methods: heuristic ACO, the exact method EK [
24], and the reference method [
18] are compared.
where . Compared to the EK and the reference methods, the computational complexity of the ACO algorithm does not solely depend on the size of the number of vertices and edges but also significantly on the number of iterations and ants involved.