简体   繁体   English

如何连接图形的两个部分? 在蟒蛇

[英]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.

相关问题 如何将我的python脚本与我的HTML文件连接? - How can I connect my python script with my HTML file? 如果我连接到 mysql,我如何通过 python 导入我的模块? - If I connect to mysql, how can I import my modules by python? 如何根据 python 中的多个标准连接两个数据帧? - How can I connect two dataframes based on mutliple criteria in python? 如何在 Python 中连接到 Google BigQuery 中的两个不同项目? - How can I connect to two different projects in Google BigQuery in Python? 如何用 python 插座连接两台电脑? - How can i connect two computers with python socket? 如何使用Python替换文件中的大部分文本? - How can I replace a large portion of a text in a file using Python? 如何在忽略python括号中的部分的同时拆分字符串 - How can I split strings while ignoring the portion in a parentheses in python 如何将 JSON true 或 false 连接到我的 python 脚本 - How can i connect JSON true or false to my python script Python:如何将两个例外应用于我的正则表达式? - Python: How can I apply two exceptions to my regular expression? 如何绘制散点图并为 Python 中的两个特征绘制预测线? - How can I plot a scatter graph and plot a prediction line for two features in Python?
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM