Let P (x, y) be the transition kernel of the Markov chain given by a random walk on a finite graph G (V, E). Let U be a fixed non-empty subset of the vertices V, and take the set of all real-valued functions φ φ with some prescribed values on U. We then define a Hamiltonian by