Power system simulation using computers is becoming more and more important in design, management and education. Various calculations are required for this, such as power flows, state estimation, random event analyses, security analyses, transmission stability analyses, etc. In this paper, the theoretical bases for the calculation of alternating power flows in electric power networks are defined. Algorithms based on the Gauss-Seidel method, the Newton-Raphson method, and the algorithm of fast separated power flows, or their combination, were specially developed. Within the Matlab software package, the aforementioned algorithms for the calculation of alternating power flows are implemented. For given power networks, the calculation of alternating power flows was performed using developed algorithms. On the basis of the conducted analyses, the advantages and disadvantages of each method were indicated.