abstract classes and initial implementation for graph representation as a graph