Skip to main content

knn_graph_parallel

Function knn_graph_parallel 

Source
pub fn knn_graph_parallel(
    cloud: &PointCloud,
    k: usize,
) -> Result<NeighborGraph, SpatialError>
Expand description

Builds a k-NN graph using bounded scoped CPU workers (parallel feature).

Returns exactly the same edge sequence as knn_graph, including KD-tree tie selection. One shared tree is built on the caller; contiguous 256-point query chunks use at most the available CPU parallelism. Fewer than 4,096 points or one available worker run on the caller. Worker-local edge storage and the final graph scale with edge count; dispatch metadata scales with workers. Concurrent calls have independent worker budgets.