GraphStream Users

Archives de la liste Aide


Bug in BarabasiAlbertGenerator


Chronologique Discussions 
  • From: <francisco.grimaldo AT uv.es>
  • To: graphstream-users AT litislab.fr
  • Subject: Bug in BarabasiAlbertGenerator
  • Date: Tue, 29 May 2012 20:05:14 +0200 (CEST)


Hi all,

I think I have found a bug in the BarabasiAlbertGenerator class.

When the number of links and nodes is increased (e.g. 200 nodes with
maxLinksPerStep=20), the generator raises several "Aieuu!" errors which
finally
lead to an IndexOutOfBoundsException. I have been having a look to the source
code and the problem is in the first line of function "chooseAnotherNode".
When
it says:
int sumDeg = (edgesCount - degrees.get(index)) * 2;
It should say:
int sumDeg = (edgesCount * 2) - degrees.get(index);

Best,
Francisco Grimaldo



Archives gérées par MHonArc 2.6.16.

Top of page