An Energy-Efficient Internet of Things Relaying System for Delay-Constrained Applications

The emerging Internet-of-things (IoT) systems contain a large number of small wireless devices with limited energy, communication, and computational capabilities. In such systems, a helping station located between the IoT devices and backhaul servers can be deployed to broadcast the IoT devices to the backhaul networks. This paper investigates a hybrid energy-efficient framework using multiple energy harvested relays with data buffering capabilities. The relays are powered by a hybrid energy supply consisting of a traditional electric grid and renewable energy grid. We propose an energy efficient novel approach aiming to support the wireless uplink transmission from IoT devices to backhaul servers with an acceptable delay threshold or transmission deadline. A mathematical mixed-integer linear programming (MILP) optimization problem is formulated to optimize the relays’ placement and energy consumption considering the association between relays and devices, instantaneous relays’ battery level, and transmit power budget. Due to the non-convex nature of the formulated optimization problem, we propose two heuristic low-complexity solutions to solve this problem. Finally, we compare the performance of the proposed algorithms with exhaustive search solutions as a benchmark.


I. INTRODUCTION A. BACKGROUND AND MOTIVATION
An Internet of Things (IoT) system consists of a large number of small-scale devices connected to the internet aiming to enhance humans' life quality [2]. It is reported in [3] that IoT connections will be half of all communication connections by 2023. The majority of the IoT devices are battery-powered with limited capabilities, e.g., short communication range and low computing power. Although several medium and long-range communications techniques are available for the IoT devices such as LOng RAnge (LORA) [4], they suffer from achieving low data rate throughput. Therefore, a practical IoT system needs to be deployed to achieve high throughput that long range technologies cannot offer [5], [6].
The associate editor coordinating the review of this manuscript and approving it for publication was Liang-Bi Chen . Relay stations can be used to extend the wireless network coverage for IoT devices and to achieve high data rate throughput [7].
Integrating relays with an IoT system as intermediate nodes between IoT devices and servers can solve the high throughput requirement, increase the communication range, and enhance the network capacity. This is because relays can be equipped with resources that do not exist in regular IoT devices [8]. However, deploying a large number of relays will incur extra cost and energy to the IoT system. It is important to optimize the number of active relays to avoid the redundancy and under-utilizing scenarios, especially when traffic is low.
Several techniques in the literature investigated relays' energy efficiency. Switching ON-OFF technique is one of the well-known techniques to reduce the relay's energy consumption [9]. This technique deploys a large number of VOLUME 10, 2022 This work is licensed under a Creative Commons Attribution 4.0 License. For more information, see https://creativecommons.org/licenses/by/4.0/ relays with switching ON-OFF (i.e., sleeping) capability in certain areas. The relays can be turned ON (i.e., active) during high-traffic periods. On the contrary, some of them will be turned OFF (i.e., inactive) during low traffic periods while offloading the corresponding devices to nearby active relays. Depending on the relay's switching ON-OFF configuration, the inactive relays' energy consumption can be reduced or completely eliminated [9]- [11]. However, the main limitation of this strategy is that it requires deployment of a large number of relays in advance which may be a costly investment. In practice, the budget constraint often limits the deployment of a maximum number of relays. The work in [12] aims to reduce the relays' energy consumption using the relay selection strategy. The authors formulated and solved a relay selection and time allocation optimization problem to enhance the overall throughput.

