This paper describes an algorithm for determining the optimal reconfiguration of the distribution network using a heuristic method and a genetic algorithm. Although similar approaches have been developed so far, the algorithm described in this paper brings a number of peculiarities and improvements that enable its application to distribution networks of realistic sizes and a high degree of structural complexity. Determining the optimal structure of the distribution network can be done with the aim of minimizing losses of working energy or equalizing the level of network load. In doing so, care is taken to maintain the radial structure of the network’s power supply and to satisfy various physical and operational constraints in the network. With minor modifications in the heuristic part of the algorithm, it is possible to adapt the algorithm for the problem of determining the optimal structure of the distribution network for the purpose of equating the voltage profile of the network. The proposed algorithm was applied to a real distribution network, and the calculation results show the quality and accuracy of the obtained results, as well as an enviably short calculation time.