This limitation is originally due to the fact the total number of meta edges is not known, and can only be computed in O(# edges) when working on undirected graphs. As this number is continuously refreshed by DesktopContext, it's a big loss of performance.
I spent some time to fix this today, and the number of meta-edges is now properly counted, which result in a O(1) request. I added a getTotalEdgeCount() method.
Mathieu
On Sun, Dec 19, 2010 at 7:04 AM, Sébastien Heymann
<sebastie...@gephi.org> wrote:
Hi Mathieu,
I'm currently adapting the Context, Statistics and Filters to support hierarchical graphs. It's going well but I discovered a confusing behavior of HierarchicalGraph.getEdgeCount().
As this method is not overriding Graph.getEdgeCount(), and there is no HierarchicalGraph.getTotalEdgeCount(), the only way to count the number of edges at a certain level is to write:
HierarchicalGraph.getEdgesAndMetaEdges().toArray().length;
which is source of mistakes if we don't test getEdgeCount().
When invoking this method using a HierarchicalGraph instance, I expect it to return the total count of edges and meta-edges. Applied on a visible graph on a level different from the leaves, it always returns 0. I think we could override this method to help developers a little bit more, or this method should be abandoned in every cases we deal with hierarchies :P
What's your opinion?
cheers,
Seb
_______________________________________________
gephi-dev mailing list
geph...@lists.gephi.org
http://gephi.org/mailman/listinfo/gephi-dev