Each cover contains its source vertex plus its k nearest other vertices.
Equal distances are resolved by ascending vertex index. Intersecting covers
create edges whose lengths are shortest-path distances in the input graph.
Usage
create.geodesic.iknn.graph(graph, k, small.component = c("error", "truncate"))Arguments
- graph
A
dgraphwith stored finite, nonnegative lengths.- k
Number of nearest other vertices; integer
1 <= k < n.- small.component
Default
"error"requires at leastk + 1vertices in every component."truncate"uses all reachable other vertices in smaller components, recording per-vertexeffective.kin neighborhood metadata.
Value
A dgraph with a final stage, lengths and an overlap edge attribute.
metadata$neighborhood records requested and effective sizes and the tie rule.
Examples
graph <- create.graph("chain", 3)
create.geodesic.iknn.graph(graph, k = 1)
#> Undirected graph: 3 vertices, 3 edges
#> Stored stages: final