% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/grip_layout.R
\name{trace.legacy.grip}
\alias{trace.legacy.grip}
\title{Compute a trace for the legacy GRIP layout}
\usage{
trace.legacy.grip(
  edges = NULL,
  n = NULL,
  adj_list = NULL,
  weight_list = NULL,
  edge_weights = NULL,
  dim = 3,
  placement = c("barycenter", "circle"),
  preset = NULL,
  rounds = 20,
  final_rounds = 25,
  num_init = 36,
  num_nbrs = 10,
  r = 0.15,
  s = 3,
  repulsion_factor = 1,
  tinit_factor = 6,
  seed = 6,
  trace = c("round", "level"),
  trace.every = 1
)
}
\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 undirected graphs.}

\item{weight_list}{Optional parallel list of edge weights (edge lengths).
If NULL, all edges are treated as weight 1. All weights must be finite
and strictly positive.}

\item{edge_weights}{Optional vector of edge weights for \code{edges}. All
weights must be finite and strictly positive.}

\item{dim}{Layout dimension (2 or 3). Default is 3.}

\item{placement}{Initial placement strategy. "circle" is only used for 2D.}

\item{preset}{Optional tuning preset. \code{NULL} uses the historical
defaults. \code{"carpet"} applies a preset tuned for
Sierpinski-carpet-like graphs and validated on carpet levels 3 and 4.
\code{"mesh"} applies a preset tuned for rectangular lattice graphs and
validated on 8x8 and 12x12 mesh layouts. \code{"torus"} applies a preset
tuned for 3D torus layouts and validated on torus sizes from 8x8 through
20x20. \code{"tree"} applies a preset tuned for symmetric force-directed
layouts of tree-like graphs and validated on binary trees of depths 5 and
6. Presets only fill in tuning arguments that you did not supply
explicitly.}

\item{rounds}{Initial rounds for refinement.}

\item{final_rounds}{Final rounds for refinement.}

\item{num_init}{Number of initial vertices in the coarsest level.}

\item{num_nbrs}{Maximum number of graph-distance neighbors retained for local
refinement at each filtration level.}

\item{r}{Main local temperature adaptation rate in \code{[0, 1]}.}

\item{s}{Non-negative boost factor applied when successive displacements have
a consistent direction.}

\item{repulsion_factor}{Non-negative multiplier applied to GRIP's
finest-level repulsive force scale. \code{1} keeps the historical
repulsion strength; \code{0} disables that repulsive term.}

\item{tinit_factor}{Initial temperature factor.}

\item{seed}{Optional RNG seed for reproducibility. If NULL, uses current time.}

\item{trace}{Snapshot granularity. \code{"round"} records the coarsest
initialization, each level start, every \code{trace.every} completed rounds,
and the final layout. \code{"level"} records the coarsest initialization,
every \code{trace.every}th level start, and the final layout.}

\item{trace.every}{Positive integer thinning factor for recorded rounds or
levels. Initial and final snapshots are always included.}
}
\value{
A list with \code{final}, \code{frames}, \code{meta}, \code{trace},
  and \code{trace.every}. \code{final} is the final coordinate matrix.
  \code{frames} is a list of coordinate matrices with \code{NA} rows for
  vertices that have not yet been introduced by GRIP. \code{meta} is a data
  frame describing each frame with columns \code{frame}, \code{phase},
  \code{level_index}, \code{misf_level}, \code{round_in_level}, and
  \code{active_vertices}.
}
\description{
Compute a trace for the legacy GRIP layout
}
\examples{
edges <- cbind(1:5, 2:6)
tr <- trace.legacy.grip(edges, n = 6, dim = 2,
                               placement = "barycenter",
                               rounds = 3, final_rounds = 2,
                               num_init = 3, num_nbrs = 4,
                               trace = "level",
                               trace.every = 1,
                               seed = 1)
tr$meta
}
