break
for j in range(i + 1, leaf_array.shape[1]):
q = leaf_array[n, j]
if q < 0:
break
if (p, q) in tried:
continue
d = dist(data[p], data[q], *dist_args)
heap_push(current_graph, p, d, q, 1)
tried.add((p, q))
if p != q:
heap_push(current_graph, q, d, p, 1)
tried.add((q, p))
After Change
if np.isfinite(d):
p = leaf_array[n, i]
q = leaf_array[n, j]
heap_push(current_graph, p, d, q, 1)
heap_push(current_graph, q, d, p, 1)
// for i in range(leaf_array.shape[1]):
// p = leaf_array[n, i]