gephi-toolkit
gephi-toolkit copied to clipboard
Issue with Modularity
I'm reading a .gexf and loading 126 nodes with 378 edges. I'm then trying to perform Modularity:
Modularity modularity = new Modularity(); modularity.setRandom(true); modularity.setUseWeight(true); modularity.setResolution(0.8); modularity.setProgressTicket(ticket); modularity.execute(graphModel);
However, the algorithm hangs. Inside ProgressTicket, only start() is called and finish() is never called. It hangs for about 2 minutes and then stops "Process finished with exit code 0". - No errors.
What is going on here?
Hi, this is already reported at https://github.com/gephi/gephi/issues/1630 and is in the list of priority fixes.
Oh I see. It works perfectly in the desktop application, just not in the toolkit.
Do you have any suggestions on how I could maybe get it to work? If I can automate the modularity it would speed my work up a lot :)
We still need to find the bug, though it should not work for you in desktop app either. You can try to avoid parallel edges, since maybe this is other bug already fixed in desktop but not released in toolkit.
I use a java program to build my .gexf and use this file for both the toolkit and the app. I'll run some more tests tomorrow, and ensure there are no parallel edges. Thanks for the help!
I've opened my .gexf in the Gephi app (0.9.1) and I can see that it is merging the parallel weights. I then save this file from Gephi app to a new .gexf.
When I use this new .gexf, the hanging issue still occurs and finish() is never called.
I can't identify why the Gephi app works, and the toolkit does not.
I hope this helps - good luck with the bug :)
That's strange, can you show your java code? Or compare with this example https://github.com/gephi/gephi-toolkit-demos/blob/master/src/main/java/org/gephi/toolkit/demos/HeadlessSimple.java
Sure: https://gist.github.com/Jonty800/d284ff55fb55cd42bb49622b90052ba9
The ProgressTicket just prints out some lines so that I can identify which method is being called.
Mmm can you try to pass the graphModel instead of graph like in https://github.com/gephi/gephi-toolkit-demos/blob/master/src/main/java/org/gephi/toolkit/demos/PartitionGraph.java ?
Yup, I tried with both graph and graphModel since you can use either. The same happens with both.
I see, you can also try to use the latest 0.9.2 snapshot build:
https://github.com/gephi/gephi-toolkit#nightly-builds-092-snapshot
I tried this a couple of days ago with gephi-toolkit-0.9.2-20170504.212034-186-all - same thing
Ok, will you mail me your test file for reproducing it please? Or attach a zip here if you can
Sure -> here is the .gexf produced by my java code, and the same file but opened and then saved by gephi
Thanks! I will check it later
This seems to work with latest toolkit 0.9.2-SNAPSHOT. Can you also test it please?
Sorry for the late reply, it's been a while since I've needed to use Gephi.
I've been testing the 0.9.3-SNAPSHOT of the toolkit and I seem to get the same problem (only start() method is called, and then it hangs).
My gexf is created using java code only. There are duplicates (A vs B, B vs A), as you can see, for edges:
https://gist.github.com/Jonty800/f8a04904857fa0187ae3686c15fe7f09
Any thoughts?
I modified the Gephi code for Modularity.java and stopped it from being asynchronous. I did this by removing
implements Statistics, LongTask
and all associated code from these packages:
import org.gephi.statistics.spi.Statistics;
import org.gephi.utils.longtask.spi.LongTask;
import org.gephi.utils.progress.Progress;
import org.gephi.utils.progress.ProgressTicket;
The class now works. I hope this helps you identify the bug.
https://gist.github.com/Jonty800/999425fbc1061fc2721ad4fc202b8175
Jon
I have experienced the same issue too with multiple threads involved. I thought it was related to the mess of projects/workspaces, but I will give the above tricks @Jonty800 has provided a try and provide updates soon. Finger crossed :)
Closing old issue. I can't reproduce it. Feel free to reopen with additional details. I've added a label on https://github.com/gephi/gephi/issues/1630 to check whether this is still happening.