B. RELATED WORKS
Several studies have been conducted in the literature to solve the relay connectivity challenge [13] or the relay placement challenge [14], [15]. The authors in [16] proposed approximated schemes aiming to achieve certain fault tolerance in heterogeneous networks while placing a minimum number of relays. The work in [13] proposed a local and sub-optimal algorithm to solve the relay connectivity issue. First, the algorithm categorizes the IoT sensor devices into groups. Then, it uses a local algorithm to find a local set coverage for each group. Although, this work reduces the complexity, it does not consider the joint connectivity and interference problem with the placement problem. In addition to the relay placement problem, the authors in [17] considered energy harvesting optimization for the relays in the network. In [18], a joint optimization problem of transmit power allocation and relay placement has been investigated aiming to minimize the secrecy outage. Energy aware joint optimization over cooperative power line communication has been proposed in [19]. By jointly optimizing the relay placement and transmit power, the authors maximize the energy-efficiency while achieving a certain outage threshold. In [20], multiple relays placement has been investigated. The work devised an algorithm based on set covering with relay placement to ensure that each link quality is above a certain predefined tolerance. However, all the previous works do not consider jointly relay placement with transmit power, delay, and backhaul network limitations. Although with the fixed number of relays, as long the IoT devices numbers and their data demand increases, the relays tend to consume more energy to satisfy the growth in the data traffic. One solution to alleviate the problem of increasing energy consumption for the relays is adopting an energy harvesting module in the relays [21]. Energy can be harvested from the radio frequency (RF) energy source or a renewable energy source such as solar, wind, heat, or a vibration [22]. Although RF energy harvesting is a promising technology for powering the relays in the IoT system, it can be impractical in some applications when the source of the RF energy is not available or provides insufficient energy [23]- [25]. On the other hand, renewable energy sources provide a sustainable solution for powering the relays. However, it might suffer from the harvesting in continuity. When the adopted energy harvesting scheme is insufficient for supporting the demand of the relays, the relays can adopt a hybrid scheme that includes the traditional energy source with the renewable source. In other words, the relays can rely on renewable energy sources and utilize the traditional electricity grid if needed. The authors of [26] proposed a sustainable solution for powering a relay serving a group of IoT devices using renewable energy. The relay forwards the messages to the IoT devices and charges them by RF energy. In [27], routing problem in an energy harvesting wireless sensor network is studied. The goal was to minimize the number of needed relays while considering the unpredictable availability of renewable energy. An optimal transmission policy for a two-hop communication system with energy harvesting is investigated in [28]. In [29], an energy-aware two-tier energy harvesting wireless sensor network was introduced. The relay harvests energy and uses the energy for relaying the sensor data. The objective was to prolong the lifetime of the network by minimizing the consumed energy of the sensors and maximizing the harvested energy. Constrained relay node placement problem in an energy-harvesting network has been studied in [30]. The authors proposed a scheme that minimizes the consumed energy while maintaining a connected and survivable wireless sensor network. In [31] and [32], the authors proposed a scheme for IoT energy harvesting from dedicated radio frequency energy transmitters. The IoT devices can communicate directly if they are close to each other or indirectly through a relaying base station.
The joint relay selection, power splitting, and transmission power allocation for a cooperative energy harvesting network has been addressed in [33]. The relays harvest energy from the renewable energy source and the sensors harvest RF energy from the relays. The authors of [34] propose a power allocation scheme using decode and forward relay that harvests energy from a renewable energy source. The goal was to maximize the throughput taking into account the amount of stored energy and the amount of RF energy that can be transferred. Table 1 presents a comparison between the related works and our proposed work. Unlike the listed related works in Table 1, we jointly consider in this paper several challenges such as optimizing: 1) Renewable energy harvesting and energy consumption from the electrical grid, 2) Relays placement over a set of candidate locations, 3) Backhauling for IoT devices' messages while tolerating certain delays, 4) Transmission power of the relays and IoT devices and 5) Routing the messages of the IoT devices through the relays to the severs.

