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:
- accumulate all the paths as (say) an array of arrays:
5 million paths with an average of roughly 20 items per.
- or turn it into an iterator, so the code using the routines results can operate on the one at a time.
Which is what I did with mine.
- or; write all 5 million paths to disk as strings and then read them all back in again.
In addition to the ovrhead of the IO, you also have to join them and then split them again.
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.
|
---|
Replies are listed 'Best First'. | |
---|---|
Re^10: Finding All Paths From a Graph From a Given Source and End Node
by LanX (Saint) on Nov 02, 2010 at 15:23 UTC |
In Section
Seekers of Perl Wisdom