阅读有向图的Edgelist
我试图将不同的聚类方法应用于我的NetworkX图,该图形很大(2631个边缘和2179个节点)。为此,我想构建/学习嵌入,目前我正在通过Node2Vec算法进行操作。
然而,问题在于,我尚未设法在考虑边缘的方向时弄清楚如何阅读我的edgelist。没有任何权重,因为我没有或需要这些。 我尝试了不同的方法,我当前的代码被这个条目。
nx.write_edgelist(G, "test.edgelist")
G_edges = nx.read_edgelist("test.edgelist")
此外,我尝试了几个也接近。
奇怪的是,这些代码(例如示例1)块没有贯穿,但没有丢失错误。它永远不会结束。此外,在此期间,我还可以运行其他几个代码。然后这些偶尔会丢弃错误:错误!会话/行号在数据库中不是唯一的。历史记录搬到了新的会话57 。
您是否知道read_edgelist
变量的其他方法或其他方法也可以存储边缘的方向?
任何帮助都非常感谢,当您有任何疑问或我身边有误会时,请告诉我。
多谢
I am trying to apply different clustering methods to my networkx Graph, which is quite big (2631 edges and 2179 nodes). For that to work I would like to build/learn embeddings, which I am currently doing via the Node2Vec algorithm.
The problem however is that I didn't yet manage to figure out how to read my edgelist while considering the direction of the edges. Without any weights tho, as I do not have or need those.
I tried out different approaches, my current code is inpired by this entry.
nx.write_edgelist(G, "test.edgelist")
G_edges = nx.read_edgelist("test.edgelist")
Moreover, I tried several of those approaches as well.
Oddly enough, these Code (e.g. Example 1) chunks do not run through, but without throwing an error. It just never finishes. Additionally, I am able to run several other chucks of code in the meantime. These then occasionally throw errors claiming: ERROR! Session/line number was not unique in database. History logging moved to new session 57.
Do you know any other approach or addition to the read_edgelist
variable to store the direction of the edges as well?
Any help is greatly appreciated, please let me know when you have any questions or there are misunderstandings at my side.
Thanks a lot
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)