I have several meanings, for example: (Elements in a row are in a relationship.)
Vertex relationships(edges) Source vertex Destination vertex x1 26 y1 287 x2 154 y2 303 x1 22 y1 114 x2 115 y2 185 x1 26 y1 287 x2 375 y2 338 x1 26 y1 287 x2 260 y2 393 x1 115 y1 185 x2 121 y2 7 x1 200 y1 101 x2 392 y2 238 x1 99 y1 394 x2 375 y2 338 x1 99 y1 394 x2 121 y2 7 x1 274 y1 28 x2 22 y2 114 x1 296 y1 185 x2 200 y2 101 x1 115 y1 185 x2 154 y2 303
I have to find all the values ββthat are in the relationship and put them in a list, for example: [26,287 154,303 375,338 260,393] I tried using this code:
for (int i=0; i<vertexnum; i++) { adjLists.add(new ArrayList<Integer>()); } for (int j=0; j<vertexnum; j++) { for (Point p : nodes) { for (Edge e : edges) { adjLists.get(j).add(e.p1.x); adjLists.get(j).add(e.p1.y); adjLists.get(j).add(0); adjLists.get(j).add(e.p2.x); adjLists.get(j).add(e.p2.y); adjLists.get(j).add(0); for (Point p1 : nodes) { for (Edge e1 : edges) { if (e1.p1.x == e.p1.x && e1.p1.y == e.p1.y && !adjLists.get(j).contains(e1.p2.x) && !adjLists.get(j).contains(e1.p2.y)) { adjLists.get(j).add(e1.p2.x); adjLists.get(j).add(e1.p2.y); adjLists.get(j).add(0); } else if(e1.p2.x == e.p1.x && e1.p2.y == e.p1.y && !adjLists.contains(e1.p1.x) && !adjLists.contains(e1.p1.y)){ adjLists.get(j).add(e1.p1.x); adjLists.get(j).add(e1.p1.y); adjLists.get(j).add(0); } } } } } }
It creates only one ArrayList, it gives all the elements in a string, and not separately. I tried debugging, but I don't see what causes this.
An example of what I want: 
user4725754
source share