Introduce Graph::inDegree() and Graph::outDegree() methods.