% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/cluster-metrics.R
\name{supra_adjacency}
\alias{supra_adjacency}
\alias{supra}
\title{Supra-Adjacency Matrix}
\usage{
supra_adjacency(
  layers,
  omega = 1,
  coupling = c("diagonal", "full", "custom"),
  interlayer_matrices = NULL
)

supra(
  layers,
  omega = 1,
  coupling = c("diagonal", "full", "custom"),
  interlayer_matrices = NULL
)
}
\arguments{
\item{layers}{List of adjacency matrices (same dimensions)}

\item{omega}{Inter-layer coupling coefficient (scalar or L x L matrix)}

\item{coupling}{Coupling type: "diagonal", "full", or "custom"}

\item{interlayer_matrices}{For \code{coupling = "custom"}, a list of
inter-layer matrices. Accepted shapes:
\itemize{
\item Named list with keys \code{"a_b"} (integer layer indices) or
\code{"<layer_name_a>_<layer_name_b>"}; either order works.
\item Unnamed list of length \code{choose(L, 2)} giving every pair
in upper-triangle row-major order: \code{(1,2), (1,3), ..., (1,L),
      (2,3), ..., (L-1,L)}.
\item Unnamed list of length \code{L-1} giving adjacent pairs only
(legacy chain layout): entry \code{i} is the coupling for
\code{(i, i+1)}. Non-adjacent pairs use \code{omega[a,b] * I}.
}
If no entry matches a pair and no legacy chain layout applies, a
warning is emitted and the diagonal default \code{omega[a,b] * I}
is used (previously this happened silently).}
}
\value{
Supra-adjacency matrix of dimension (N\emph{L) x (N}L)
}
\description{
Builds the supra-adjacency matrix for multilayer networks.
Diagonal blocks = intra-layer, off-diagonal = inter-layer.
}
\examples{
nodes <- c("A", "B", "C")
l1 <- matrix(c(0, 1, 0, 1, 0, 1, 0, 1, 0), 3, 3, dimnames = list(nodes, nodes))
l2 <- matrix(c(0, 1, 1, 1, 0, 0, 1, 0, 0), 3, 3, dimnames = list(nodes, nodes))
layers <- list(L1 = l1, L2 = l2)

# 3 nodes x 2 layers gives a 6 x 6 supra-adjacency matrix.
s <- supra_adjacency(layers, omega = 0.5)
dim(s)
s
}
