nmslib / hnswlib

Header-only C++/python library for fast approximate nearest neighbors
https://github.com/nmslib/hnswlib
Apache License 2.0
4.11k stars 607 forks source link

Update bindings.cpp #536

Open IbraheemTaha opened 4 months ago

IbraheemTaha commented 4 months ago

Add a python function get_max_layer which returns the maxlevel_ of the index.

IbraheemTaha commented 4 months ago

I added a python function get_node_degree binding to the C++ function getNodeDegree which returns the count of neighbors of a node given its label.

IbraheemTaha commented 4 months ago

I added the Python function get_average_degree_at_layer and the corresponding C++ function getAverageDegreeAtLayer0 which returns the average node degree of a given layer (level).

These functions is to get more insights and internal information about the structure of the index.