Add abstract base classes for graph.