% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/grip_quality.R
\name{score.layout}
\alias{score.layout}
\title{Score a single layout using graph-aware quality heuristics}
\usage{
score.layout(
  coords,
  edges = NULL,
  n = NULL,
  adj_list = NULL,
  weight_list = NULL,
  edge_weights = NULL,
  clusters = NULL,
  sample.size.stress = 2000L,
  sample.size.nonedge = 5000L,
  stress.seed = 1L,
  nonedge.seed = 1L,
  edge.crossings = c("auto", "always", "never"),
  edge.crossings.max.edges = 1000L
)
}
\arguments{
\item{coords}{Numeric coordinate matrix with 2 or 3 columns.}

\item{edges}{Two-column integer matrix of edges (1-based vertex ids).}

\item{n}{Number of vertices. If omitted with \code{adj_list}, defaults to
\code{length(adj_list)}. If omitted with \code{edges}, defaults to
\code{nrow(coords)}.}

\item{adj_list}{Adjacency list (1-based) for undirected graphs.}

\item{weight_list}{Optional parallel list of positive edge weights.}

\item{edge_weights}{Optional positive edge-weight vector parallel to
\code{edges}.}

\item{clusters}{Optional cluster or community labels of length
\code{nrow(coords)}. When supplied, \code{cluster.separation} is reported.}

\item{sample.size.stress}{Number of vertex pairs sampled for
\code{sampled.stress}.}

\item{sample.size.nonedge}{Number of non-edge pairs sampled for
\code{sampled.nonedge.sep.ratio}.}

\item{stress.seed}{RNG seed used for the stress sample.}

\item{nonedge.seed}{RNG seed used for the non-edge sample.}

\item{edge.crossings}{How to compute \code{edge.crossings} for 2D layouts:
\code{"auto"} computes exact crossings only when the graph is small enough,
\code{"always"} always computes them, and \code{"never"} skips them.}

\item{edge.crossings.max.edges}{Edge-count threshold used by
\code{edge.crossings = "auto"}.}
}
\value{
A one-row data frame with dot-delimited metric names.
}
\description{
\code{score.layout()} evaluates a realized layout without assuming a
canonical embedding. It is the low-level scoring helper behind
\code{\link{compare.layouts}()} and is most useful when you already have
one realized layout in hand, for example from a cached run or another graph
drawing tool. For real-world graphs, quality is judged by graph-distance
faithfulness, edge-length consistency, separation of non-neighbors, and
optionally edge crossings or cluster separation.
}
\examples{
edges <- edges.mesh(5, 5)
coords <- grip(edges, n = 25, dim = 2, preset = "mesh", seed = 1)
score.layout(coords, edges = edges, n = 25)
}
