Climate change, improved energy efficiency, and access to contemporary energy services are among the key topics investigated globally. The effect of these transitions has been amplified by increased digitization and digitalization, as well as the establishment of reliable information and communication infrastructures, resulting in the creation of smart grids (SGs). A crucial aspect in optimizing energy production and distribution is reactive power optimization, which involves the utilization of algorithms such as particle swarm optimization (PSO). However, PSO algorithms can suffer from premature convergence and being trapped in local optima. Therefore, in this research the design and development of an improved PSO algorithm for minimization of power loss in the context of SGs is the key contribution. For digital experimentation and benchmarking of the proposed framework, the IEEE 30-bus standardized model is utilized, which has indicated that an improvement of approximately 11% compared to conventional PSO algorithms can be achieved.