Implemented iterative deepening depth first search and used it to find shortest paths as well as distance.