JGrapht:使用 DirectedSubgraph.java 类生成子图
我用jgrapht。我将生成子图。
我认为 jgrapht-0.8.2/jgrapht-0.8.2/src/org/jgrapht/graph/DirectedSubgraph.java 对此目的很有用。但我找不到如何使用这个类?你能帮助我吗 ?
例如:jgrapht-0.8.2/jgrapht-0.8.2/src/org/jgrapht/demo/HelloJGraphT.java 有向图构造函数的使用方式与 HelloJGraphT.java 类中的类似
DirectedGraph<String, DefaultEdge> g =
new DefaultDirectedGraph<String, DefaultEdge>(DefaultEdge.class);
I use jgrapht. I will generate subgraphs.
I think jgrapht-0.8.2/jgrapht-0.8.2/src/org/jgrapht/graph/DirectedSubgraph.java
is useful for this purpose. But I could not find how can I use this class? Can you help me ?
For example: jgrapht-0.8.2/jgrapht-0.8.2/src/org/jgrapht/demo/HelloJGraphT.java
A directed graph constructor is used like that in HelloJGraphT.java class
DirectedGraph<String, DefaultEdge> g =
new DefaultDirectedGraph<String, DefaultEdge>(DefaultEdge.class);
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
如果要创建新的子图,则必须编写以下代码:
其中 arg0 是主图,arg1 是子图中的顶点集,arg2 是子图中的边集。
您可以使用以下方法获取边缘集:
我认为您可以以相同的方式获取顶点。
抱歉,我的英语希望对您有所帮助。
if you want to create your new sub graph, you have to write this code:
Where arg0, is your main graph, arg1 is the set of your vertex in your sub graph, and arg2 is the set of your edges in your sub graph.
You can obtain the edged set using:
I think that you could obtain the vertex on the same way.
Sorry for mi English I hope it helps you.