in reply to OT(ish) - Best Search Algorithm
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) ukmap{$a=1-$_/10;map{$d=$a;$e=$b=$_/20-2;map{($d,$e)=(2*$d*$e+$a,$e**2 -$d**2+$b);$c=$d**2+$e**2>4?$d=8:_}1..50;print$c}0..59;print$/}0..20
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: OT(ish) - Best Search Algorithm
by perlfan (Parson) on Oct 15, 2007 at 16:37 UTC |