## 3 Proposed Scheduling Scheme
### Scheduling
```
Function ScheduleSDNpower \((h_{a},r_{0},a_{0},v_{0},M,i_{d},q_{0},r^{\prime},e_{t},w_{c},X,S,D)\) Input: \(h_{a}\): Service sharing parameter \(r_{0}\): Initial service rate \(a_{0}\): Initial allocation parameter \(v_{0}\), Number of devices \(M\): Power management parameter \(i_{d}\): Device index \(q_{0}\): Service allocation queue \(r^{\prime}\): Optimized service rate \(e_{t}\): Processing time \(w_{c}\): Service forwarding parameter \(X\): Power allocation parameter \(S\): Scheduling parameter \(D\): Congestion detection parameter Output: Scheduled power allocation Step 1: Calculate scheduling parameters \(h_{a}\gets r^{\prime}(w_{c})+M\); \(a_{0}\leftarrow(r_{0}*i_{d})+(r^{\prime}-e_{t})\) ; \(i_{d}\gets r^{\prime}-(h_{a}+N)\) ; \(S\leftarrow(\
icefrac{{h_{a}*r_{0}}}{{a_{0}}})+\sum_{v_{0}}\left(M+i_{d} \right)+q_{0}*r^{\prime}-e_{t}\) ; Step 2: Validate and queue device requests for each device in SDN, do if device access is valid, then  Forward service to the requested user on the mentioned time interval; \(q_{0}\leftarrow\) Queue service allocation; \(w_{c}\leftarrow\) Power allocation;  end if;  end while
```  
**Algorithm 1**Scheduling  
```
Function ScheduleSDNpower \((h_{a},r_{0},a_{0},v_{0},M,i_{d},q_{0},r^{\prime},e_{t},w_{c},X,S,D)\) Input: \(h_{a}\): Service sharing parameter \(r_{0}\): Initial service rate \(a_{0}\): Initial allocation parameter \(v_{0}\): Number of devices \(M\): Power management parameter \(i_{d}\): Device index \(q_{0}\): Service allocation queue \(r^{\prime}\): Optimized service rate \(e_{t}\): Processing time \(w_{c}\): Service forwarding parameter \(X\): Power allocation parameter \(S\): Scheduling parameter \(D\): Congestion detection parameter Output: Scheduled power allocation Step 1: Calculate scheduling parameters \(h_{a}\gets r^{\prime}(w_{c})+M\); \(a_{0}\leftarrow(r_{0}*i_{d})+(r^{\prime}-e_{t})\) ; \(i_{d}\gets r^{\prime}-(h_{a}+N)\) ; \(S\leftarrow(\
icefrac{{h_{a}*r_{0}}}{{a_{0}}})+\sum_{v_{0}}\left(M+i_{d} \right)+q_{0}*r^{\prime}-e_{t}\) ; Step 2: Validate and queue device requests for each device in SDN, do if device access is valid, then  Forward service to the requested user on the mentioned time interval; \(q_{0}\leftarrow\) Queue service allocation; \(w_{c}\leftarrow\) Power allocation;  end if;  end while
```  
**Algorithm 2**Scheduling  
```
Step 3: Calculate power allocation  if there is congestion in end-user service, then \(a_{0}=\prod_{s_{u}}w_{c}+X*\left(q_{0}+\frac{r_{0}(D)}{V}\right)*S\)  else if sharing resources when detecting congestion. \(a_{0}=S*r_{0}+\left(\frac{\gamma_{u}*r/M}{X}\right)*\left(q_{0}-e_{t}\right)\). end else if  end if  return scheduled power allocation end function
```  
**Algorithm 1**_Cont._  
Queuing is performed to allocate power for the device to work in concurrent processing. Here, the resources (services) are distributed to the end-user. In this computation step, forwarding is conducted by deploying data that avoids congestion in the SDN. The congestion is addressed in this scheduling method, and it is associated with the queuing of resources. Queuing is examined for the end-user at the mentioned time, and it is represented as \(\left(\frac{\gamma_{u}*r/M}{X}\right)\times\left(q_{0}-e_{t}\right)\). Thus, power allocation is performed concerning the scheduling approach; after this process, the proposed work includes two methodologies: probabilistic balancing and recurrent learning. The following section discusses these two methodologies in detail.