Thanks Antonie, for example below it gives "1" for each of the node. is that right? I thought it should be "0.5".
Thanks,
Ann
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 gmail.com> wrote:
From: Antoine Dutot <antoine.dutot AT gmail.com> Subject: Re: BetweennessCentrality To: "ann" <ann_kar_123 AT yahoo.com> Cc: graphstream-dev AT litislab.fr, graphstream-users AT litislab.fr 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:
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 |
|