Jacobi's method, one of the oldest approaches to solving this problem, is a finite-difference method that superimposes a grid over the problem space and calculates temperature values at the grid points. The finer the grid, the more accurate the approximation, and the larger the problem.
In the grid approximation that discretizes the physical problem, the heat flow into any given point at a given moment is the sum of the four temperature differences between that point and each of the four points surrounding it. Translating this into an iterative method, the correct solution can be found if the temperature of a given grid point at a given iteration is taken to be the average of the temperatures of the four surrounding grid points at the previous iteration.
From the point of view of numerical analysis, Jacobi's method is a poor approach to this problem, because its rate of convergence is quite slow compared with other methods. It is useful for the purposes of this tutorial, however, because the algorithm is simple, allowing us to focus attention upon the general issue of coding nearest neighbor algorithms in HPF, rather than upon the particular details of a complex algorithm.
For the purpose of this example, think of each point on the grid as an element in a two-dimensional array. The elements around the edge of the array (the first and last row and column) remain fixed at the boundary conditions (the temperatures of the exposed edges), and the interior (non-edge) elements of the array are updated with each iteration.