New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Closed
emeeks opened this Issue Apr 2, 2012 · 6 comments

Comments

Projects
None yet
4 participants
@emeeks
Copy link

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(Modularity.java:338)
at org.gephi.statistics.plugin.Modularity$CommunityStructure.access$400(Modularity.java:122)
at org.gephi.statistics.plugin.Modularity.execute(Modularity.java:452)
at org.gephi.statistics.plugin.Modularity.execute(Modularity.java:396)
at org.gephi.statistics.StatisticsControllerImpl.execute(StatisticsControllerImpl.java:154)
at org.gephi.statistics.StatisticsControllerImpl$3.run(StatisticsControllerImpl.java:141)
[catch] at org.gephi.utils.longtask.api.LongTaskExecutor$RunningLongTask.run(LongTaskExecutor.java:251)
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:441)
at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:303)
at java.util.concurrent.FutureTask.run(FutureTask.java:138)
at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)
at java.lang.Thread.run(Thread.java:619)

@taynaud

This comment has been minimized.

Copy link
Contributor

taynaud commented Apr 3, 2012

Hi,

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

Does it happen on every graph ?

@emeeks

This comment has been minimized.

Copy link

emeeks commented Apr 3, 2012

You can find the graph in question here:
http://dhs.stanford.edu/data/cheap_module.gexf

@mbastian

This comment has been minimized.

Copy link
Member

mbastian commented Apr 5, 2012

Happened to me today as well on a weighted graph.

@taynaud

This comment has been minimized.

Copy link
Contributor

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.
https://github.com/taynaud/gephi

@emeeks

This comment has been minimized.

Copy link

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

Merged

Fix #577 #597

@eduramiba eduramiba closed this in ad3821d Apr 22, 2012

@eduramiba

This comment has been minimized.

Copy link
Member

eduramiba commented 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