Implement generic heap, DSPA in graph.cpp, graph.h