Version 1 for adjacency matrix input. See below for tabular data input.
Error reports and general feedback welcome.
1 Like
βhereβs where itβs assumed to be undirectedβ
This fails to account for the fact D has closest neighbor A does not imply A has closest neighbor D (it does not, A has B as closest neighbor).
Thanks for looking! Actually, D-A is included in edgepairs as {A, D}. The weight for that edge is then found in edgepairweights. See also the final output. Iβve only tested on tiny examples though. Next up are some with 100βs of vertices, then on to the 1000βs.
Iβm curious though if weighted graphs are supported by NearestNeighborGraph[] ?
Version 2, for tabular data.