Skip to content

Commit

Permalink
fix: Remove correction for off-by-one error in igraph
Browse files Browse the repository at this point in the history
  • Loading branch information
krlmlr committed Dec 2, 2024
1 parent ab30e7b commit 5d06463
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
4 changes: 3 additions & 1 deletion DESCRIPTION
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ Imports:
cli (>= 2.0.2),
codetools (>= 0.2.16),
data.table (>= 1.12.8),
igraph (>= 2.0.0),
igraph (>= 2.1.2),
knitr (>= 1.34),
ps (>= 1.8.0),
R6 (>= 2.4.1),
Expand Down Expand Up @@ -109,6 +109,8 @@ Suggests:
torch (>= 0.1.0),
usethis (>= 1.6.3),
visNetwork (>= 2.1.2)
Remotes:
igraph/rigraph
Encoding: UTF-8
Language: en-US
VignetteBuilder: knitr
Expand Down
4 changes: 3 additions & 1 deletion R/utils_igraph.R
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,9 @@ targets_adjacent_vertices <- function(graph, v, mode) {
index <- igraph::adjacent_vertices(graph = graph, v = v, mode = mode)
index <- unlist(index, use.names = FALSE)
index <- unique(index)
igraph::V(graph)$name[index + 1]
# igraph >= 2.1.2 fixes the off-by-one error
# https://github.com/igraph/rigraph/pull/1606
igraph::V(graph)$name[index]
}

igraph_leaves <- function(igraph) {
Expand Down

0 comments on commit 5d06463

Please sign in to comment.