The remarkable growth of distributed generation (DG) penetration inside electrical power systems turns the familiar passive distribution networks (PDNs) into active distribution networks (ADNs). Based on the backward/forward sweep method (BFS), a new power-flow algorithm was developed in this paper. The algorithm is flexible to handle the bidirectional flow of power that characterizes the modern ADNs. Models of the commonly used distribution network components were integrated with the developed algorithm to form a comprehensive tool. This tool is valid for modeling either balanced or unbalanced ADNs with an unlimited number of nodes or laterals. The integrated models involve modeling of distribution lines, losses inside distribution transformers, automatic voltage regulators (AVRs), DG units, shunt capacitor banks (SCBs) and different load models. To verify its validity, the presented algorithm was first applied to the unbalanced IEEE 37-node standard feeder in both passive and active states. Moreover, the algorithm was then applied to a balanced 22 kV real distribution network as a case study. The selected network is located in a remote area in the western desert of Upper Egypt, far away from the Egyptian unified national grid. Accordingly, the paper examines the current and future situation of the Egyptian electricity market. Comparison studies between the performance of the proposed ADNs and the classical PDNs are discussed. Simulation results are presented to demonstrate the effectiveness of the proposed ADNs in preserving the network assets, improving the system performance and minimizing the power losses.