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


in reply to Re^8: 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

Why?

Because to be useful, you generally have to do something more than just print the path out as a string.

To make it useful, you'd have to either:

I'd try your routine here,but I can't work out where I supply the start and end?


Examine what is said, not who speaks -- Silence betokens consent -- Love the truth but pardon error.
"Science is about questioning the status quo. Questioning authority".
In the absence of evidence, opinion is indistinguishable from prejudice.
  • Comment on Re^9: Finding All Paths From a Graph From a Given Source and End Node

Replies are listed 'Best First'.
Re^10: Finding All Paths From a Graph From a Given Source and End Node
by LanX (Cardinal) on Nov 02, 2010 at 15:23 UTC
    I'd try your routine here,but I can't work out where I supply the start and end?

    Globals! See the post before. (there is no point in passing them as long as you don't use any divide and conquer approach)

    or just:

    Of course @path could be global too and the recursion could be liniarized...

    Not talking about nifty short circuit algorithms...

    Cheers Rolf