GraphStream Users

Archives de la liste Aide

Re: Small world analysis

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


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

Something like that:

double pathLength=0;
for (Node node : graph ) {
BreadthFirstIterator<Node> k = new BreadthFirstIterator<>(node,
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