# Energy-Efficient Edge Optimization Embedded System Using Graph Theory with 2-Tiered Security
## 4 Energy-Efficient Enabled Reliable Edge-SDN Protocol with Graph Theory
### Discussion  
In this section, we present the discussion of the proposed system. The various states of the proposed system and their interactions are depicted in Figure 1. Firstly, network nodes and devices need to register with the nearest gateway device, and later, the weighted condition is evaluated for the generation of subgraphs. Edge devices frequently transmit the network information to the SDN controller, which helps the system to cope with network monitoring. Once all is in control, the data are verified and nodes participate in the blockchain technology [31] to ensure security with integrity. Initially, each node begins to create its memory table with the received information of the neighbors. Then, each neighbor floods their local information with other nodes that reside in the same transmission range. Let us assume the initial routes are denoted by \(r_{1}\), \(r_{1}\), \(r_{1}\), \(\dots\), \(r_{1}\). In the proposed system, whenever any node needs to transmit either its sense data or attributes, it follows any available route from the identified set, as defined below. \[R_{i}=r1,\,r2,\,r3,\,\dots\,\,rn; \tag{1}\]  
subject to  
\[i\,\,\epsilon\,N\]  
In the proposed system, the nodes are organized in an undirected and weighted graph \(G(N,\,E)\). The nodes have no circuit, and each edge has a single weighted value. The weighted value indicates the route cost. The combination of sub-routes made a cumulative cost \(W(T)\), as given in Equation (2). \[W(T)=\sum_{i}^{k}w\_i\,(u,v) \tag{2}\]  
All the identified minimum spanning trees are considered as the groups. In the group's proximity, edge devices are located for data aggregation and transmission toward the SDN layer. Our system utilizes the concept of graph theory. It identifies minimum spanningtrees from Graph \(G\). Each minimum spanning tree is referred to as a subset of Graph \(G\). Moreover, the proposed system identifies primary and secondary minimum spanning trees as defined below. \[S1,\ S2\ \epsilon\ G(N,\ E) \tag{3}\]  
In the proposed system, we explore the Krushkal algorithm for identifying subgraphs or minimum spanning trees [32]. The weighted cost is optimized rather than a single distance value and computed using dynamic attributes of the network. We consider energy \(e\), link lost \(lnl\), and latency_time \(l_{t}\) parameters for the evaluation of the minimum weighted cost of each link, as given in Equation (4). \[min(w\_i)=1/(e+lnl+l_{t}) \tag{4}\]  
In Equation (4), \(e\) is computed based on the consumed power in sending and receiving the data packets, as given below. \[K*(Pr+Pt)/N \tag{5}\]  
where \(Pr\) is receiving power, \(Pt\) is transmission power, \(K\) denotes the number of data packets, and \(N\) is defined as nodes. In the local table, the entry of any node is maintained until its energy consumption is less than the preset threshold, as defined in Equation (6). \[e(s\_i\ \epsilon\ N,\ R)<threshold \tag{6}\]  
Link interference determines the performance of the connected link among consecutive nodes. The link interference is the combination of the data lost \(DL\) and error computation \(EC\), as given in Equation (7). \[lnl=DL+EC \tag{7}\]  
Whenever either data loss or the error ratio increases, the link performance obtained the least priority, and such a link is avoided from consideration in a communication system. To determine the latency time for a particular link, the proposed system utilizes the round-trip time (RTT) in flooding of some beacon messages, \(m\). Thus, \(l\_t\) can be determined, as given in Equation (8). \[l_{t}\ =\ m\ *\ RTT \tag{8}\]  
Moreover, in the proposed system, the outcome of all the metrics is forwarded to the SDN controller, and it creates a record of the individual route. The proposed system explores the intelligence of the SDN controller, which, whenever the value of the computed metrics decreases to a certain threshold, sends the reformulation of a route with the support of an edge device.