Matthew Toseland wrote:
So a swap will only happen if it minimises stress for *both* nodes, rather than before it would happen if it minimised total stress for both nodes combined. Clearly this is a significant change to the transition probabilities... It might very well lead to false minima?

Yup, I thought it might just reach the optimal solution more slowly but it seems to get permanently stuck at suboptimal solutions.

One thing to try is to use the same random for each node's decision (since this is likely how it will be implemented in practice).

See attached - using the same random number seems to make things slightly worse, I don't know why.

Cheers,
Michael
class SelfishSim extends Simulation
{
	boolean shouldSwap (Node a, Node b)
	{
		double random = Math.random();
		
		// Does the first node agree to the swap?
		double before = 1.0, after = 1.0;
		for (Node c : a.neighbours) before *= distance (a, c);
		for (Node c : a.neighbours) after *= distance (b, c);
		if (after > before && random >= before / after) return false;
		
		// If the first node agreed, does the second node agree?
		before = after = 1.0;
		for (Node d : b.neighbours) before *= distance (b, d);
		for (Node d : b.neighbours) after *= distance (a, d);
		if (after > before && random >= before / after) return false;
		
		return true;
	}
	
	public static void main (String[] args)
	{
		new SelfishSim();
	}
}

<<inline: results.png>>

_______________________________________________
Devl mailing list
[email protected]
http://emu.freenetproject.org/cgi-bin/mailman/listinfo/devl

Reply via email to