Research Article

Optimal Control through Leadership of the Cucker and Smale Flocking Model with Time Delays

Algorithm 1

Evaluation of the gradient at .
 Input;
(1)The initial conditions are provided and then solve the forward the discrete CS model;
(2)Compute the terminal condition and solve the discrete adjoint equation in (34);
(3)Evaluate the gradient using (35);