This paper deals with the problem of the optimal selection of capacitor banks in electrical AC distribution systems for minimizing the costs of energy losses during a year of operation through a discrete version of the vortex search algorithm (DVSA). This algorithm works with a hypersphere with a variable radius defined by an exponential function where a Gaussian distribution is used to generate a set of candidate solutions uniformly distributed around the center of this hypersphere. This center corresponds to the best solution obtained at the iteration t, which is initialized at the center of the solution space at the iterative search beginning. The main advantage of combining the exponential function with the Gaussian distribution is the correct balance between the exploration and exploitation of the solution space, which allows reaching the global optimal solution of the optimization problem with a low standard deviation, i.e., guaranteeing repeatability at each simulation. Two classical distribution networks composed of 33 and 69 nodes were used to validate the proposed DVSA algorithm. They demonstrated that the DVSA improves numerical reports found in specialized literature regarding the optimal selection and location of fixed-step capacitor banks with a low computational burden. All the simulations were carried out in MATLAB software.