Beruflich Dokumente
Kultur Dokumente
1 2 3 1 2 3 1 2 3 1 2 3
nList(1) ={2} mList(1) ={2} mList(1) ={2} mList(1) ={ }
nList(2) = {1,3} mList(2) ={3} mList(2) ={3} mList(2) ={3}
nList(3) = {2} mList(3) ={ } mList(3) ={ } mList(3) ={ }
Algorithm 1-2 MergeSingle
Input: star subgraphs of G
Output: star subgraphs of G with at least two nodes of each
Communication range: r
Each node u repeatedly executes the following rounds until there is no singleton node:
Round 1: For each node u if it is the singleton in the cluster, it broadcasts a joining message (u,
join) to its neighbors.
Round 2: For each node u, if it receives the joining message (v, join) from any neighbor(s) v,
u broadcasts (u, status) to its neighbors, where the status of u is either member or head.
Round 3: For each node u, if it is the singleton and received the statuses from it neighbors, u
picks the closest neighbor v (has the strongest signal) and u sends message (u, v, join) to join
vs cluster.
Round 4: If u received (v, u, join) and u has at least two nodes, u does the following:
If u is a head, u adds v to its member list, and sends (u, v, IAmHead) to v, and u add v to its
member list. Otherwise,(1) if us cluster has two nodes u and w, let u, v, w form a cluster, i.e., u
sets its status to be head and adds w and v to its member list, and then u sends (u, v,
IAmHead) to v and (u, w, IamHead) to w; (2) if us cluster has more than two nodes, u
leaves its cluster and form a new cluster with v in which u is the head, i.e., u adds v in its
member list, u sends (u, u.head, ILeave) to us head ,and (u, v, IAmHead) to v.
Round 5: When u is a head and u received (v, u, Ileave), u removes v from its member list.
When u is a member, v receives (v, u, IamHead), u sets v to be its head.
Simulation of Algorithm 1-2 and code Case 2 (b)
flag := 1; G G
7 1 7 1
RepeatNum := 0;
while (flag == 1) do the following: 2 2
4 4
flag := 0;
6 6
for each node u 3 3
if u is a singleton (i.e., u.status ==head && u.mList is empty)
{
1. set flag := 1;
2. (i) find a node v closest to u in u.nList.
(ii) Case 1: if v is head (i.e., v.status == head) and v is not singleton (i.e., v.mList is empty),
set u.head := v and u.status := member, add u to v.mList;
Case2: else if v is a member
Let h be vs head (i.e., v.head == h)
(a) if h has more than one member, remove v from h.mList and add v to u.mList
(b) else (h has only one member, say m), set m.status: = head, h.status: =
member,
u.status = member, m.mList = {h, u};
};
RepeatNum := RepeatNum + 1; Case 2 (a)
G G
Case 1 7
G G 5 7 5 1
1 2
7 1 7 1 2
5 2 5 2 4
3 4
3 6
4 4 6
3 3
6 6
Star subgraphs of G Merge Singletons
5 7 7
1 5 1
G 2 2
7 4 4
5 1
2 6 6
4 3 3
6
3 r
r: communication range of G 7 7
5 1 1
2 5
4 2
6 4
6
3
3
3.3. Formation of Routing Backbone for Cooperative Clusters
Algorithm 2 Formation of Routing Backbone
Input: CHs (Cluster Heads), a sink s, and transmission range D= 2r of neighboring
clusters, where r is the normal communication range and D is the communication range
obtained by double transmission energy.
Output: spanning tree of the CHs with the sink as the root
Sink s executes the following rounds:
Round 1: s broadcasts (s, find children), changes its status to reception, and receives
the responses.
Round 2: If s receives message (u, s, child), s adds each u to its children list;
Each CH executes the following round repeatedly L/D times (L is the diameter of the
underlying network) :
Round: (1) If u received messages (v, find children) and us status is not reception, (i) u
selects a message (w, find children) from the received messages with the weakest
signal but larger than the threshold, and sets w to be us parent; (ii) u broadcasts
messages (u, w, child) and (u, find children), and (iv) u changes its status to
reception.
(2) If us status is reception and u received messages (v, u, child), u adds v to us
children list. If us status is reception and u did received any message, u changes its
status to inactive.
2-clustering of G Routing backbone of the clusters