GraphStream Users

Archives de la liste Aide

Re: Small world analysis

Chronologique Discussions 
  • From: Cherie Pun < AT>
  • To: Yoann Pigné <yoann.pigne AT>
  • Cc: "graphstream-users AT" <graphstream-users AT>
  • Subject: Re: Small world analysis
  • Date: Sat, 11 Jun 2016 15:27:23 +0100


Thanks for the reply. I read in the documentation that AdjacencyListGraph uses much less memory. I have 300k nodes so I was wondering if it will be more efficient for me to use this class since I don't have properties to set for the edge. Thanks again for helping out.

Kind regards,

On 11 June 2016 at 01:15, Yoann Pigné <yoann.pigne AT> wrote:

Yes, you can compute the average path length using  a Breadth-First Search Iterator on each node, and get the path length from that node to all the others.

Something like that:

double pathLength=0;
for (Node node : graph ) {
        BreadthFirstIterator<Node> k = new BreadthFirstIterator<>(node, false);
        while (k.hasNext()) {
        for (Node n : g) {
                if (n != node) {
                int depth = k.getDepthOf(n);
                if (depth >0) {
                        pathLength += depth;
pathLength /= (graph.getNodeCount() - (graph.getNodeCount()-1));


> On Jun 10, 2016, at 6:56 PM, Cherie Pun < AT> wrote:
> Hi,
> I am trying to find out whether my network in neo4j is a small world network or not, but unfortunately I cannot find how I can measure cluster coefficient and mean average path in neo4j. I googled and found that graphstream has a function for averageClusteringCoefficient which is great! But i couldnt find if graphstream can calculate mean path length or not. Could someone please kindly advise? Or if you know there are other ways for me to do it, please also advise. Thank you very much!
> Kind regards,
> Cherie

Archives gérées par MHonArc 2.6.16.

Top of page