reorganize Graph Algorithms