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


in reply to Re: OT(ish) - Best Search Algorithm
in thread OT(ish) - Best Search Algorithm

Thanks - I'll take another look at Dijkstra (I think it was the first algo I found, and led me to A*)

map{$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
Tom Melly, pm@tomandlu.co.uk

Replies are listed 'Best First'.
Re^3: OT(ish) - Best Search Algorithm
by perlfan (Vicar) on Oct 15, 2007 at 15:17 UTC
    To use Dijkstra's you'd have to modified it accept the start as the destination, ensured all positive weights (doesn't work for negative cycles), and progressively updated the weights on the edges that you've already found to be part of a cycle so they wouldn't be detected again; but then some edges will be part of other cycles..and on and on and on - in other words, it would be a very BAD way to find all of your circles of friends.