C. MOTIVATIONS
The motivation behind this work can be summarized as follows: • One of the main challenges of the renewable energy harvesting technology is the uncertainty of the harvested energy over various times and locations. Therefore, we propose a robust relaying system that connects the relays to renewable and traditional energy sources as primary and secondary sources, respectively. The relays utilize the traditional energy sources when needed in order to avoid network disconnection.
• Minimizing energy consumption is another important factor in communication systems. Therefore, we optimize the consumed energy by the relays. To achieve this goal, we optimize the following: -Transmission powers and locations of the relays: the relays are placed at optimized locations to broadcast the IoT devices messages to servers. The selection of the relays' location is based on harvesting more energy and consuming less energy for the uplink transmission.
-Routing: The relays route the IoT messages using the best paths.
-Delay: Data processing, queueing and transmission cause a certain delay to the relays. Hence, delay is a practical issue in real-time systems.
To guarantee a certain quality of service, we enforce a delay threshold on the allowed delay caused by the relays. They accumulate the IoT devices messages for a certain tolerated period and send them together to the next hop. This allows reducing the relays' active time, and hence, energy consumption.

D. CONTRIBUTIONS
This paper proposes a hybrid energy-efficient framework using multiple energy harvesting relays with data buffering capabilities. The relays are powered by a hybrid energy VOLUME 10, 2022 supply consisting of a traditional electric grid and renewable energy grid. We propose an energy-efficient approach aiming to support the wireless uplink transmission from IoT devices to backhaul servers with an acceptable delay threshold or a transmission deadline. The contributions of our paper can be summarized as follows: • Proposing a hybrid energy-efficient framework based on joint traditional electric grid and renewable energy grid for uplink transmission. Due to short uplink transmission range, we propose to utilize relays to broadcast the uplink signals wirelessly from the devices to the backhaul servers. The relays can be powered using renewable energy and utilize the conventional electric grid when needed. The relays optimize their operations while transmitting the IoT devices' messages to the backhaul servers.
• Proposing a delay threshold deadline strategy, where the relays can broadcast their received signals within allowable transmission delay deadline. By tuning their transmit powers, they relays can accumulate the messages from IoT devices and minimize the relay active/operation time. This helps relays to minimize their energy consumption by optimizing the active times according to the transmission deadline of the IoT devices.
• Formulating a mathematical mixed-integer nonlinear program (MINLP) optimization problem. The objectives are to optimize the energy consumption and energy harvesting for the relays while respecting the transmission deadline of the IoT devices.
• Optimizing the location of the relays (i.e., relay planning) and activating them (i.e., relay connectivity) as needed to utilize available energy more efficiently. Moreover, we optimize the associations between the IoT devices and relays as well as the relays and servers. The transmission power of the IoT devices and the relays are minimized while considering a quality-of-service constraint.
• Analyzing the performance of our proposed solution with different settings using Monte-carlo simulation. Also, to show the advantages of our proposed solution, we compare its performance with several benchmarks.

E. ORGANIZATION
The remainder of the paper is organized as follows. We introduce the system model in Section II. Then, we formulate our problem mathematically in Section III. Section IV presents our proposed solutions for the formulated problem and Section V shows the simulation results. Finally, we conclude the paper in Section VI.

II. SYSTEM MODEL
In this paper, we consider a time-slotted system consisting of a finite time period divided into t = 1, .., T , time slots of equal duration T s . We study the uplink data transmissions in an IoT system that consists of a total of U IoT devices that transmit their data to W backhaul servers via the help of relays. The relays are assumed to be placed on some of L pre-defined candidate locations. 1 As shown in Fig. 1, the IoT devices are wirelessly connected to relays that forward the data from the IoT devices to backhaul servers. We consider a hybrid power supply source of relays consisting of an onsite renewable grid (RG) and an electrical grid (EG) as shown in Fig. 2. The former renewable sources are connected directly to relays and based on renewable sources such as solar and wind, while the latter uses classical sources, connected to relays using power lines, to generate the electric power. The RG can be the primary energy provider for relays. The relays can purchase a back-up energy from EG, when needed. We assume that the relays need to broadcast the uplink data from devices to the servers within a certain time or delay threshold. We denote this transmission deadline bȳ T . Moreover, the channel gain between IoT device u and relay l over channel c can be modeled as: where d ul is the Euclidean distance between device u and relay l, is the path loss exponent, andh ulc is the fading coefficient. On the other hand, we assume that the channel gain between relay l and server w is given as where d lw is the Euclidean distance between relay l and server w andh lw is the fading coefficient.

