Skip to content

Commit

Permalink
igraph dfs may signal unreachable nodes with 0
Browse files Browse the repository at this point in the history
* this still seems to be up in the air but at least some preparatory branches
 for igraph 2.0 use a 0 rather than NaN to signal unreachable nodes
* see #517
  • Loading branch information
jefferis committed Jan 31, 2024
1 parent 86ad05e commit c6f6808
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions R/ngraph.R
Original file line number Diff line number Diff line change
Expand Up @@ -504,6 +504,8 @@ prune_vertices<-function(x, verticestoprune, invert=FALSE, ...) {
if(invert) {
nvertices=igraph::vcount(g)
verticestoprune=setdiff(seq_len(nvertices), verticestoprune)
} else {
verticestoprune=setdiff(verticestoprune, 0)
}
dg=igraph::delete_vertices(g, verticestoprune)
# delete_vertices will return an igraph
Expand Down

0 comments on commit c6f6808

Please sign in to comment.