GraphStream Users

Archives de la liste Aide


Re: Small world analysis


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

Hi,

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,
Cherie

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

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()) {
                k.next();
        }
        for (Node n : g) {
                if (n != node) {
                int depth = k.getDepthOf(n);
                if (depth >0) {
                        pathLength += depth;
                }
        }
}
pathLength /= (graph.getNodeCount() - (graph.getNodeCount()-1));

Yoann



> On Jun 10, 2016, at 6:56 PM, Cherie Pun <cherie.cy.pun AT gmail.com> 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