A. ASSOCIATION
In the uplink, two associations will be considered. The first one is between the IoT devices (i.e., access link), the second one is between the relays and backhaul servers (i.e, backhaul link). For each time slot t, we denote ulc (t) as the access link variable that is given as follows: 1, if device u communicates with relay l over channel c during time t, 0, otherwise.
(3) 1 In this paper, for simplicity we use the phrase ''relay l'' instead of a relay placed at candidate location l. Let us use π l to indicate the relay placement at candidate locations l and given as: To ensure that IoT devices cannot be connected to a candidate location where no relay is placed, the following condition must be satisfied: We also use a binary variable δ lw (t) to indicate the associations between relays and servers during time t and given as follows: To ensure that locations without relays cannot be connected to a server, the following condition must be satisfied:

B. ENERGY MODEL
In this paper, we assume that each relay can harvest from a renewable energy (RE) source such as solar or wind. We model the RE stochastic energy arrival rate as a random variable Watt defined by a probability density function (pdf) f (ϕ) [24]. We assume that the RE generation matrix , of size L × T , with elements ϕ b l t , ∀l = 1, · · · , L, ∀t = 1, · · · , T and modeled as: In (8), contains two parts of the RE generation: deterministic/static part, 1 , that can be estimated from historical data and stochastic/random part, 2 , that represents uncertainty of the model. For example, for photovoltaic energy, can be interpreted as the received amount of energy per time unit with respect to the received luminous intensity in a particular direction per unit solid angle.
The total uplink energy consumption of relay l during time slot t can be given by the following: where α corresponds to the power consumption that scales with the radiated power due to amplifier and feeder losses, β models an offset of site power that is consumed independently of the average transmit power, and P lw is the transmit power at relay l to server w. The harvested energy in relay l at the end of time slot t can be given as where η l is the energy conversion efficiency coefficient, where 0 ≤ η l ≤ 1. Notice that the current stored energy in relay l depends on the current harvested energy during slot time t, the previously stored energy during previous slots, and the energy consumption at relay l during time slot t. Therefore, the stored energy in relay l at the end of time t based on harvest-store-use model is given by where [x] + = max(0, x).

C. UPLINK DATA RATE
For simplicity, let us assume that the channel gain is the same during each time slot T s . Also, we assume that each IoT device u transmits its data to relay l over channel c with a power equal to P ulc (t). Therefore, the achievable uplink data rate from device u to relay l during time t is given by where N 0 is the noise spectral power density, and B U is the device access link channel bandwidth. The achievable backhaul data rate from relay l to server w during time t is given by where B L is the relay backhaul bandwidth. Note that, the data rate R U ulc (t) in (12) is constrained by the backhaul rate R L lw (t). We propose that each relay can transmit the devices' received data within a certain transmission deadlineT , therefore, the following constraints needs to be satisfied:  such that where M l (i) =  Table 2 summarizes the notations used in the paper.

III. PROBLEM FORMULATION
In this section, we formulate an energy-efficient relay planning problem in the IoT. The goal is to minimize the energy consumption while maximizing the harvested energy. We consider in our optimization problem channels assignment, relay-server associations, backhaul transmission power allocations and a deadline for the relays' transmissions. The formulated optimization problem can be given as: subject to: U u=1 ulc (t) ≤ 1, ∀l, ∀c, ∀t, where constraint (18) ensures that each IoT device is supported by a minimum data rate requirement over the service time. Constraints (19)- (20) force the relays to service the IoT device within a certain tolerable delay (T slots). Constraint (21) is to ensure that each relay cannot store energy more than its battery capacity,S l . Additionally, constraints (22)-(23) enforce upper bounds on the transmission power of the IoT devices and the relays, respectively. Constraints (24)-(26) force a limit on the maximum number of IoT devices that can be served by a single relay and associate each IoT device to a relay and a channel. Finally, constraints (27)-(29) associate each relay to a server and associate IoT devices to relay l only if it is placed physically at location l.

