| CFSFDP-E Algorithm |
| 1 Input: , , |
| 2 For each round |
| 3 For each node |
| 4 calculate its residual energy |
| 5 If > 0 |
| 6 the node is still alive, calculate its local density , distance and density-energy |
| 7 calculate |
| 8 If > |
| 9 select node as cluster head |
| 10 end |
| 11 else |
| 12 the node is dead |
| 13 end |
| 14 Sort all the in descending order |
| 15 Allocate normal nodes into several clusters based on the value of |
| 16 Data transmission phase |
| 17 end |
| 18 end |