Graph Implementation for Finding the Degree of the an Element