IV. PROBLEM SOLUTION
Our formulated problem given in (17)- (29) is a non-convex optimization problem due to constraints (19)- (20). It is also an NP-hard problem due to the existence of the binary variables. This will make the optimization problem difficult to solve, and there is no efficient way to solve it optimally when the size of the network is large. For this reason, we propose two low complexity algorithms to solve the optimization problem efficiently. The first one is based on a three-step algorithm and the second one is based on the BPSO algorithm. In the sequel, we introduce the two algorithms and describe the required steps to reach a solution near to the optimal one.

A. THREE-STEP ALGORITHM FOR OPTIMIZING RELAYS' ENERGY CONSUMPTION AND HARVESTING
We propose a three steps algorithm that decomposes the original optimization problem into three simpler subproblems: 1) Relay Placement Optimization (RPO), 2) Device Transmit Power and Device-Relay Associations Optimization (DTA) and 3) Relay Transmit Power and Relay-Server Associations Optimization (RTA). In the first step, we solve the RPO optimization subproblem to find the minimum number and the placement of relays to cover a desired area. Then, with given relays placement, we solve the DTA subproblem to find transmission powers of the IoT devices and relay-IoT devices associations that minimize the devices energy while satisfying a certain QoS. After we solve the RTA subproblem, the relays' transmission powers and associations with servers will be obtained taking into consideration the deadline constraint.   3 shows how the three subproblems are related to each other. In the first subproblem (RPO), we derive the values of the binary variable π l . Then, we fix the values of π l and solve the second subproblem (DTA), where we optimize the variables ulc (t) and P ulc (t). Finally, we fix the variables ulc (t) and P ulc (t) and solve the third subproblem (RTA) to get the optimal solution for the other variables, i.e., δ ulc (t) and P lw (t).
We describe in the following subsections the mathematical formulation of each step. The details of our three steps algorithm is given in Algorithm 1.

Algorithm 1 Three-Step Algorithm for Optimizing Relays' Energy Consumption and Harvesting
1: Solve Relay Placement problem, and fix the optimal solution of π l , ∀l. 2: Solve Device Transmit Power and Device-Relay Associations problem, and fix the optimal solutions of P ulc (t) and ulc (t), ∀u, l, c & t. 3: Solve Relay Transmit Power and Relay-Server Associations problem.

1) RELAY PLACEMENT OPTIMIZATION (RPO)
We formulate a relay placement optimization problem to find the best relays' location and the required number of relays, as follows: subject to: where the objective function given in (30) is formulated to minimize the number of active relays in order to minimize the relay's energy consumption due to the activation. Moreover, out of the candidate active relays, we activate the relays that have the best channel conditions to the servers. This can help in minimizing the energy consumed in the transmission. Constraint (31) is used to make sure that the number of active relays is enough to serve the IoT devices, given that each relay can serve up to (|C||t|) IoT devices. We assume that all the IoT devices need to satisfy a certain average data rate requirement R U th . Hence, we add constraint (32) to ensure a certain average data rate, R U th , to all IoT devices.

2) DEVICE TRANSMIT POWER AND DEVICE-RELAY ASSOCIATIONS OPTIMIZATION (DTA)
In this subsection, we focus on the optimization of the IoT devices energy consumption. The objective is to minimize the devices consumed energy by optimizing the devices' transmitted power and selecting the best RBs that devices will be transmitted over. The variables π l , ∀l, are fixed after solving step 1 of Algorithm 1, and fed to ''Device Transmit Power'' and ''Device-Relay Associations'' problem. The sub-optimization problem is given by subject to:

