Algorithm 2. Efficient MCDS Construction Algorithm (EMCDS). |
|
Efficient MCDS Construction Algorithm (EMCDS) |
|
Input: the wireless sensor network G = (V, E), ordered sequence list S, maximal independent set M; |
Output: the connected dominating set D. |
For each node i ∈ S, traverse each distinct node j ∈ S according to the priori, and j is added into the list Pi if j is adjacent to node i and closer / in the same layer to the source; |
Insert all nodes in list M to D in the same priori order; set the state of src as CONNECTED, and all other nodes in M as UNCONNECTED; |
For each node i∈ S excluding the source src; |
If the state of i is UNCONNECTED, change to CONNECTED, and then check Pi in the following way: if there exists a node j ∈ Pi ∩ D, then j is selected as the connected node of i, and i is inserted into Cj; otherwise, select the first node k in Pi as the connected node, and i is inserted into Ck; |
If the state of all nodes in M is CONNECTED, then go to step b6, otherwise go to step b3; |
Remove all the leaf nodes on the spanning tree of set D; |
Set the state of all nodes in D as UNMARKED; |
For each node i ∈ D excluding the source src; |
If the state of i is UNMARKED, change to MARKDED, and then check each j ∈ Ci; if there exists some other candidate parent node in the above or same layer for each j, remove i from the dominating set D, and change its children list Ci; |
End. |
|