Input: a data aggregation tree ๐‘‡ and threshold ๐พ , ๐‘ƒ
/* ๐‘Š be vertex set in tree ๐‘‡ , ๐‘ƒ be depth of the tree ๐‘‡ , ๐พ be stage number */
Output: A maximal independent dominating set
Let ๐ท denote the dominating set constructed at stage ๐พ and be initially set to null
(1) begin
(2) ๐ท โ† ฮฆ
(3) While ๐‘Š โ‰  ฮฆ
(4) Choose a vertex ๐‘– โˆˆ ๐‘Š
(5)  ๐ท = ๐ท โˆช { ๐‘– }
(6)  ๐‘Š = ๐‘Š โงต ฮ“ ( ๐‘– )
(7) End while
(8) Choose a vertex ๐‘ฅ โˆˆ ๐ท of degree ๐‘‘ ( ๐‘ฅ ) = m i n { ๐‘‘ ( ๐‘ข ) โˆฃ ๐‘ข โˆˆ ๐ท } ;
(9) ๐ฝ โ† ฮฆ / โˆ— ๐ฝ  be an independent set  * /
(10) while โˆƒ ๐‘ข โˆˆ ๐ท such that ๐‘ข โˆ‰ ฮ“ ( ๐ฝ ) and all children of ๐‘ข inclusion in ๐ท โˆฉ ( ฮ“ ( ๐ฝ ) ร— ๐ฝ ) do
(11) Let ๐‘ฃ be the parent of ๐‘ข ;
(12)  ๐ฝ โ† ๐ฝ โˆช { ๐‘ฃ } ;
(13) partner ( ๐‘ข ) โ† ๐‘ฃ ;
(14) end
(15) while โˆƒ ๐‘ข โˆˆ ๐ท such that ๐‘ข โˆ‰ ฮ“ ( ๐ฝ ) do
(16) Choose a child ๐‘ฃ of ๐‘ข such that ๐‘ฃ โˆ‰ ๐ท โˆช ฮ“ ( ๐ฝ ) ;
(17)  ๐ฝ โ† ๐ฝ โˆช { ๐‘ฃ } ;
(18) end
(19) Let ๐ผ be a maximal independent set of ๐‘‡ with ๐ฝ โІ ๐ผ and ๐ท โˆฉ ๐ผ = ฮฆ ;
(20) Increment stage number ๐‘˜
(21) Until depth of the tree ๐‘‡ is greater than ๐‘ƒ or the stage number ๐‘˜ is threshold ๐พ
(22) end
Algorithm 1