  A vertex coloring of a graph is called "perfect" if for any two colors $a$
and $b$, the number of the color-$b$ neighbors of a color-$a$ vertex $x$ does
not depend on the choice of $x$, that is, depends only on $a$ and $b$ (the
corresponding partition of the vertex set is known as "equitable"). A set of
vertices is called "completely regular" if the coloring according to the
distance from this set is perfect. By the "weight distribution" of some
coloring with respect to some set we mean the information about the number of
vertices of every color at every distance from the set. We study the weight
distribution of a perfect coloring (equitable partition) of a graph with
respect to a completely regular set (in particular, with respect to a vertex if
the graph is distance-regular). We show how to compute this distribution by the
knowledge of the color composition over the set. For some partial cases of
completely regular sets, we derive explicit formulas of weight distributions.
Since any (other) completely regular set itself generates a perfect coloring,
this gives universal formulas for calculating the weight distribution of any
completely regular set from its parameters. In the case of Hamming graphs, we
prove a very simple formula for the weight enumerator of an arbitrary perfect
coloring. Codewords: completely regular code; equitable partition; partition
design; perfect coloring; perfect structure; regular partition; weight
distribution; weight enumerator.
