sumprod works on all graphs (unvectorized)