GraphStream Users

Archives de la liste Aide

Get Connected Components List

Chronologique Discussions 
  • From: <zboulouard AT>
  • To: graphstream-users AT
  • Subject: Get Connected Components List
  • Date: Tue, 15 Dec 2015 13:09:50 +0100 (CET)


I have just started using GraphStream in a project and I find it a very
interesting tool.

My problem is that I want to retreive the list of connected components but I
only get either their count or at the very best their Ids.

I have tried this code but it doesn't return anything :

ConnectedComponents cc = new ConnectedComponents();
for(ConnectedComponent conn : cc) {
System.out.println("Partie " + + " :");
for(Node n : conn.getEachNode()) {
Object[] attr = n.getAttribute("xy");
Double x = (Double) attr[0];
Double y = (Double) attr[1];
System.out.println(x + " , " + y);

The nodes have an attribute "xy" which contains the coordinates stored as

What did I do wrong? And how can I fix it?


Archives gérées par MHonArc 2.6.16.

Top of page