The dirichlet energy of a continuous function on \(\mathbb{R}^d\) is the \(L^2\) norm of its gradient.
In the case of a 2D graph, such as a cellular automaton or hopfield network, this can be discretized as the \(L^2\) norm of the difference along each edge.