3) RELAY TRANSMIT POWER AND RELAY-SERVER ASSOCIATIONS OPTIMIZATION (RTA)
We focus in this step on optimizing energy consumption and harvesting of the relays. The objective is to minimize the relay's grid energy consumption minus the total harvested energy by optimizing the relays' transmitted power and associations between the relays and servers. We fix ulc (t) and P ulc (t) after getting their solution from step 2 of Algorithm 1.

B. BPSO-BASED ALGORITHM FOR OPTIMIZING RELAYS' ENERGY CONSUMPTION AND HARVESTING
In this subsection, we propose an algorithm based on BPSO algorithm to get a solution for the original optimization close to the optimal. BPSO algorithm [35] is a meta-heuristic algorithm that facilitates finding a near optimal solution. Fig. 4 provides a general overview for the BPSO-based algorithm that solves our optimization problem. First, we utilize BPSO algorithm to get the best solution for the binary variables ulc (t), π l and δ ulc (t). Then, we fix these binary variables and solve the original optimization problem. Algorithm 2 shows the required steps to solve the optimization problem using our proposed BPSO-based algorithm. Algorithm 2 is an iterative algorithm that starts from iteration 1, as shown in step 1, and continues until reaching a solution of the Max_iter iteration is reached. Algorithm 2 starts by generating an initial population, Z, which consists of Z particles. These particles are associated with the binary variables ulc (t). The z th particle during iteration i is denoted by (z) (i), where 1 ≤ z ≤ Z . To expedite the process of getting a solution for the optimization problem, we generate feasible particles that satisfy the constraints (24)- (26).
The values of π l and δ lw (t) depend on the value of ulc (t) (from constraint (28) and (29)). Therefore, we derive the associated values for the binary variables π l and δ lw (t) based on the generated particles, as shown in steps 5-6. In step 7, we set the transmission power of the relay to the maximum value and calculate the objective function values, U(i, z), associated with the particle z.
In step 9, we find the indices of the iteration and particle that generated the best objective function value. Then, we name the best-found particle min . Similarly, we find the index of the best particle during the current iteration, and name that particle (i,local) . Then, step 12 adjusts the velocity Algorithm 2 BPSO-Based Algorithm for Optimizing Relays' Energy Consumption and Harvesting 1: i = 1, DONE = 0. 2: Generate an initial population, Z, composed of Z particles, (z) (i), i = 1, z = 1 · · · Z , for the binary variables ulc (t), that satisfy constraints (24)- (26). 3: while (DONE = 0) and (i < Max_iter) do 4: for z = 1 · · · Z do 5: If ∃ ulc (t) = 1, set π l = 1.

6:
For each l such that π l = 1, select the server w with the best channel gain and set δ lw (t) to 1.

7:
Solve the optimization problem and compute the corresponding objective function U(i, z) when particle z is used. Set (i,local) = (ẑ) (i).

15:
i = i + 1. 16: end while 17: After getting the best solution for the binary variables ulc (t), π l and δ lw (t), solve the optimization problem and get the solution.
of all particles as follows: [35]: where r rand is a uniformly distributed variable generated from the interval [0, 1], and (x) is defined as follows: V ulct (i, z) is the velocity in BPSO algorithm, which is given by [35] where is the inertia weight, γ 1 (i) and γ 2 (i) are random numbers that take values from the interval [0, 2] during each iteration of the BPSO-based algorithm. Then, we derive the values of the variables π l and δ lw (t) associated with each particle similar to steps 5-6. In step 14, we set DONE to one to terminate the while loop when the difference between the best-found objective value and the best objective value in the current iteration is less than a terminating threshold µ. Step 17 shows that the algorithm reaches a solution for the binary variables, then solves our optimization problem after fixing the binary variables.

