<p>In practice, network operators tend to choose sparse communication topologies to cut costs, and the concurrent use of a communication network by multiple users commonly results in feedback delays. Our goal was to obtain the optimal sparse feedback control matrix $ K $. For this, we proposed a sparse optimal control (SOC) problem governed by the cyber-physical system with varying delay, to minimize $ ||K||_0 $ subject to a maximum allowable compromise in system cost. A penalty method was utilized to transform the SOC problem into a form that was constrained solely by box constraints. A smoothing technique was used to approximate the nonsmooth element in the resulting problem, and an analysis of the errors introduced by this technique was subsequently conducted. The gradients of the objective function concerning the feedback control matrix were obtained by solving the state system and a variational system simultaneously forward in time. An optimization algorithm was devised to tackle the resulting problem, building on the piecewise quadratic approximation. Finally, we have presented of simulations.</p>