RBGL, shortest paths, edge weights, and the new graph class
0
0
Entering edit mode
Seth Falcon ★ 7.4k
@seth-falcon-992
Last seen 10.3 years ago
Paul Shannon <pshannon at="" systemsbiology.net=""> writes: > It looks as if some of the RBGL functions ('sp.between' for example) > depend > upon the old graph class, pre 1.10, in which edge weights were > an obligatory attribute. Please tell us sessionInfo() so we know which RBGL and which graph you are using. > sp.between (g, 'F', 'L') > Error in if (any(eWW[eWW < 0])) stop("sp.between requies that all > edge weights are nonnegative") : > missing value where TRUE/FALSE needed > > > sp.between <- function (g, start, finish) > { > ... > eW = edgeWeights(g) > eWW <- unlist(eW) > if (any(eWW[eWW < 0])) > stop("sp.between requies that all edge weights are nonnegative") > > > Is there any plan to accommodate the new 'weightless' graph class > design? > Or is there any workaround anybody can suggest? Certainly there could be an issue yet to solve, but this did get some testing and "should" work :-) In other words, edgeWeights will return an appropriate structure defaulting to all 1's if no edge attribute named "weight" has been defined. If such an edge attribute _has_ been defined, then it's values will be used to contruct an appropriate list in the edgeWeights call. For your graph g, what does edgeDataDefaults(g) say? + seth
SystemsBiology graph RBGL SystemsBiology graph RBGL • 1.1k views
ADD COMMENT

Login before adding your answer.

Traffic: 651 users visited in the last hour
Help About
FAQ
Access RSS
API
Stats

Use of this site constitutes acceptance of our User Agreement and Privacy Policy.

Powered by the version 2.3.6