V. SIMULATION RESULTS
In this section, we investigate the performance of our proposed work under different settings. We consider in the simulation an area of 1000 m × 1000 m. The distribution of the received renewable energy by each relay is a truncated normal distribution with mean 2 W and variance 0.25 in the interval [0, 2.4] [24]. Each result is an average of 30 different scenarios. We compare the optimal solution with the Three-Step and BPSO-based algorithm using a relatively small number of IoT devices and relays due to the computational complexity of finding the exact optimal solution. Then, we analyze the results of the proposed algorithms using a larger number of IoT devices and relays. We simulated our problem using a computer with 40 Xeon(R) CPU E5-2660 v3, 2.60GHz, and 256 GB of memory. Unless specified otherwise, the simulation parameters are shown in Table 3.

A. OVERALL PERFORMANCE COMPARISON
In Fig. 5 and Fig. 6, we present the performance of the optimal solution versus the performance of the Three-Step and BPSO-based algorithms. It is shown that the performance of both algorithms is close to the optimal solution in both figures. Fig. 5 and Fig. 6 shows the objective function and  the number of active relays, respectively, versus the number of IoT devices. The trends of the curves in both figures are similar because the objective function (consumed energy minus harvested energy) is dependent on the number of active relays. As we increase the number of IoT devices, their data demands increase. Hence, more active relays are needed, and more energy is consumed.
The number of served IoT devices per relay is improving as the network becomes larger, i.e., having more IoT devices. For example, Fig. 6 shows that the number of IoT devices per relay ratio are approximately 3 and 5 when the number of IoT devices are 6 and 20, respectively. Interestingly, Fig. 5 shows that the objective value to the number of IoT devices ratios are 8 and 7 when the number of IoT devices are 6 and 20, respectively. Therefore, the relays' energy consumption per the number of IoT devices is improving when the network is getting larger.
B. CONVERGENCE AND COMPUTATIONAL TIME Fig. 7 presents the convergence speed of the BPSO-based algorithm when the number of IoT devices are 20 and 60. It is VOLUME 10, 2022 shown that the algorithm converges to a solution before the 30 th iteration. The gap between the solutions of the first and the 30 th iterations is larger when the number of IoT devices is larger. The reason is that the search space for the algorithm is larger when the number of IoT devices is larger.   Table 4 shows the required time to find solutions for our problem optimally, using Three-Step algorithm and using BPSO-based algorithm. We calculate the computational times while considering two network sizes: 1) Small and 2) Large. When the network size is small, Table 4 shows that the proposed algorithms significantly reduce the computational time. For the large network, the number of variables and number of constraints increase significantly compared with the number of variables and constraints for the small network. Hence, there is no efficient way to solve the problem optimally when the size of the network is large. However, our Three-Step algorithm decomposes the original problem into easier to solve subproblems. Therefore, Three-Step algorithm facilitates finding a solution for our problem when the network size is large. Table 4 shows that BPSO-based algorithm can also solve our problem when its scale is large. Moreover, BPSO-based algorithm provides a solution with a significant reduction in commutation time compared with the Three-Step algorithm.
C. THREE-STEP ALGORITHM VS. BPSO-BASED ALGORITHM In Fig. 8, we study the performance using a larger network and compare the performance of the Three-Step and BPSObased algorithms. We also compare these algorithms with two other schemes: 1) Random Association (RA) scheme and 2) Fixed Transmission Power (FTxP) scheme. In the RA scheme, the relays are active and the associations between the IoT devices and relays and between the relays and servers are done randomly. After finding feasible random solutions for the associations, we solve the optimization problem. On the other hand, FTxP scheme refers to the scenario in which the transmission powers of all IoT devices and relays are fixed and set to the maximum values. Then, the problem is solved to find a solution for the problem.
It is shown in Fig. 8 that the performance of the Three-Step and BPSO-based algorithms are close even with a larger network size. Compared with RA and FTxP schemes, the Three-Step and BPSO-based algorithms significantly reduce the value of the objective function. From Fig. 8, we can conclude that the RA scheme causes significant rise in the objective function value even when the transmission powers are optimized. Moreover, optimizing the association variables in the FTxP scheme results in better performance, compared with RA scheme, even with fixing the transmission power. By jointly optimizing the association variable and the transmission power, the Three-Step and BPSO-based algorithms achieve better performance.
Since each relay has five channels, it can serve up to 5 devices per time slot. We assumed that the total service time is slotted into 5 slots. Therefore, each relay can serve up to 15 IoT devices. Accordingly, we see in Fig. 8 that the curve trends increase significantly as we increase the number of devices by 15 since we will need to activate more relays.

