Method to discover all possible paths in the graph. Also tests for the algorithm