|
|
|
Clear questions and runnable code get the best and fastest answer |
|
| PerlMonks |
Re: OT(ish) - Best Search Algorithmby Melly (Hermit) |
| on Oct 15, 2007 at 15:48 UTC ( #644968=note: print w/ replies, xml ) | Need Help?? |
|
Wow. It's a while since I visited perlmonks, and now I'm wondering why. "Cycle detection" it is. Needless to say, I haven't been slacking, and I quickly realised that my problem is not really about finding shortest paths in a known graph, but is more about building the graph and then looking for any valid path. I think the approach I'm going to take is this (mainly via sql via perl):
Of course, this could get pretty silly - if, on average, everyone has about 15 friends, then I'm going to be checking a lot of pathways - that guy with the chessboard and the rice ain't got nothing on me... Tom Melly, pm (at) cursingmaggot (stop) co (stop) uk
In Section
Seekers of Perl Wisdom
|
|
||||||||||||||||||||||