kgraph
kgraph copied to clipboard
nhoods[n].found in wrong place
In my opinion, the line
nhoods[n].found = uu > 0;
should be deleted, but put a line in parallel_try_insert()
if(l<params.K) found = true
before the last line
return l;
Becasue update() checks nhood.found to find a new radiusM. These actions (check and find) are about the node itself, not its neighbors.
You might be right, but I'm not absolutely sure. Could you please do some benchmarking and see if that affects performance?
Thank you for your encourage. I will test it.
Logically '.found' should be set when the node itself has a new neighbor ( a new member in its 'pool') because the test is about the node itself.
But the code sets '.found' when its neighbor or its reverse neighbor has adopted a new neighbor.
In the early iteration, it wouldn't cause big difference because almost every node has '.found' set.
Probably in the later iteration, the insertion becomes fewer, this wrong code may cause some node having new member is ignored because the '.found' was wrongly not set.
Thanks again.