The integration of information and communication technologies with renewable energy sources will upgrade the conventional power distribution network to a Smart Grid, a smart and economic network, which can reduce power loss and carbon footprints. The power distribution network in the Smart Grid can be regarded as composing of multiple microgrids that include the customers, micro-sources and controllers. We propose the Adaptive-Economic Power Distribution Algorithm (AEPDA), which adaptively changes the topology of the distribution network in order to reduce the power transmission distance and maximize the utilization of renewable energy sources. The algorithm works in two operation states: the 'online' mode when the microgrids are connected to the main power transmission grids and the 'off-line' mode when the microgrids are disconnected from the main grid and are islanded. In the 'on-line' mode, the On-Line Economic Microgrids Coalition Algorithm (OLEMCA) can form optimal coalitions among the mirco-grids; in the 'off-line' mode, the Off-Line Micro-sources Coalition Algorithm (OLMCA) optimizes the coalitions among the micro-generators in each microgrid. The simulation results demonstrate that the proposed algorithms can reduce the power loss in the 'on-line' mode and reduce costs for the customers in the 'off-line' mode.