In the introductory part of the paper, the reasons for voltage regulation in the distribution network are explained, which is necessary for the purpose of ensuring, on average, equal amounts of voltage for network users as close as possible to the nominal value. Then the entire electric power system is described, what it consists of and how it is divided, all the way to the end users, i.e. consumers. In the third chapter, the need for voltage regulation is described more precisely and some general methods of voltage regulation of the distribution network are given. After presenting the general methods of voltage regulation, the fourth chapter explains in more detail the methods of passive and active regulation, such as automatic regulation of the HV or MV bus of the main substation, voltage compensation, voltage regulation using active sources in the network, optimization algorithm. In the last part of the work, the optimization of the voltage conditions and the position of the transformer switches was carried out using mathematical programming. The optimization was performed on a modified IEEE 33-bus model extended with distributed sources. After the analyzes carried out, we can notice an improvement in voltage conditions along the entire network.