Input: The DAT tree with has identified and the connectors;
  /* Let   be the cluster, and   its cluster-head.   be the set of 2-hop
  neighbors of     in ;   be the cluster dominated by dominator node ; */
(1) begin
(2) Initially, all nodes are unmarked.
(3)  sends out CH message with the information of   to its neighbors, ,   sends it’s rank
   though CM message to dominator     receiving CM message from all its members computes its
   relative proximity as rank. ranks each node     in   based on non-increasing ordering using proximity rank;
(4)  node with the highest rank among its unmarked 2-hop neighbors becomes a cluster-head and broadcasts
   CH messages to all its neighbors;
(5) After receiving a CH message, for a node , sends a message so that all available nodes in   become
   its dominates;
(6) Each node in turn sends another message to its 2-hop neighbors, making the available nodes
   as potential dominators;
(7)  For all and is the cluster-head of   do
(8)   becomes a cluster-member if it is a 1-hop neighbor of node , and its current state is unmarked. If
    it is the first time that v receives a CH message, will broadcast CM messages to all its neighbors;
(9)  If is a 2-hop neighbor of node , its current state is unmarked, and it is the first time that
    receives a CH message, becomes half-dominated;
(10) If node is a 2-hop neighbor of node and its current state is half-dominated, becomes a
   cluster-member if receives a different CH message for the second time. will broadcast
   CM messages to all its neighbors;
(11) If node is a 2-hop neighbor of node and its current state is half-dominated, becomes a cluster-head
    if does not receive a different CH message again. will broadcast CH messages to all its neighbors;
(12) Dominator node sends CH message to its neighboring dominator; receiving CH message switched
    to become dominator in DAT tree and sends out CM message to the dominator node;
(13) Connectors among its neighboring nodes are activated on receiving CM message and sends out
    CM message to its independent dominators;
(14) Switching from to takes place through local messages;.
(15) The same procedure is repeated among the remaining nodes, until each node in DAT becomes either
    a cluster-head or cluster-member;
(16) End for
(17) End
Algorithm 3