D. PERFORMANCE OF BPSO-BASED ALGORITHM
We present in Fig. 9 the effect of having different relay transmission deadlines for delivering the IoT messages on the objective function. It is shown that the value of the objective function is reduced when the deadline is larger, i.e., the value of T is higher. The reason is that a higher value for T gives the relays more flexibility in delivering the IoT messages, and that may lead to lowering the energy consumption. A higher value for T allows the relay to aggregate messages from the IoT devices and sends them together using a lower number of active slots. As a result, this leads to a lower value for the objective function.  We show in Fig. 10 the effect of increasing the number of available relays on the objective function under different values for T . When the IoT devices have more relays, then they have more options to connect to a better group of relays that minimize the energy consumption and optimize the harvested energy. Moreover, more relays options allow selecting the relays with better channel condition to the servers and located in a better location for energy harvesting. Therefore, we can see in Fig. 10 that more available relays will result in more flexibility in activating the best available relays and reducing the objective function value. Given a certain number of relays, tolerating more delay results in improving the value of the objective function as shown in Fig. 10. Therefore, we proposed a scheme that is flexible and tolerates as much delay as possible according to the qualityof-service requirements of the IoT devices.
The goals of the relay are minimizing the energy consumption and maximizing the harvested energy while satisfying certain constraints, as discussed in the formulation. Fig. 11 shows how the objective function is related to the consumed and harvested energy. When the number of IoT devices  is 15 or lower, harvested energy tends to be more than consumed energy. As the number of IoT devices increases, more energy is needed to support their demands. Because consumed energy is increasing and the harvested energy is limited, the objective function trend is similar to the consumed energy trend.
The number of available channels to the relay is an important factor affecting energy consumption of the relay. Having more channels for the relay allows serving more devices within each time slot. As a result, we need a fewer number of active relays when we increase the number of available channels for relays as can be seen in Fig. 12. This leads to minimizing energy consumption of the relay by minimizing the active time. Therefore, the objective function decreases by increasing the number of available channels as shown in Fig. 13. Fig. 14 illustrates the effect of the received power amount on our objective function. More received power by the relay helps in harvesting more energy in general, and that causes a lower value for our objective function. When the relay does not receive power (i.e., φ l (t) = 0), the objective function is positive since the harvested energy is zero. On the other VOLUME 10, 2022  hand, the objective function is negative when the amount of received power is tripled (i.e., 3 φ l (t), and the number of IoT devices is equal or less than 45. When the number of IoT devices reaches 60, the objective function changes to be positive because energy consumption becomes higher than the harvested energy. Negative objective function indicates that the relays harvest energy more than what they consume.
In Fig. 13, more available energy from a renewable energy source leads to improving the objective function since the relays optimize their energy harvesting while minimizing energy consumption. Hence, we optimize the locations of the relays in our model such that energy harvesting and consumption are optimized. When the location of the relay is optimized, then it should be in the best place that improves energy harvesting and consumption.

VI. CONCLUSION
This paper presented a hybrid energy-efficient optimization framework to support IoT devices with the help of wireless relays. We consider two power sources of the relays: 1) Electric grids and 2) Renewable grids. We propose two low complexity solutions to solve the formulated MILP optimization problem with the goal of supporting the wireless uplink transmission from IoT devices to backhaul servers with an acceptable transmission deadline. Finally, we showed the advantages of using our proposed solutions compared to the performance of the optimal exhaustive search solution.