Modularity with Edge Weight Causes Array Out-of-Bounds #577

emeeks opened this Issue Apr 2, 2012 · 6 comments


None yet

4 participants

emeeks commented Apr 2, 2012

Modularity runs fine on the network I'm examining if "Use Weights" is unchecked. If it's checked, I get this:

java.lang.ArrayIndexOutOfBoundsException: -1
at org.gephi.statistics.plugin.Modularity$CommunityStructure.zoomOut(
at org.gephi.statistics.plugin.Modularity$CommunityStructure.access$400(
at org.gephi.statistics.plugin.Modularity.execute(
at org.gephi.statistics.plugin.Modularity.execute(
at org.gephi.statistics.StatisticsControllerImpl.execute(
at org.gephi.statistics.StatisticsControllerImpl$
[catch] at org.gephi.utils.longtask.api.LongTaskExecutor$
at java.util.concurrent.Executors$
at java.util.concurrent.FutureTask$Sync.innerRun(
at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(
at java.util.concurrent.ThreadPoolExecutor$

taynaud commented Apr 3, 2012


To help me solve the issue, can you provide a (small) graph which exhibits this behavior ?

Does it happen on every graph ?

emeeks commented Apr 3, 2012

You can find the graph in question here:

mbastian commented Apr 5, 2012

Happened to me today as well on a weighted graph.

taynaud commented Apr 9, 2012

The issue seems to be caused by some floating point arithmetic. When you remove a node from a community (it happens during the execution), the connections between this node community and the neighbors one are updated and removed if weights is 0. With small weights, is is sometimes very close to zero but not strictly zero.

I have written a small workaround on my personnal fork, but I need more investigation and test to see if it is the right fix.

emeeks commented Apr 20, 2012

Any word on whether this will be fixed in trunk anytime soon? I get this error on every weighted modularity I run on different graphs (I guess I make problem weights)

@taynaud taynaud referenced this issue Apr 21, 2012

Fix #577 #597

@eduramiba eduramiba closed this in ad3821d Apr 22, 2012

I tested and merged the fix.
Thank you for the work Thomas.

@mbastian mbastian added Fix Released and removed Fix Committed labels Nov 21, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment