TITLE: Reference request: discrete harmonic functions and ends of graphs
QUESTION [6 upvotes]: Let $G$ be an infinite locally finite connected graph with finitely many ends.  A real-valued function $f : G \to \mathbb{R}$ is harmonic if 
$$f(v) = \frac{1}{d_v} \sum_{v \sim w} f(w)$$
where $v \sim w$ means that $v, w$ are connected by an edge.  Playing around with a few examples leads me to suspect that the dimension of the space of harmonic functions on $G$ is the number of ends.  (Heuristic: given a harmonic function, start with a vertex $v$ and move to a neighbor $w$ of $v$ such that $f(w) \ge f(v)$.  If $f$ is nonconstant this should give a path converging to an end, and this should be possible for any end.  Moreover a harmonic function should be determined by its "values at the ends.")  Does anyone know if this is true and, if so, does anyone know of a reference for this fact?
(Tags are because a major application is to Cayley graphs of finitely generated groups and I would be interested in seeing how far one can push this method to prove basic facts about ends of such graphs.)

REPLY [12 votes]: Life is much more complicated than that.  In nice situations (for instance, if your graph is $\delta$-hyperbolic), then you can attach a more refined boundary than just the ends and (if you are lucky) solve the Dirchlet problem.  A lot depends on what kinds of regularity conditions you assign to functions on the boundary at infinity.
This is by now a well-established part of geometric group theory.  For instance, it plays a key role in Kleiner's recent new proof of Gromov's theorem on groups with polynomial growth.  See here.
One textbook reference that covers some of this information is 
Woess, W., Random Walks on Infinite Graphs and Groups, Cam- bridge Tracts in Math. 138, Cambridge Univ. Press, 2000
EDIT : By the way, since you are in Cambridge, Curt McMullen at Harvard is a good person to talk to about this kind of stuff.  I learned most of what I know about the subject from a course he taught last year.