Research Article

A Lightweight Intelligent Intrusion Detection Model for Wireless Sensor Networks

Algorithm 1

Pseudocode of PM-CSCA.
 Initialize the parameters related to the algorithm: ub, lb, Dim, max_iter, ;
 Generate initial population X containing N individual ;
 Divide X into three subpopulations X1, X2, X3;
 Realize the mutation of three subpopulations by using equations (11)–(13), respectively;
 Evaluate each individual by the objective function;
 Greedy selection: select N individuals from X, X1, X2 and X3 using greedy strategy, and get new population ;
 Do
  Update SCA parameter: ;
  Get y1 from PV by equations (5)–(8);
  Update the y1 by SCA to get y2;
  Evaluate y1 and y2 by the objective function to get [winner, loser];
  for i = 1:Dim
   Update PV via by equations (9) and (10);
   if
    Update the best solution obtained so far;
  end
 while () or (get the expected function value);
 Return the best solution obtained so far as the global optimum;