Polynomial approximation on graphs