The distribution networks of agglomerated areas of the developing countries are generally the seat of overloads, voltage drops, and untimely interruptions of the power supply. This paper consisted of optimizing the grid topology and placement of a DSTATCOM in a SBEE real distribution network in order to improve its technical performance. The modified ant colony algorithms solved this difficult combinatorial problem, which integrated among the criteria, the minimization of the losses and the deviation of the node voltages under operational constraints about distribution networks operation. According to the results obtained, the optimization of the topology of a distribution network and the placement of DSTATCOM contributed qualitatively to improve the losses, voltage and stability plans of the Togba distribution network. Actually, the hybridization of optimization means such as the placement of DSTATCOM and the reconfiguration of the networks applied to the Togba HVA network made the power of DSTATCOM optimization possible by almost 50.71% and reduce losses to 83.57%. The implementations of those algorithms are very efficient and effective, and can be implemented to help distribution system operators, developing countries and in particular, the operators of the Beninese Electric Power Company to perform their electrical network.