| Algorithm 1: Initial leader selector Group leader initialization |
| Input: |
| Output: a set of |
| Step 1: Initialization. |
| 1. |
| Step 2. |
| 2. While K ≠ 0 and ≠ 0; do |
| 3: k∗ = |
| 4: if , then |
| 5: |
| 6: |
| 7: |
| 8: K = K − 1 |
| 9: else |
| 10: |
| 11: end if |
| 12:end while |
| 13:return to the leader set. |