A discrete harmonic function on a finite connected simple graph with at least two vertices
is a real-valued function whose value at each specified
graph vertex is the arithmetic
mean of its values at the adjacent vertices.
Writing
for adjacent vertices, this condition is
where
is the vertex degree. This averaging condition is
a discrete analog of the condition satisfied by a harmonic
function.
More generally, assign a positive real number
to each graph edge. The weighted harmonicity condition
replaces the arithmetic mean by
The unweighted condition is recovered when all (Doyle and Snell 2006, p. 36).
For a nonempty subset of the vertex set
, arbitrary real values prescribed on
have a unique extension to
that is harmonic at every graph
vertex in
. Its values lie between the smallest and largest prescribed
values. To prove this bound, suppose a global largest value is attained outside
.
Positivity in the averaging equation forces every graph
vertex adjacent to it to have the same value.
Repeating this argument along a graph path to
shows that the largest value is attained on
. Applying the same argument to
gives the lower bound.
The difference of two extensions with the same boundary values is harmonic and zero on , so the bounds force it to vanish everywhere. This proves
uniqueness. Existence is immediate if
. Otherwise the interior averaging equations form a linear
system of equations with as many equations as unknown interior values. With zero
boundary values, the uniqueness argument gives only the zero solution, so its coefficient
matrix is nonsingular
and every choice of boundary values has a solution. This extends the averaging argument
for finite grids and two-boundary networks to any nonempty
(Doyle and Snell 2006, pp. 13-14 and 36; Nachmias 2020).