We study the interplay between chip-firing games and potential theory on
graphs, characterizing reduced divisors ($G$-parking functions) on graphs as
the solution to an energy (or potential) minimization problem and providing an
algorithm to efficiently compute reduced divisors. Applications include an
"efficient bijective" proof of Kirchhoff's matrix-tree theorem and a new
algorithm for finding random spanning trees. The running times of our
algorithms are analyzed using potential theory, and we show that the bounds
thus obtained generalize and improve upon several previous results in the
literature. We also extend some of these considerations to metric graphs.Comment: To appear in Journal of Combinatorial Theory, Series A -- Revised and
updated. The discussion on metric graphs (now in Appendix A) will not appear
in the journal version. Proofs of the Dhar theorem and the Cori-Le Borgne
theorem are in v1 but not in v