% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/grip_layout_weighted_nd.R
\name{weighted.grip.nd}
\alias{weighted.grip.nd}
\title{Weighted GRIP layout in arbitrary dimensions}
\usage{
weighted.grip.nd(
  edges = NULL,
  n = NULL,
  adj_list = NULL,
  weight_list = NULL,
  edge_weights = NULL,
  dim = 3,
  preset = NULL,
  placement = c("barycenter", "circle"),
  rounds = 160,
  final_rounds = 256,
  num_init = NULL,
  num_nbrs = 24,
  r = 0.03,
  s = 6,
  repulsion_factor = 1.5,
  tinit_factor = 2,
  final_move_scale_after_first = 1,
  final_mode = c("fr", "kk_repulse"),
  metric_neighbor_cap = NULL,
  insertion_anchor_count = 3,
  insertion_anchor_scope = c("any_higher", "prev_misf"),
  insertion_anchor_strategy = c("first", "distance_band", "balanced_band", "spread_prev"),
  level0_insertion_mode = c("inherit", "barycenter", "least_squares"),
  level0_anchor_count = insertion_anchor_count,
  level0_local_kk_steps = 3,
  length_normalization = c("median", "mean", "none"),
  disconnected = c("components", "error"),
  seed = 6
)
}
\arguments{
\item{edges}{Two-column integer matrix of edges (1-based vertex ids).}

\item{n}{Number of vertices.}

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

\item{weight_list}{Parallel list of strictly positive edge lengths.}

\item{edge_weights}{Optional vector of edge lengths for \code{edges}.}

\item{dim}{Embedding dimension. Must be at least 2.}

\item{preset}{Optional weighted layout preset: \code{"carpet"},
\code{"mesh"}, \code{"cylinder"}, \code{"torus"}, \code{"sphere"},
\code{"irregular"}, or \code{"tree"}.}

\item{placement}{Initial insertion placement strategy. \code{"circle"} is
only available for \code{dim = 2}; higher dimensions use
\code{"barycenter"}.}

\item{rounds}{Number of weighted refinement rounds before the final phase.}

\item{final_rounds}{Number of final weighted refinement rounds.}

\item{num_init}{Coarsest-level size control. Defaults to at least
\code{dim + 1}.}

\item{num_nbrs}{Local-neighborhood control used by the ND backend.}

\item{r}{Movement-rate parameter in \code{[0, 1]}.}

\item{s}{Repulsion scale parameter.}

\item{repulsion_factor}{Non-edge repulsion multiplier.}

\item{tinit_factor}{Initial spread multiplier.}

\item{final_move_scale_after_first}{Final-stage FR displacement multiplier
applied after the first final round. Must be in \code{[0, 1]}.}

\item{final_mode}{Final refinement mode: \code{"fr"} or
\code{"kk_repulse"}.}

\item{metric_neighbor_cap}{Optional cap on the number of settled Dijkstra
vertices used when building weighted neighborhood caches for inserted
vertices. \code{NULL} keeps the exact weighted neighborhood search.}

\item{insertion_anchor_count}{Number of already placed anchor vertices used
when inserting non-final MISF levels.}

\item{insertion_anchor_scope}{Anchor eligibility rule:
\code{"any_higher"} or \code{"prev_misf"}.}

\item{insertion_anchor_strategy}{Anchor selection rule:
\code{"first"}, \code{"distance_band"}, \code{"balanced_band"}, or
\code{"spread_prev"}.}

\item{level0_insertion_mode}{Level-0 insertion placement override:
\code{"inherit"}, \code{"barycenter"}, or \code{"least_squares"}.}

\item{level0_anchor_count}{Number of anchors used during level-0 insertion.}

\item{level0_local_kk_steps}{Number of local weighted-KK polish steps used
immediately after level-0 insertion.}

\item{length_normalization}{Global edge-length normalization:
\code{"median"} (default), \code{"mean"}, or \code{"none"}.}

\item{disconnected}{How to handle disconnected graphs:
\code{"components"} lays out each component separately and packs them;
\code{"error"} rejects disconnected graphs.}

\item{seed}{Optional RNG seed for reproducibility. If NULL, uses current time.}
}
\value{
Numeric matrix with one row per vertex and \code{dim} columns.
}
\description{
\code{weighted.grip.nd()} is an opt-in weighted GRIP layout backend
for embeddings in dimensions \code{dim >= 2}. It is implemented beside the
legacy 2D/3D GRIP code path so that existing weighted-GRIP entry points and
their dimensionality checks are unchanged.
}
