Abstract classes for the graph representation