Loss minimization in distribution networks (DN) is of great significance since the trend to the distributed generation (DG) requires the most efficient operating scenario possible for economic viability variations. Moreover, voltage instability in DNs is a critical phenomenon and can lead to a major blackout in the system. The decreasing voltage stability level restricts the increase of load served by distribution companies. DG can be used to improve DN capabilities and brings new opportunities to traditional DNs. However, installation of DG in non-optimal places can result in an increase in system losses, voltage problems, etc. In this paper, genetic algorithm (GA), harmony search algorithm (HSA) and improved HSA have been applied to determine the optimal location of DGs. Simulation results for an IEEE 33 bus network are compared for different algorithms, and the best algorithm is stated for minimum losses.