This paper presents the application of Flexible Alternating Current Transmission System (FACTS) devices based on heuristic algorithms in power systems. The work proposes the Autonomous Groups Particle Swarm Optimization (AGPSO) approach for the optimal placement and sizing of the Static Var Compensator (SVC) to minimize the total active power losses in transmission lines. A comparative study is conducted with other heuristic optimization algorithms such as Particle Swarm Optimization (PSO), Timevarying Acceleration Coefficients PSO (TACPSO), Improved PSO (IPSO), Modified PSO (MPSO), and Moth-Flam Optimization (MFO) algorithms to confirm the efficacy of the proposed algorithm. Computer simulations have been carried out on MATLAB with the MATPOWER additional package to evaluate the performance of the AGPSO algorithm on the IEEE 14 and 30 bus systems. The simulation results show that the proposed algorithm offers the best performance among all algorithms with the lowest active power losses and the highest convergence rate.