简体   繁体   English

Java Jung Vertex削减图形

[英]Java Jung Vertex Cuts in Graphs

I am trying to do vertex cuts on graphs in the JUNG graph package. 我试图在JUNG图形包中的图形上进行顶点切割。 This is best explained by the following pictures: 最佳解释如下图: 在Vertex Cut之前

Now, I am going to cut vertex "c1" out of the graph: 现在,我要从图中切出顶点“c1”: 在Vertex Cut之后

As you can see vertex "c1" has been removed from the graph, but so have the vertices "c2" and "c3" 正如您所见,顶点“c1”已从图中删除,但顶点为“c2”和“c3”

I want the vertices "c2" and "c3" to stay in the graph when I cut vertex "c1". 当切割顶点“c1”时,我希望顶点“c2”和“c3”保留在图形中。

I am using the removeVertex(V vertex) function to remove vertex "c1" from the graph. 我正在使用removeVertex(V vertex)函数从图中删除顶点“c1”。

  1. How can I implement my code to keep vertices "c2" and "c3" when I cut vertex "c1"? 当我切割顶点“c1”时,如何实现我的代码以保持顶点“c2”和“c3”?
  2. I am using a Forest as my graph type 我使用Forest作为我的图表类型

您可以查看DelegateForest及其removeVertex(vertex,boolean)命令,该命令允许您指定是否删除以顶点为根的整个子树

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM