dijkstra.sp(RBGL)
dijkstra.sp()所属R语言包:RBGL
Dijkstra's shortest paths using boost C++
Dijkstra最短路径使用增强的C + +
译者:生物统计家园网 机器人LoveR
描述----------Description----------
dijkstra's shortest paths
Dijkstra最短路径
用法----------Usage----------
dijkstra.sp(g,start=nodes(g)[1], eW=unlist(edgeWeights(g)))
参数----------Arguments----------
参数:g
instance of class graph
类图的实例
参数:start
character: node name for start of path
特点:路径开始的节点名称
参数:eW
numeric: edge weights.
数字:边权重。
Details
详情----------Details----------
These functions are interfaces to the Boost graph library C++ routines for Dijkstra's shortest paths.
这些函数接口,以加速图形库的C + +例程Dijkstra最短路径。
For some graph subclasses, computing the edge weights can be expensive. If you are calling dijkstra.sp in a loop, you can pass the edge weights explicitly to avoid the edge weight creation cost.
对于一些图的子类,计算边权重可以是昂贵的。如果要调用dijkstra.sp在一个循环,你可以通过边权明确,以避免边缘重量创作成本。
值----------Value----------
A list with elements:
与元素的列表:
参数: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 dijkstra.sp.
起始节点,提供调用dijkstra.sp在。
作者(S)----------Author(s)----------
VJ Carey <stvjc@channing.harvard.edu>
参考文献----------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----------
bellman.ford.sp, dag.sp, johnson.all.pairs.sp, sp.between
bellman.ford.sp,dag.sp,johnson.all.pairs.sp,sp.between
举例----------Examples----------
con1 <- file(system.file("XML/dijkex.gxl",package="RBGL"), open="r")
dd <- fromGXL(con1)
close(con1)
dijkstra.sp(dd)
dijkstra.sp(dd,nodes(dd)[2])
con2 <- file(system.file("XML/ospf.gxl",package="RBGL"), open="r")
ospf <- fromGXL(con2)
close(con2)
dijkstra.sp(ospf,nodes(ospf)[6])
转载请注明:出自 生物统计家园网(http://www.biostatistic.net)。
注:
注1:为了方便大家学习,本文档为生物统计家园网机器人LoveR翻译而成,仅供个人R语言学习参考使用,生物统计家园保留版权。
注2:由于是机器人自动翻译,难免有不准确之处,使用时仔细对照中、英文内容进行反复理解,可以帮助R语言的学习。
注3:如遇到不准确之处,请在本贴的后面进行回帖,我们会逐渐进行修订。
|