The aim of this article is to study the problem of constructing mutiresolution analysis on Vilenkin group. Previous papers by S. F. Lukomskii, Iu. S. Kruss and the author present an algorithm for constructing scaling functions ϕ with compact support, Fourier transform of which also has compact support. The description of such algorithm is tightly connected with directed graphs of special structure, which are constructed with the help of so-called N-valid trees. One of the special properties of these graphs is the absence of directed cycles — contours.