An algorithm to find all paths between two nodes in a graph