Graph build and search algorithm written (not tested yet, though)