http://www.perlmonks.org?node_id=906134


in reply to Re^15: Finding All Paths From a Graph From a Given Source and End Node
in thread Finding All Paths From a Graph From a Given Source and End Node

Oh Great!

I appear to have used the word 'elongation' in a somewhat confusing manner. I didn't consider the fact that A->B->C->G->H->C->D->E is actually an elongation of A->B->C->D->E. But the intended meaning is that having arrived at E, if there is nothing else beyond E to which the path should go, then it ends

And! The focus of the work is to list the possible paths from a given node, without getting stuck in a loop somewhere. This would mean that for the hypothetical example we are using here the following paths should result:

a. A->B->C->D->E

b. A->B->C->J->K

c. A->B->C->D->G->H->C->J->K

And! Yes. Your model of what is going on is so very viable.

Of course we all would rather like to take any of the short routes. In nature however, the shortest routes sometimes are not the best and the objective here is to outline all the possible routes; and number them appropriately 'route1, route2, route3...', affording one the chance to look closely at each route and see its workability.

Thanks a lot for your time. Its good to hear of a possible solution.