ourMELONS/R/neighbors.R
2022-12-22 13:12:44 +01:00

8 lines
240 B
R

neighbors <- function(adj_mat, i) {
# NEIGHBORS Find the parents and children of a node in a graph.
# ns <- neighbors(adj_mat, i)
# ns <- myunion(children(adj_mat, i), parents(adj_mat, i))
ns <- find(adj_mat[i, ])
return(ns)
}