  We study families of self-adjoint operators with given spectra whose sum is a
scalar operator. Such families are $*$-representations of certain algebras
which can be described in terms of graphs and positive functions on them. The
main result is that in the cases where the graph is one of the extended Dynkin
graphs $\tilde D_4$, $\tilde E_6$, $\tilde E_7$ or $\tilde E_8$, all
irreducible $*$-representations of the corresponding algebra are
finite-dimensional. To prove this fact, we introduce the notion of invariant
functional on a graph and give their description.
