Input: The DAT tree with root and depth , data stored at each tree node .
(1)  Let be the final data aggregation tree.
(2)  Initially all independent set nodes form different components, each node in broadcasts dominatees
    message so that dominatees can know of adjacent independent set nodes in different components.
(3)  for do
(4)  while a dominatee node exists having -adjacent independent nodes of in different components do
(5)  Choose all dominators, denoted as , in level of tree.
(6)  For every dominator do
(7)    Node broadcasts itself as the dominator.
(8)    Node finds the set of unmarked dominators that are within 2-hops of in T, and in
      lower level or , mark all nodes in .
(9)    Dominatees on receiving this message keep a count of neighbouring dominators at level
     or and broadcasts the final count.
(10)  Each level or dominators on receiving the counts from the potential connectors,  
     select among them the node with highest bank as its connector and informs it.
(11)     Node , then becomes a connector; .
(12)     Every node in sends aggregated data to the parent node (a connector node) in .
(13)     Every node that is a parent of some nodes in sends original data to node (which is the
      parent of in ).
(14)  End for
(16) End for /* The identified DAT nodes connect the dominator nodes. Thus, independent set nodes and DAT
nodes forms the CDS of */
(17) The root sends the result to the sink using the shortest path.
Algorithm 2