Because power generation of renewable resources are unstable and demands of the customers are time-varying, the supply power and demands of the customers are always unequal. To meet the demands of the customers, power is transmitted from primary power generation to secondary power generation. It will cause high power loss. To solve this problem, a distributed algorithm is proposed in this paper. By using the algorithm, the micro-grids are able to exchange power with their neighbors so as to minimize the total power losses of the smart grid. Moreover, communication overhead (bandwidth) is reduced, comparing with centralized algorithm. Through computer simulations, we demonstrate that the proposed algorithm can lead to near-optimal result for alleviating the average power loss per micro-grid and reduce the communication overhead significantly in contrast with the centralized approach.