Implement basics of graph class