This work considers a portfolio of units for electrical power production and the problem of utilizing it to maintain power balance in the electrical grid. We treat the portfolio as a graph in which the nodes are distributed generators and the links are communication paths. We present a distributed optimization scheme for power balancing, where communication is allowed only between units that are linked in the graph. We include consumers with controllable consumption as an active part of the portfolio. We show that a suboptimal, but arbitrarily good power balancing, can be obtained in an uncoordinated, distributed optimization framework, and we argue that the scheme will work even if the computation time is limited. We further show that our approach can tolerate changes in the portfolio, in the sense that increasing or reducing the number of units in the portfolio requires only local updates. This ensures that units experiencing faults or need for maintenance can be removed from the graph without affecting the overall performance or convergence of the optimization. The results are illustrated by numerical case studies. Copyright © 2014 John Wiley & Sons, Ltd.