我想看看 igraph 函数 distances
的代码 我想看看 Dijkstra 算法的实现,看看是否可以尽快做出改变当固定源和目标之间的任何路径超过阈值时,该路径将在搜索中终止。
我可以看到该函数调用了 C_R_igraph_shortest_paths
但我在 Github 上的 R 或 C 的 igraph 包信息中找不到它。我知道距离函数保存在 structural.properties.R
文件中,但我没有比这更进一步的了。
我以前没有看过这个深度,所以我可能错过了一些明显的东西。
最佳答案
看igraph的C接口(interface):
源码在 GitHub 上:
查看 structural_properties.c
。
I'd like to look at the implementation of the Dijkstra algorithm, to see if it is possible to make a change such that as soon as any path, between a fixed source and target, exceeds a threshold then that path is terminated in the search.
是的,这是可能的,并且有一个 Unresolved 问题。欢迎 PR!
关于c - 我如何找到 igraph 的最短路径的底层 C 代码?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/52571006/