Research Article

Securing Cooperative Spectrum Sensing against DC-SSDF Attack Using Trust Fluctuation Clustering Analysis in Cognitive Radio Networks

Procedure 3

Binary clustering algorithm.
Intput:  C, , and ;
Output:  the set of DC-SSDF attackers () and honest SUs ();
(1) Randomly select an element from and respectively and use their trust vector as the initial mean vector ;
(2) repeat
(3) Initialize ;
(4) for    do
(5)Measure the distance between and () with equation (11);
(6)if    then
(7);
(8)else
(9);
(10)end if
(11) end for
(12) for    do
(13)Calculate the new mean vector  ;
(14)if     then
(15)Update ;
(16)else
(17)Keep the current mean vector unchanged;
(18)end if
(19) end for
(20) until the current mean vector is not updated again