knn_graph_to_conn_graph — REPRCONV structure op

• Data kinds: graph → conn_graph

• Call: import fullseye as fs; fs.ledger.knn_graph_to_conn_graph(graph, weight='inverse_distance', symmetric=True) (to call the implementation directly, import reprconv; reprconv.knn_graph_to_conn_graph(graph, weight='inverse_distance', symmetric=True); from the registry, opsreprconv.get("knn_graph_to_conn_graph"))

• GPU: none (CPU reference implementation only)

Usage

k-nearest-neighbour graph graph → a weighted adjacency matrix conn_graph (n, n). The exit from graph.

> The detailed description below is the original text — the summary and the headings are translated.

knn_graph の返り (idx (n,k) int, dist (n,k) float) を、conn_graph 族(graph_components / graph_laplacian_spectrum / graph_layout_spectral …)が受ける n×n の W[i, j] = i → j の重みにする。weight:

• "inverse_distance" —— 1 / dist(近いほど強い。距離 0 の重複点は拒否する)

• "distance" —— dist そのもの(経路長として使う側向け)

• "binary" —— 1

symmetric=True で W = max(W, Wᵀ)(k 近傍は片想いがあるので、無向グラフとして扱うなら対称化する)。対角は 0(knn_graph は自分を除いている)。n は conngraph.MAX_NODES(4096)まで —— 密行列なので、それを超える点群は先に farthest_point_sampling などで間引く。

Args:

graph: (idx, dist) の 2-tuple(knn_graph の返り)。

weight: "inverse_distance" / "distance" / "binary"。

symmetric: True で対称化。

Returns:

(n, n) float64。

Raises:

ValueError: 2-tuple でない / 形が違う / 添字が範囲外 / 自己ループ / n が上限超え /

inverse_distance で距離 0 / weight が不正。

References (sample data, literature)

• Sample-data catalog (download URLs / licences) — 2-D uses skimage.data (BSD/public domain) plus synthetic images; 3-D lists download URLs for real data sources (Stanford, PDS, …).

• Operator provenance and references — the sources of the research/methods this op family came from.

• The canonical algorithm (author, year) and its uses are named in the family usage guide above.

Runnable examples (verified samples that actually call this op)

• poc_bga_ball_type_roundtrip — py -3.11 examples/poc_bga_ball_type_roundtrip.py

• type_connectivity_tour — py -3.11 examples/type_connectivity_tour.py

Ops the type connects to (they accept conn_graph as input)

—

Same category (structure)

frame_axis · pointmap_to_points · match_component


*Provenance: reprconv.py — REPRCONV operator registry. This per-op note is generated by tools/opdocs.py md (do not hand-edit).*

© 2026 Kazufumi Furuse — Fullseye operator documentation. Licensed under Apache-2.0.