0

I would like to ask is there any way to connect all nodes using one and simple method from Jung2 API. I would like to get full graph for the nodes that I did place on my canvas.

1 Answers1

0

Generating a complete graph for a given set of nodes is pretty trivial (and also fairly uncommon), so JUNG doesn't provide a method to do this. The code would look something like this:

for (V v : g.getVertices()) {
  for (V w: g.getVertices()) {
    g.addEdge(createEdge(), v, w);
  }
}

(You'd need to supply an implementation of createEdge().)

Joshua O'Madadhain
  • 2,704
  • 1
  • 14
  • 18
  • Thx for your answear! I would also like to ask is there any way to make SimpleGraph in Jung2 as using SimpleGraph interface as it is said in tutorial ain't working. – NotJustANumber Apr 09 '13 at 20:19