% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/sparsify_graph.R
\name{sparsify_graph}
\alias{sparsify_graph}
\title{Randomly remove edges from an undirected network}
\usage{
sparsify_graph(A, p)
}
\arguments{
\item{A}{A square symmetric binary matrix (\strong{dense}).}

\item{p}{Numeric in \eqn{[0, 1]}; the probability of retaining each edge.}
}
\value{
A dense integer matrix of the same dimensions as \code{A}.
}
\description{
Each edge in the undirected network is independently retained with
probability \code{p} (equivalently, removed with probability
\code{1 - p}).  The operation generates a symmetric Bernoulli mask on the
upper triangle and mirrors it, preserving the symmetry of the adjacency
matrix.
}
\keyword{internal}
