bellman.ford.sp(RBGL)
bellman.ford.sp()所属R语言包:RBGL
Bellman-Ford shortest paths using boost C++
最短路径的Bellman-Ford使用增强的C + +
译者:生物统计家园网 机器人LoveR
描述----------Description----------
Algorithm for the single-source shortest paths problem for a graph with both positive and negative edge weights.
算法单源最短路径图与正面和负面的边缘重量的问题。
用法----------Usage----------
bellman.ford.sp(g,start=nodes(g)[1])
参数----------Arguments----------
参数:g
instance of class graph
类图的实例
参数:start
character: node name for start of path
特点:路径开始的节点名称
Details
详情----------Details----------
This function interfaces to the Boost graph library C++ routines for Bellman-Ford shortest paths. Choose the appropriate algorithm to calculate the shortest path carefully based on the properties of the given graph. See documentation on Bellman-Ford algorithm in Boost Graph Library for more details.
此功能接口,以加速图形库的C + +例程的Bellman-Ford最短路径。选择合适的算法来计算最短路径仔细的基础上给定的图形的属性。 Boost Graph库中的Bellman-Ford算法的详细信息,请参阅文件。
值----------Value----------
A list with elements:
与元素的列表:
参数:all edges minimized
true if all edges are minimized, false otherwise.
如果所有边缘最小,否则为false。
参数:distance
The vector of distances from start to each node of g; includes Inf when there is no path from start.
start每个g节点的距离向量;包括Inf时,有没有从start路径。
参数:penult
A vector of indices (in nodes(g)) of predecessors corresponding to each node on the path from that node back to start </table>
一个指数向量的前辈相应每对从该节点回nodes(g)</ TABLE>路径节点(start)
. For example, if the element one of this vector has value 10, that means that the predecessor of node 1 is node 10. The next predecessor is found by examining penult[10].
。例如,如果此向量元素具有价值10,这意味着节点1的前身是节点10。未来的前身是检查penult[10]。
参数:start
The start node that was supplied in the call to bellman.ford.sp.
起始节点,提供调用bellman.ford.sp在。
作者(S)----------Author(s)----------
Li Long <li.long@isb-sib.ch>
参考文献----------References----------
by Jeremy G. Siek, Lie-Quan Lee, and Andrew Lumsdaine; (Addison-Wesley, Pearson Education Inc., 2002), xxiv+321pp. ISBN 0-201-72914-8
参见----------See Also----------
dag.sp, dijkstra.sp, johnson.all.pairs.sp, sp.between
dag.sp,dijkstra.sp,johnson.all.pairs.sp,sp.between
举例----------Examples----------
con <- file(system.file("XML/conn2.gxl",package="RBGL"), open="r")
dd <- fromGXL(con)
close(con)
bellman.ford.sp(dd)
bellman.ford.sp(dd,nodes(dd)[2])
转载请注明:出自 生物统计家园网(http://www.biostatistic.net)。
注:
注1:为了方便大家学习,本文档为生物统计家园网机器人LoveR翻译而成,仅供个人R语言学习参考使用,生物统计家园保留版权。
注2:由于是机器人自动翻译,难免有不准确之处,使用时仔细对照中、英文内容进行反复理解,可以帮助R语言的学习。
注3:如遇到不准确之处,请在本贴的后面进行回帖,我们会逐渐进行修订。
|