% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/cluster-metrics.R
\name{layer_similarity}
\alias{layer_similarity}
\alias{lsim}
\title{Layer Similarity}
\usage{
layer_similarity(
  A1,
  A2,
  method = c("jaccard", "overlap", "hamming", "cosine", "pearson")
)

lsim(A1, A2, method = c("jaccard", "overlap", "hamming", "cosine", "pearson"))
}
\arguments{
\item{A1}{First adjacency matrix}

\item{A2}{Second adjacency matrix}

\item{method}{Similarity method: "jaccard", "overlap", "hamming", "cosine",
"pearson"}
}
\value{
Numeric similarity value
}
\description{
Computes similarity between two network layers.
}
\examples{
A1 <- matrix(c(0,1,1,0, 1,0,0,1, 1,0,0,1, 0,1,1,0), 4, 4)
A2 <- matrix(c(0,1,0,0, 1,0,1,0, 0,1,0,1, 0,0,1,0), 4, 4)

layer_similarity(A1, A2, "jaccard")  # Edge overlap
layer_similarity(A1, A2, "cosine")   # Weight similarity
}
