Formula For Gradient Of A Graph