Code to get the all the path in the a graph