问题描述
我有一个大图 (vertex# 9,634 and edges# 454,691
)。我正在使用 shortest.paths()
函数来获取最短路径矩阵。
但是,不幸的是,我收到一个错误,At vector.pmt:444 : cannot reserve space for vector,Out of memory
。
我正在使用 R version 3.6.3 (2020-02-29)
Platform: x86_64-pc-linux-gnu (64-bit)
Memory: 64 GB
示例代码如下:
test <- read.csv("~/data.csv")
g1 <- test[1:5,]
graph1 <- graph_from_data_frame(g1,directed = FALSE)
E(graph1)$weight <- is.numeric(g1$weight)
mat_1 <- shortest.paths(graph1) # getting error in this line
我浏览了好几篇帖子,找到了一条信息 here,但是这段代码没有达到我的目的。我需要整个矩阵,然后我必须在这个矩阵中做一些过滤。例如,在获得整个矩阵后,我将只取具有 2
的单元格值。关于过滤,我在 here 有另一个帖子。
非常需要您的帮助和建议。
请注意:我也尝试在 cluster
中使用 87GB,但遇到相同的错误!
解决方法
暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!
如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。
小编邮箱:dio#foxmail.com (将#修改为@)