Adds a definition for degree of a graph.