GraphStream Users

Archives de la liste Aide


Re: BetweennessCentrality


Chronologique Discussions 
  • From: Antoine Dutot <antoine.dutot AT gmail.com>
  • To: ann <ann_kar_123 AT yahoo.com>
  • Cc: graphstream-dev AT litislab.fr, graphstream-users AT litislab.fr
  • Subject: Re: BetweennessCentrality
  • Date: Fri, 17 Dec 2010 22:30:59 +0100
  • Domainkey-signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc:content-type; b=Y5ERO40DrxEbjTEFexG23L3zL+ZiBNTPLt/qZcjFAtxxhUR/jUYri8i520DxAM1Aev KHrKHsrdmO1fk+HMbkhfpAj2qr+lTErXZ/NdB6p+MK7jh+9grJKwnom9cqaBM0uxO3nX LXqEWNLAp7eeETcUlJekJ2TLYrzt2ejlwmmO0=

Hi Ann,

After the algorithm execution, each node contains a "Cb" attribute for the betweeness centrality value:

for(Node node: graph) {
    System.out.println("Centrality of "+node.getId()+" = "+node.getNumber("Cb"));
}

You can also display these values in the graph viewer:

graph.display();
for(Node node: graph) {
    node.setAttribute("ui.label", String.format("%f", node.getNumber("Cb")));
}

Hope this helps,

Antoine

2010/12/17 ann <ann_kar_123 AT yahoo.com>
Hi, I downloaded the greaphstream tool and I would like to calculate he betweenness centrality of the graph.  I used  betweennessCentrality to
Compute the betweenness centrality on the given graph for each node.
 
could you please  let me know what command I need to use to print the centrality values of the  nodes.
 
Thanks,
Ann





Archives gérées par MHonArc 2.6.16.

Top of page