Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我想问有没有什么方法可以使用 Jung2 API 中的一种简单方法来连接所有节点。我想获得我放置在画布上的节点的完整图表。
为给定的一组节点生成一个完整的图非常简单(而且也相当少见),因此 JUNG 没有提供执行此操作的方法。代码看起来像这样:
for (V v : g.getVertices()) { for (V w: g.getVertices()) { g.addEdge(createEdge(), v, w); } }
(您需要提供 createEdge() 的实现。)