Community detection of large graph in Java
I'm currently using the GraphStream library to represent a very large directed weighted graph (35000 nodes with about 200000 edges) in Java. My goal is to detect communities of nodes within the graph, and the library has some community detection algorithms built in. My problem is I simply can't get it working. After calling the methods, the library should update each node with its community information and store it in a 'marker' attribute, but this never happens. I don't want to get too into the details of a fairly niche API; I don't feel like that will be very useful to people stumbling upon this in years to come, but basically the result for each node remains as null when using a Leung algorithm object.
Some code follows; but don't spend too much time looking into it, I ask some more useful/ less vague things later on!
Leung l = new Leung(g, "marker");
it = g.getNodeIterator();
while (it.hasNext()) {
l.computeNode(it.next());
}
it = g.getNodeIterator();
while (it.hasNext()) {
Node n = it.next();
System.err.println(n.getAttribute("marker").toString()); //prints null
}
This is obviously a very specific problem to me, but what I'm looking for is really any kind of way of taking a graph in Java and computing (or approximating) the communities in near linear time. The GraphStream library allows me to save a graph in almost any format (including this readable to Gephi) so I am happy to import any other library into my project if need be. I simple need an easy way to compute communities. I understand there are a lot of algorithms around to do this; Girvan-Newman and Louvain Modularity seem to be quite common. But I struggle to find particularly good pseudocode for these, and one implementation of the latter that I found online caused some big out of memory errors (Heap).
The real question IO have is whether there is a nice library or easy method in Java to take a graph and have it detect the community structure within it?
Thank you!
链接地址: http://www.djcxy.com/p/68354.html上一篇: 缺少时间网络中社区检测的数据集
下一篇: Java中大图的社区检测