Created Graph class to manage the vertices.