Wireless Communications and Mobile Computing / 2019 / Article / Alg 1

Research Article

A Center-Based Secure and Stable Clustering Algorithm for VANETs on Highways

Algorithm 1

Clustering algorithm.
Input: Vehicle set V
Output: Initial clusters
1 Initialize center set C = ;
2 Locate the centers and add them into ;
3 Initialize point set = ;
4 while    do
5  foreach point in do
6   Initialize node set clusterp = ;
7   foreach  vehicle e in do
8    if depthen
9     Add into clusterp;
10     Remove from ;
11    end
12   end
13   if clusterpthen
14    Call Algorithm 2;
15    Return set clusterp;
16    Estimate Stc of the CH of clusterp;
17    if Stc is remarkable high  then
18     Check all nodes in clusterp to detect attacker;
19    end
20    else
21      check value of each CM;
22     if Sam  is remarkable high  then
23      Report to the server;
24     end
25    end
26    Add the intersection nearest to which meets the conditions into ;
27   end
28   Remove from ;
29  end
30 end
31 while Vdo
32  foreach point c in C  do
33   Select an element e in V nearest to c;
34   Initialize set clustere= ;
35   Remove e from V;
36   Set e as CH;
37   foreach vehicle v in do
38    ifthen
39     Add into clustere;
40     Remove from ;
41     end
42   end
43   Return clustere;
44   Estimate Stcof the CH e of clustere;
45   if Stc is remarkable high  then
46     Check all nodes in clustere to detect attacker;
47   end
48   else
49    c check value of each CM;
50    if Sam is remarkable high then
51     Report to the server;
52    end
53   end
54  end
55 end

Article of the Year Award: Outstanding research contributions of 2020, as selected by our Chief Editors. Read the winning articles.