# Helper utilities shared across all test files.

#' Generate a random undirected binary adjacency matrix
#'
#' @param n Number of nodes.
#' @param p Edge probability.
#' @param seed Optional random seed.
make_adj <- function(n, p, seed = NULL) {
  if (!is.null(seed)) set.seed(seed)
  A <- matrix(0L, n, n)
  A[upper.tri(A)] <- rbinom(n * (n - 1L) / 2L, 1L, p)
  A + t(A)
}
