Could it significantly slow down reaching optimality? Could it in fact
be partly responsible for the simulated O(n^2) swaps needed?

Anyway, should I change it to A/B, or keep it at A^2/B^2 ?

On Mon, Aug 21, 2006 at 12:41:04AM +0200, Oskar Sandberg wrote:
> 
> Yeah, the standard approach would be not the square anything. But it
> doesn't really matter: you are still optimizing in the right direction, it
> might just make it a little slower.
> 
> // oskar
> 
> > Here are the comments at the top of
> > freenet.node.LocationManager.shouldSwap():
> >
> >       * If A > B then they switch.
> >       *
> >       * If A <= B, then calculate p = A^2 / B^2. They then switch with
> >       * probability p (that is, switch if rand.nextFloat() < p).
> >
> > I'm concerned about this last bit, if I recall the algorithm
> > correctly, you only square the A and B terms in the two dimensional
> > case, in 1 dimension it would just be p= A / B.
> >
> > Oskar, can you confirm or deny this?
> >
> > Ian.
> >
> > Ian Clarke: Co-Founder & Chief Scientist Revver, Inc.
> > phone: 323.871.2828 | personal blog - http://locut.us/blog
> >
> >
> 
> 
> _______________________________________________
> Devl mailing list
> Devl at freenetproject.org
> http://emu.freenetproject.org/cgi-bin/mailman/listinfo/devl
> 

-- 
Matthew J Toseland - toad at amphibian.dyndns.org
Freenet Project Official Codemonkey - http://freenetproject.org/
ICTHUS - Nothing is impossible. Our Boss says so.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 189 bytes
Desc: Digital signature
URL: 
<https://emu.freenetproject.org/pipermail/devl/attachments/20060821/d0adad50/attachment.pgp>

Reply via email to