GraphStream Users

Archives de la liste Aide

Re: BetweennessCentrality

Chronologique Discussions 
  • From: ann <ann_kar_123 AT>
  • To: Antoine Dutot <antoine.dutot AT>
  • Cc: graphstream-dev AT, graphstream-users AT
  • Subject: Re: BetweennessCentrality
  • Date: Fri, 17 Dec 2010 15:44:09 -0800 (PST)
  • Domainkey-signature: a=rsa-sha1; q=dns; c=nofws; s=s1024;; h=Message-ID:X-YMail-OSG:Received:X-Mailer:Date:From:Subject:To:Cc:In-Reply-To:MIME-Version:Content-Type; b=A0pQzFKk41Fa8ZoVLXGv90NmqkbOjzv0dOpyfYokJuGzpmZclC6ZKAZDfCeL2z+P+dRd2FSpsg3N/rbOowAgrqafrrmacRtDd63TKvMksSvAImFpspG9HK7NLXv46cB4jPfXe00ahmE485D0Re1VSC/9IkaS4nXujbX47WU/Xmw=;

Thanks Antonie,  for example below it gives "1" for each of the node. is that right? I thought it should be "0.5". 
   graph.addNode("A" );
   graph.addNode("B" );
   graph.addNode("C" );
   graph.addNode("D" );
   graph.addEdge("BA", "B", "A");
   graph.addEdge("AD", "A", "D");
   graph.addEdge("BC", "B", "C");
   graph.addEdge("CD", "C", "D");

--- On Fri, 12/17/10, Antoine Dutot <antoine.dutot AT> wrote:

From: Antoine Dutot <antoine.dutot AT>
Subject: Re: BetweennessCentrality
To: "ann" <ann_kar_123 AT>
Cc: graphstream-dev AT, graphstream-users AT
Date: Friday, December 17, 2010, 2:30 PM

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:

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

Hope this helps,


2010/12/17 ann <ann_kar_123 AT>
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.

Archives gérées par MHonArc 2.6.16.

Top of page