r - 相邻顶点表格 igraph 不能处理传入的关系?
问题描述
使用包中的选项“in”adjacent_vertices
确实igraph
会为顶点 5 提供输出,即使它应该列出 1、2、3、4。
g <- make_graph(c(1, 2, 2, 3, 3, 4, 5, 6), directed = T)
adjacent_vertices(g, v= c(5), mode = "in")
# output
[[1]]
+ 0/6 vertices, from 3aecb67:
但是对于无向图,它可以工作:
g <- make_graph("Zachary")
adjacent_vertices(g, c(1, 34))
# output
[[1]]
+ 16/34 vertices, from 4414f0d:
[1] 2 3 4 5 6 7 8 9 11 12 13 14 18 20 22 32
[[2]]
+ 17/34 vertices, from 4414f0d:
[1] 9 10 14 15 16 19 20 21 23 24 27 28 29 30 31 32 33
为什么是这样?还有哪些其他方法可以识别传入关系序列中的所有顶点?
解决方案
推荐阅读
- kentico-kontent - 自定义 Kentico 内容
- android - 如何在 NFC 标签中保存视频、音频?
- flutter - 如何避免在颤振中使用 setState 重建所有小部件
- python - 是否可以将用户输入从 dag 传递到气流中的子 dag?
- linux - 为什么程序会在推送指令上捕获 SIGSEGV?
- javascript - 有条件地防止 Vue 中的点击事件
- jenkins - 每次推送任何分支后如何构建 Jenkins?
- sql - 您能否将标量函数的输出与检查语句中的标量进行比较?SQL
- laravel - 如何使用 Laravel 排队上传到 s3?
- c# - 如何多次计算并在表格中显示每个答案