prepare.geodesic.kk() builds the deterministic all-pairs shortest
path cache needed to evaluate or optimize the full geodesic Kamada--Kawai
objective repeatedly on the same connected graph.
prepare.geodesic.kk(
edges = NULL,
n = NULL,
adj_list = NULL,
weight_list = NULL,
edge_weights = NULL,
tie_mode = c("single", "average")
)A list with the all-pairs graph distances, chosen paths, and cached
path-edge realizations. The object has class "grip_gkk_prepared".
Two-column integer matrix of edges (1-based vertex ids).
Number of vertices. If omitted with adj_list, defaults to
length(adj_list). If omitted with edges, defaults to
max(edges).
Adjacency list (1-based) for an undirected graph.
Optional parallel list of positive edge weights.
Optional positive edge-weight vector parallel to
edges.
Shortest-path aggregation mode. "single" uses one
deterministic chosen shortest path per pair. "average" replaces
each tied shortest-path family by the exact uniform average over all
shortest paths between the pair.
For each unordered vertex pair, the prepared object stores either one
deterministic chosen graph shortest path (tie_mode = "single") or the
exact uniform average over all tied shortest paths
(tie_mode = "average"), together with the graph distance and the
corresponding cached edge realization. This is the full all-pairs analogue of
the sparse landmark cache used by
prepare.landmark.geodesic.kk().