Re: [gephi-dev] Mathieu: HierarchicalGraph.getEdgeCount() would be really useful

1 view
Skip to first unread message

Mathieu Bastian

unread,
Oct 4, 2015, 10:53:17 AM10/4/15
to geph...@lists.gephi.org
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


Sébastien Heymann

unread,
Oct 4, 2015, 11:15:51 AM10/4/15
to Mathieu Bastian, geph...@lists.gephi.org
Cool,

In the same way, HierarchicalGraph.getOpposite(Node n, Edge e)
Should support MetaEdge. Currently it throws a "not an edge" exception when 'e' is a MetaEdge.

With this, the statistics will support hierarchical graphs :)

Seb


2010/12/20 Mathieu Bastian <mathieu...@gmail.com>

Sébastien Heymann

unread,
Oct 4, 2015, 11:15:51 AM10/4/15
to geph...@lists.gephi.org
Reply all
Reply to author
Forward
0 new messages