[英]How can I connect two portion of my graph? in python
Hi all I have a graph which is split in two portion, like I am showing in the photo, I would like to connect the two portion by adding a red edges like I am showing in the photo.大家好,我有一个分为两部分的图表,就像我在照片中显示的那样,我想通过添加红色边缘来连接这两个部分,就像我在照片中显示的那样。 Someone know a networkx function to do that?
有人知道networkx功能可以做到这一点吗?
If you do not have to calculate anything else (meaning the nodes to be connected are fixed - in the example 4 an 6) a simple如果您不必计算任何其他内容(意味着要连接的节点是固定的 - 在示例 4 和 6 中)一个简单的
G.add_edge(4, 6)
will do.会做。 ( documentation )
( 文档)
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.