|
From: Laszlo G. <gu...@la...> - 2003-07-29 14:59:30
|
Hi,
I think I've found a bug in NetUtilities. More specifically, I think
randomRewire() messes up the internal structure of DefaultNodes.
What happens is that the collection returned by getOutNodes()
and the one resulting from calling getTo() on each member of
the list returned by getOutEdges() will be inconsistent. The
reason for this, I believe, is that the following lines in randomRewire()
((Node) nodes.get (j)).removeInEdge (edge);
edge.setTo ((Node) nodeIndexer.get (newJ));
((Node) nodes.get (newJ)).addInEdge (edge);
should rather read as follows:
((Node) nodes.get (j)).removeInEdge (edge);
((Node) nodes.get (i)).removeOutEdge (edge);
edge.setTo ((Node) nodeIndexer.get (newJ));
((Node) nodes.get (newJ)).addInEdge (edge);
((Node) nodes.get (i)).addOutEdge (edge);
A similar fix may be in order for randomRewireSymmetric(), too.
Regards,
-=- gulya
|