Research Article

A Reinforcement Learning-Based Dynamic Clustering Algorithm for Compressive Data Gathering in Wireless Sensor Networks

Algorithm 1

1: initialize the algorithm’s parameters, iteration round , maximum iteration number , action set , reward table of each action , and ASV table
2: whiledo
3: wait for START message
4: for all nodes
5:   if
6:    randomly select an action from A
7:   else
8:    select the action a with the max value in
9:   end if
10:   send the node’s sensing data to the selected CH
11:   calculate the corresponding reward using (11) and
    update the value of using (8)
12: end for
13: for all CHi
14:  CHi receives intra-cluster data packets,
15:  calculates the sparsity Ki of intracluster data,
16:  generates a random Gaussian
   measurement matrix ,
17:  compresses the intra-cluster data using (1) and gets
   compressed measurement vector ,
18:  sends to the sink
19: end for
20: if data transmission is over
21:  the sink broadcasts START message
22:  
23: end if
24: end while