Refactored all Graph algorithms to its own class