## 5 Network and Data Stream
### Representation of Network Topology  
The network topology can be defined by the nodes and the corresponding links between the nodes in a given network. Whether a link between two nodes exists depends on whether each node of them is within the direct transmission range of the other. In this way, a network topological graph \(G=(N,E)\) can be built, where \(N\) denotes the set of the network nodes and \(E\) denotes the set of the links directly connecting two nodes in the network. Each node in the network may be the source or destination node of a data stream. The set of the input links of the node \(i\) is denoted by \(E^{-}(i)\) and the set of the output links of the node \(i\) is denoted by \(E^{+}(i)\). The link that directly connects the node \(i\) to the node \(j\) is denoted by \(e=(i,j)\). \(\overline{e}=(j,i)\) denotes the reverse path of the link \(e\) (\(e=(i,j)\)). For a path \(P\) and a link \(e\), we use \(e\in P\) to denote that the link \(e\) is in the path \(P\). \(e_{1}e_{2}\in P\) represents that the link \(e_{1}\) and the link \(e_{2}\) are all in the path \(P\) and \(e_{2}\) is the subsequence of \(e_{1}\). For a path \(P\) and a node \(i\), \(i\in P\) denotes the node \(i\) is in the path \(P\). \(d_{ij}\) is the distance between the nodes \(i\) and \(j\). \(l_{i}\) represents the communication radius of the node \(i\). On a single channel, whether the transmission from the node \(i\) to the node \(j\) is successful is discussed in two cases: (1) If \(d_{ij}\leq l_{i}\), then the transmission will be successful; (2) If \(d_{ij}>l_{i}\), then the transmission will be unsuccessful. Each link \(e\in E\) corresponds to a transmission success rate \(t(e)\) representing the success probability of data transmission on the link \(e\). If a link is \(e=(i,j)\), then the transmission success rate of the link is defined as \(t(e)=t(i,j)\). If there is an intermediate node \(r\), the source node \(i\) can send a packet to the destination node \(j\) through the node \(r\), then this path can be expressed as \(P=(i,r,j)\), which represents that the direction of the data stream is \(i\to r\to j\), the transmission success rate of the path is \(t(P)=t(i,r,j)=t(i,r)*t(r,j)\). If \(t(i,r,j)>t(i,j)\), it is indicated that the transmission quality of the path \(i\to r\to j\) is good and better than that of the direct link between the node \(i\) and the node \(j\). Then the network topological graph \(G=(N,E)\) will be modified as following: The direct link between the node \(i\) and the node \(j\) is deleted. The path \(P=(i,r,j)\) is remained in the graph \(G\). The changes of the link quality will lead to updating the network topological graph. In addition, to add or remove some nodes in the network will also lead to updating the network topological graph. In an actual deployment, whether outdoors or indoors, the nodes and the quality of the links in the network may need to be updated due to the battery exhaustion of nodes, nodes sleep, outside interference, the redeployment of nodes or the new nodes waked up or added, etc. So we need an update mechanism of network topological graph. The graph \(G=(N,E)\) indicates a network state at a certain moment. \(G_{0}=(N_{0},E_{0})\) denotes the initial network state. \(G_{t}=(N_{t},E_{t})\) denotes the network state at time \(t\). \(\Delta N_{t}\) and \(\Delta E_{t}\) respectively represent the set of nodes and the set of links added or deleted from the original network from time 0 to time \(t\) due to the changes of the network state. So \(\Delta G_{t}=(\Delta N_{t}\), \(\Delta E_{t})\) indicates the changes of the network state during the period of \(\Delta t\). The cases of adding and removing nodes are discussed as follows:  
Adding nodes: This case refers to that a node restarts to work in the network or a new node is added to the network. After a node is added, the links between the added nodes and its neighbor nodes should be first established, and then the network topological graph should be updated.