% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/animate.R
\name{lap_animate}
\alias{lap_animate}
\title{Animate an assignment algorithm step-by-step}
\usage{
lap_animate(
  cost,
  method = "hungarian",
  maximize = FALSE,
  width = NULL,
  height = NULL,
  elementId = NULL,
  ...
)
}
\arguments{
\item{cost}{Numeric cost matrix. Rows = workers/sources, columns = jobs/targets.
\code{NA} or \code{Inf} entries mark forbidden assignments.}

\item{method}{Character; the algorithm to animate. Must match one of the
methods registered for animation (see \code{animated_methods()} for the
current list). Method names are the same strings used by \code{\link[=assignment]{assignment()}},
e.g. \code{"hungarian"}, \code{"jv"}, \code{"auction"}, \code{"gabow_tarjan"}.}

\item{maximize}{Logical; if \code{TRUE}, animate the maximization variant.}

\item{width, height}{Optional explicit widget dimensions (pixels or CSS units).}

\item{elementId}{Optional DOM id for the widget container.}

\item{...}{Algorithm-specific extra arguments forwarded to the trace
function (e.g. \code{auction_eps}).}
}
\value{
An \code{htmlwidget} object.
}
\description{
Produce an interactive bipartite-graph animation showing how a chosen
linear-assignment algorithm transforms the matching over time. The result
is an htmlwidget suitable for use in R Markdown, Quarto, pkgdown vignettes,
Shiny apps, or standalone HTML output.
}
\details{
This is a \emph{teaching} interface. It runs a slower R reference implementation
that emits a state trace at every step, then plays it back in the browser.
For production solving, use \code{\link[=assignment]{assignment()}} or \code{\link[=lap_solve]{lap_solve()}} which call the
fast C++ backends.
}
\section{Animated methods}{

Animation support is added incrementally. Call \code{animated_methods()} to see
which method strings currently have a registered trace.
}

\examples{
\dontrun{
cost <- matrix(c(4, 2, 5,
                 3, 3, 6,
                 7, 5, 4), nrow = 3, byrow = TRUE)
lap_animate(cost, method = "hungarian")
}

}
\seealso{
\code{\link[=assignment]{assignment()}} for production solving, \code{\link[=lap_solve]{lap_solve()}} for the tidy
interface.
}
