ourMELONS/R/neighbors.R

9 lines
240 B
R
Raw Permalink Normal View History

2022-12-22 13:12:40 +01:00
neighbors <- function(adj_mat, i) {
# NEIGHBORS Find the parents and children of a node in a graph.
# ns <- neighbors(adj_mat, i)
2022-12-22 13:12:40 +01:00
# ns <- myunion(children(adj_mat, i), parents(adj_mat, i))
ns <- find(adj_mat[i, ])
return(ns)
}