kgraph icon indicating copy to clipboard operation
kgraph copied to clipboard

nhoods[n].found in wrong place

Open gchen2101 opened this issue 6 years ago • 2 comments

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; image Becasue update() checks nhood.found to find a new radiusM. These actions (check and find) are about the node itself, not its neighbors. image

gchen2101 avatar Sep 29 '18 08:09 gchen2101

You might be right, but I'm not absolutely sure. Could you please do some benchmarking and see if that affects performance?

aaalgo avatar Oct 01 '18 00:10 aaalgo

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.

gchen2101 avatar Oct 01 '18 01:10 gchen2101