This paper studies the matrix
equation f(Z) = D + λJ where f is a polynomial, Z a square (0,1)-matrix, D is
diagonal, λ≠0 and J is the matrix of ones. If Z is thought of as the incidence matrix
of a digraph G, the equation implies various path length properties for G. It is shown
that such a graph is an amalgamation of regular subgraphs with similar path length
properties. Necessary and sufficient parameter conditions on the matrix Z
are given in order that it satisfy such an equation for a fixed polynomial f
and all non-regular digraphs corresponding to quadratic polynomials f are
found.