refactoring features 'SPFA', 'Dijkstra', and 'BFS'.