Package: bigKNN 0.3.0

bigKNN: Exact Search and Graph Construction for 'bigmemory' Matrices

Exact nearest-neighbour and radius-search routines that operate directly on 'bigmemory::big.matrix' objects. The package streams row blocks through 'BLAS' kernels, supports self-search and external-query search, exposes prepared references for repeated queries, and can build exact k-nearest-neighbour, radius, mutual k-nearest-neighbour, and shared-nearest-neighbour graphs. Version 0.3.0 adds execution plans, serializable prepared caches, resumable streamed graph jobs, coercion helpers, exact candidate reranking, and recall summaries for evaluating approximate neighbours.

Authors:Frederic Bertrand [aut, cre]

bigKNN_0.3.0.tar.gz
bigKNN_0.3.0.zip(r-4.7)bigKNN_0.3.0.zip(r-4.6)bigKNN_0.3.0.zip(r-4.5)
bigKNN_0.3.0.tgz(r-4.6-x86_64)bigKNN_0.3.0.tgz(r-4.6-arm64)bigKNN_0.3.0.tgz(r-4.5-x86_64)bigKNN_0.3.0.tgz(r-4.5-arm64)
bigKNN_0.3.0.tar.gz(r-4.6-arm64)bigKNN_0.3.0.tar.gz(r-4.7-arm64)bigKNN_0.3.0.tar.gz(r-4.7-x86_64)bigKNN_0.3.0.tar.gz(r-4.6-x86_64)
bigKNN_0.3.0.tgz(r-4.6-emscripten)
manual.pdf |manual.html
DESCRIPTION |NEWS
card.svg |card.png
bigKNN/json (API)

# Install 'bigKNN' in R:
install.packages('bigKNN', repos = c('https://fbertran.r-universe.dev', 'https://cloud.r-project.org'))

Bug tracker:https://github.com/fbertran/bigknn/issues

Pkgdown/docs site:https://fbertran.github.io

Uses libs:
  • openblas– Optimized BLAS
  • c++– GNU Standard C++ Library v3

On CRAN:

Conda:

openblascpp

4.76 score 1 stars 19 scripts 478 downloads 23 exports 7 dependencies

Last updated from:fc76b39aa5. Checks:12 OK. Indexed: yes.

TargetResultTimeFilesSyslog
linux-devel-arm64OK160
linux-devel-x86_64OK143
source / vignettesOK180
linux-release-x86_64OK137
macos-release-arm64OK142
macos-release-x86_64OK295
macos-oldrel-arm64OK160
macos-oldrel-x86_64OK359
windows-develOK145
windows-releaseOK179
windows-oldrelOK133
wasm-releaseOK118

Exports:as_edge_listas_sparse_matrixas_tripletcount_within_radius_bigmatrixknn_bigmatrixknn_graph_bigmatrixknn_graph_stream_bigmatrixknn_load_preparedknn_plan_bigmatrixknn_prepare_bigmatrixknn_search_preparedknn_search_stream_preparedknn_stream_bigmatrixknn_validate_preparedmutual_knn_graph_bigmatrixradius_bigmatrixradius_graph_bigmatrixradius_stream_bigmatrixradius_stream_job_bigmatrixrecall_against_exactrerank_candidates_bigmatrixresume_knn_jobsnn_graph_bigmatrix

Dependencies:BHbigmemorybigmemory.srilatticeMatrixRcppuuid

Exact Graph Construction from big.matrix Data
Build a Small Reference Set | Directed k-NN graphs with knn_graph_bigmatrix() | Mutual k-NN graphs with mutual_knn_graph_bigmatrix() | Shared-nearest-neighbour graphs with snn_graph_bigmatrix() | Radius graphs with radius_graph_bigmatrix() | Symmetrization options and edge semantics | Converting outputs with as_edge_list(), as_triplet(), and as_sparse_matrix() | Using graph outputs downstream

Last update: 2026-03-26
Started: 2026-03-26

