Applies multiple harmonic extension methods to a subgraph around an extremum and compares their results using various metrics.
Arguments
- subgraph
A subgraph object created by
extract.extrema.subgraphs- methods
Character vector of method names to test (default: all available methods)
- max_iterations
Maximum number of iterations for iterative methods (default: 100)
- tolerance
Convergence tolerance (default: 1e-6)
- sigma
Parameter for weighted mean method (default: 1.0)
- plot_results
Logical whether to visualize the results (default: TRUE)
- plot_type
Character string specifying visualization type if
plot_results = TRUE: "2d" or "3d" (default: "3d")
Value
A list containing:
- results
Named list of results from each method
- metrics
Data frame with comparison metrics for each method:
method: Method nameiterations: Number of iterations performedfinal_change: Final iteration changeconverged: Whether method convergedtotal_change: Sum of absolute changes from originalextremum_removal: Change at the extremum vertex
- subgraph
The input subgraph object
Examples
if (FALSE) { # \dontrun{
# Assumes subgraph was created by extract.extrema.subgraphs
comparison <- compare.harmonic.methods(
subgraph,
methods = c("harmonic_iterative", "harmonic_eigen")
)
} # }