A path-planning algorithm is proposed to find a path based on local rules applied to a three-layer artificial neural network. Each layer consists of two-dimensionally arranged neurons with recurrent connections within a limited neighbourhood. The output of one layer determines the weights of the connections in the next layer. In principle, the method is based on a diffusion process, but is modified such that it does not suffer from several drawbacks involved in this algorithm. By application of a nonlinear transformation in layer 2, the diffusion front has the qualitative properties of a propagation wave. Therefore, limited resolution of the units is not critical, in contrast to classical diffusion algorithms. Furthermore, the algorithm generally does not suffer from the superposition of diffusion gradients when several paths are possible. The diffusion takes place in a space covered with 'obstacle potentials' which decrease the velocity of the diffusion front. In this way the path can maintain an adjustable safety margin in relation to the obstacles, for example, to cope with problems of incomplete knowledge of the obstacle's position. The algorithm thus combines the advantages of the diffusion algorithm, namely avoidance of local minima, of wave propagation, i.e. coping with limited resolution, and the potential field approach, i.e. maintaining a safety margin in relation to obstacles. The distributed architecture also allows for 'spatial interpolation' between the units (coarse coding), thereby providing smooth path forms. A comparison with paths developed by human subjects shows some similarity on the qualitative level, but there are also obvious differences.