Execution Plans and Streaming Workflows
Why plans and streaming matter for large matrices | Build a Repeatable Example | Building a plan with knn_plan_bigmatrix() | How memory budget maps to block size | Running planned in-memory search | Streaming k-NN output with knn_stream_bigmatrix() | Streaming radius output with radius_stream_bigmatrix() | Dense versus sparse query inputs | Practical guidance for choosing output modes

Last update: 2026-03-26
Started: 2026-03-26

Prepared References for Repeated Exact Search
When prepared references help | Build a File-Backed Reference | Building a prepared reference with knn_prepare_bigmatrix() | Reusing it with knn_search_prepared() | Streaming prepared results with knn_search_stream_prepared() | Persisting caches with cache_path | Reloading with knn_load_prepared() | Validating with knn_validate_prepared() | Common failure modes and how to avoid them

Last update: 2026-03-26
Started: 2026-03-26

Quick Start with bigKNN
Create a Small Reference Matrix | First Exact k-Nearest-Neighbour Search | Searching New Query Points | First Radius Search | Choosing a Metric | Where to Go Next

Last update: 2026-03-26
Started: 2026-03-26

Resumable Streaming Jobs
When resumable jobs are worth using | Build a Durable Working Directory | Checkpointed graph streaming with knn_graph_stream_bigmatrix() | Checkpointed radius streaming with radius_stream_job_bigmatrix() | Restarting work with resume_knn_job() | Graph Job Resume | Radius Job Resume | Destination matrix sizing and storage types | What checkpoint files contain | Failure recovery and restart patterns | Operational tips for long-running jobs

Last update: 2026-03-26
Started: 2026-03-26

Using bigKNN as Exact Ground Truth
Why exact ground truth matters | Build a Small Exact Evaluation Set | Producing exact neighbours with bigKNN | Measuring recall with recall_against_exact() | Reranking candidate sets with rerank_candidates_bigmatrix() | Comparing approximate candidates against exact results | Suggested workflow alongside a separate ANN package | Interpreting recall and reranking results | Limits and caveats

Last update: 2026-03-26
Started: 2026-03-26

Readme and manuals

Help Manual

Help pageTopics
Coerce bigKNN outputs to edge-list formas_edge_list
Coerce bigKNN outputs to a sparse matrixas_sparse_matrix
Coerce bigKNN outputs to sparse-triplet formas_triplet
Count neighbours within a fixed radiuscount_within_radius_bigmatrix
Exact k-nearest neighbours for 'bigmemory::big.matrix'knn_bigmatrix
Build an exact kNN graph from a 'bigmemory::big.matrix'knn_graph_bigmatrix
Stream a directed exact kNN graph into destination 'big.matrix' objectsknn_graph_stream_bigmatrix
Load a serialized prepared referenceknn_load_prepared
Build an execution plan for exact searchknn_plan_bigmatrix
Prepare a 'bigmemory::big.matrix' reference for repeated exact searchknn_prepare_bigmatrix
Search a prepared exact referenceknn_search_prepared
Stream prepared exact search results into destination 'big.matrix' objectsknn_search_stream_prepared
Stream exact k-nearest neighbours into destination 'big.matrix' objectsknn_stream_bigmatrix
Validate a prepared referenceknn_validate_prepared
Build an exact mutual kNN graph from a 'bigmemory::big.matrix'mutual_knn_graph_bigmatrix
Exact radius search for 'bigmemory::big.matrix'radius_bigmatrix
Build an exact radius graph from a 'bigmemory::big.matrix'radius_graph_bigmatrix
Stream exact radius-search results into destination 'big.matrix' objectsradius_stream_bigmatrix
Stream exact radius-search results into destination 'big.matrix' objects with checkpointsradius_stream_job_bigmatrix
Compare approximate neighbours to exact truthrecall_against_exact
Rerank candidate neighbours exactly against a 'bigmemory::big.matrix'rerank_candidates_bigmatrix
Resume a checkpointed bigKNN jobresume_knn_job
Build an exact shared-nearest-neighbour graph from a 'bigmemory::big.matrix'snn_graph_bigmatrix