Closed loop distribution system is one of the promising techniques to overcome the shortage of the radial distribution system. Converting the conventional radial distribution system to loop is an interesting research area. The voltage difference during connecting any two buses in radial distribution system, to convert a radial part to loop, is the main problem that should be solved. In this work, a new technique based on applying distributed generators (DGs) to overcome this problem is introduced. This paper proposes a particle swarm optimization (PSO) based algorithm for optimal allocation of DGs in a primary radial distribution system to minimize the difference in voltage between specified two buses so that they could be tied to loop a part of the system. The proposed algorithm makes use of a backward/ forward load flow method for the load-flow analysis of the radial distribution system. The proposed PSO-based algorithm is tested on the IEEE 33 –bus radial distribution system and results are obtained using MATLAB. Discussions are provided based on the obtained results.