The growing deployment of distributed resources significantly affects the distribution grid performance in most countries. The optimal sizing and placement of these resources have become increasingly crucial to mitigating grid issues and reducing costs. Particle Swarm Optimization (PSO) is widely used to address such problems but faces computational inefficiency due to its numerical convergence behavior. This limits its effectiveness, especially for power system problems, because the numerical distance between two nodes in power systems might be different from the actual electrical distance. In this paper, a scalable bilevel optimization problem with two novel algorithms enhances PSO’s computational efficiency. While the resistivity-driven algorithm strategically targets low-resistivity regions and guides PSO toward areas with lower losses, the connectivity-driven algorithm aligns solution spaces with the grid’s physical topology. It prioritizes actual physical neighbors during the search to prevent local optima traps. The tests of the algorithms on the IEEE 33-bus and the 69-bus and Norwegian networks show significant reductions in power losses (up to 74% for PV, wind, and storage) and improved voltage stability (a 21% reduction in mean voltage deviation index) with respect to the results of classical PSO. The proposed network-oriented PSO outperforms classical PSO by achieving a 2.84% reduction in the average fitness value for the IEEE 69-bus case with PV, wind, and storage deployment. The Norwegian case study affirms the effectiveness of the proposed approach in real-world applications through significant improvements in loss reduction and voltage stability.