refactor Graph and Heap in DataStructure