显然不合理的“vector.pmt:444:无法为向量保留空间,内存不足”与 igraph

问题描述

我在使用 igraph/tidygraph 时遇到以下错误vector.pmt:444 : cannot reserve space for vector,Out of memory

不过,似乎与内存问题无关。事实上,在类似的大型网络上运行我的脚本时,我没有出现同样的错误

我正在使用我正在开发的包 biblionetwork 来计算边表。当我使用我的 biblio_coupling() 函数时,一切正常:我可以用 tidygraph::tbl_graph() 创建我的图,并带有边和节点。当我使用我的 coupling_strength() 函数(这只是一种计算边缘权重的不同方法)时,tbl_graph() 函数给了我上面的错误。我曾尝试使用 coupling_strength()tbl_graph() 在其他输入数据(大十倍)上重现此错误,并且运行良好。

这是一个可重现的例子:

devtools::install_github("agoutsmedt/biblionetwork",force = TRUE)
library(biblionetwork) #Ref_stagflation and Nodes_stagflation are included in the package
library(tidygraph)

# this is working perfectly well
edges <- biblio_coupling(Ref_stagflation,source = "Citing_ItemID_Ref",ref = "ItemID_Ref")
graph <- tbl_graph(nodes = Nodes_stagflation[Type == "Stagflation"],edges = edges,directed = FALSE,node_key = "ItemID_Ref")

# this is not working
edges_bis <- coupling_strength(Ref_stagflation,edges = edges_bis,node_key = "ItemID_Ref")

您可以比较 edgesedges_bis 以查看它是完全相同的文件,只是权重值发生了变化。我曾尝试用 edges_bis 权重 (edges) 替换 edges_bis$weight <- edges$weight 权重,但此后错误仍然存​​在。我已经在具有 8000 个节点和 300 000 个边的类似网络上测试了相同的东西,并且它运行良好。 所以我完全在为此苦苦挣扎,我不知道问题出在哪里。

非常感谢您的帮助,

最好,

奥雷利安

解决方法

暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!

如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。

小编邮箱:dio#foxmail.com (将#修改为@)