View source: R/graph_endpoint_geometry.R
| compute.graph.endpoint.scores | R Documentation |
Computes endpointness diagnostics for graph vertices by selecting graph-geodesic neighborhoods and evaluating how concentrated the corresponding 3D embedding directions are. This targets terminal arm tips in an embedding rather than graph-theoretic degree-1 vertices.
For each vertex x, let u_1, \dots, u_m be unit vectors in the
embedding from x to graph-geodesic neighbors of x. The function
computes:
s_{\min}(x) = \min_{i < j} u_i^\top u_j
s_q(x) = \mathrm{quantile}\{u_i^\top u_j : i < j\}
m(x) = \left\| \frac{1}{\sum_i w_i} \sum_i w_i u_i \right\|
\mathrm{score}(x) = m(x)\, \frac{1 + s_q(x)}{2}
Neighborhoods are selected in graph-geodesic space while directions are taken from the supplied 3D embedding.
compute.graph.endpoint.scores(
adj.list,
weight.list,
layout.3d,
neighborhood = c("geodesic_k", "geodesic_radius"),
k = c(10L, 20L, 30L),
radius = NULL,
q = 0.1,
neighbor.weighting = c("uniform", "inverse_distance", "gaussian"),
gaussian.sigma = NULL,
min.neighborhood.size = 3L,
scale.aggregate = c("mean", "median", "min", "max"),
verbose = FALSE
)
adj.list |
Graph adjacency list (1-based vertex indices). |
weight.list |
Edge-length list aligned with |
layout.3d |
Numeric matrix or data frame with 3 columns giving the 3D embedding coordinates for graph vertices. |
neighborhood |
Character string. Either |
k |
Integer vector of geodesic neighborhood sizes used when
|
radius |
Positive numeric vector of geodesic radii used when
|
q |
Quantile used for |
neighbor.weighting |
Character string controlling neighbor weights for
|
gaussian.sigma |
Optional positive numeric scale used when
|
min.neighborhood.size |
Minimum number of usable neighbors required after
removing zero-length embedding vectors. Must be at least |
scale.aggregate |
How to aggregate scores across multiple neighborhood
scales. One of |
verbose |
Logical; if |
A list with aggregated per-vertex scores, per-scale score matrices, and neighborhood diagnostics.
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.