I am implementing Louvain algorithm in order execute community detection in 
graph databases. Right now I word on the OrientGraph case study. As far as 
know due to lightweight edges I can't count them this way:

int count = 0;
for(Edge edge : orientGraph.getEdges()) {
    count++;
}

I found the following way to count them:

Set<Object> edges = new HashSet();
for(Vertex v : orientGraph.getVertices()) {
    for( Edge e : v.getEdges( Direction.BOTH ) )
      edges.add( e.getIdentity() );
}
return edges.size();


My question is: Is this the best way to count the edges of an orient graph? 

-- 

--- 
You received this message because you are subscribed to the Google Groups 
"OrientDB" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/d/optout.

Reply via email to