Class for Graph algorithms