add the in/out degree implementation for the graph