In order to handle a high penetration of distributed generation (DG), the existing passive distribution systems need to become more active. In the so-called active network (AN), power flow management has developed to cope with bidirectional power flow and the intermittence of DGs. This paper proposes a method to better manage active power flows based on graph theory application and multi-agent system (MAS). While the power system is represented as a directed graph, the optimal power flow (OPF) is understood as a minimum cost flow problem that can be solved by the successive shortest path algorithm. The algorithm is implemented in a distributed way and is supported by MAS. Simulations using a five sub-areas network show that the method is ab...