We consider a connected graph, having countably infinite vertex set
X
X
, which is permitted to have vertices of infinite degree. For a transient irreducible transition matrix
P
P
corresponding to a nearest neighbor random walk on
X
X
, we study the associated harmonic functions on
X
X
and, in particular, the Martin compactification. We also study the end compactification of the graph. When the graph is a tree, we show that these compactifications coincide; they are a disjoint union of
X
X
, the set of ends, and the set of improper vertices—new points associated with vertices of infinite degree. Other results proved include a solution of the Dirichlet problem in the context of the end compactification of a general graph. Applications are given to, e.g., the Cayley graph of a free group on infinitely many generators.