Program to traverse and find a path between nodes in a graph