I am trying to sort a collection of nodes of Graphstream by an attribute. I am not sure how this can be done.
Collection <Node> function (Graph graph){
BetweennessCentrality bcb = new BetweennessCentrality();
bcb.init(graph);
bcb.compute();
System.out.println("A=" + graph.getNode("A").getAttribute("Cb")); // prints the calculated measure
return graph.getNodeSet();
}
The function returns the set of nodes with their attributes but not sorted.
How can I sort the collection of nodes by the attribute calculated?