Classical-MDS baseline layout for GMDS experiments
Source:R/export_examples.R, R/gmds_layout_interface.R
classical.mds.Rdclassical.mds() computes the classical-MDS baseline using
stats::cmdscale() on the graph shortest-path distance matrix and returns a
common "grip_gmds_layout" result.
Usage
classical.mds(
prepared = NULL,
edges = NULL,
n = NULL,
adj.list = NULL,
weight.list = NULL,
edge.weights = NULL,
dim = 2L,
add = FALSE,
eig = TRUE,
diagnostics = TRUE,
scale.mode = c("profiled", "identity", "user"),
distance.floor = 1e-08,
edge.length.epsilon = 1e-08,
band.quantiles = c(1/3, 2/3)
)Arguments
- prepared
Optional all-pairs prepared object returned by
prepare.graph.geodesic.mds()orprepare.geodesic.kk(). Edge-only objects fromprepare.edge.kk()are intentionally rejected because classical MDS requires a graph distance matrix.- edges
Two-column integer edge matrix used when
preparedis omitted. Supply either edges/edge.weights or adj.list/weight.list, not both. Raw graph inputs cannot be combined with a prepared object.- n
Finite positive integer vertex count. When supplied with a prepared object, it must match the stored graph size.
- adj.list
Optional adjacency list used when
preparedis omitted.- weight.list
Optional edge-weight list parallel to
adj.list.- edge.weights
Optional positive edge weights parallel to
edges.- dim
Target embedding dimension. Values greater than 3 are supported for GMDS and edge-KK workflows.
- add, eig
Passed to
stats::cmdscale().- diagnostics
If
TRUE, attach the common GMDS diagnostic panel. IfFALSEand raw graph inputs are supplied,classical.mds()uses a distance-matrix-only preparation path and does not build the full all-pairs path cache.- scale.mode
Scale policy for edge, path, and chord targets:
"profiled"fits one scalar for each diagnostic family,"identity"uses scale one, and"user"uses the corresponding supplied scale.- distance.floor
Positive floor for relative residuals.
- edge.length.epsilon
Small stabilizer for fixed-path embedded lengths.
- band.quantiles
Two quantiles splitting graph distances into short, mid, and long bands.
Workflow guides
Start with vignette("function-guide", package = "grip")
to choose a layout, diagnostic, or reference comparison. List installed
guides with vignette(package = "grip").
Examples
cycle_edges <- edges.cycle(6)
prepared <- prepare.graph.geodesic.mds(cycle_edges, n = 6)
fit <- classical.mds(prepared = prepared, dim = 2)