A Comprehensive Survey and Experimental Comparison of Graph-based Approximate Nearest Neighbor Search
const unsigned num_threads = parameters.get<unsigned>("n_threads");
std::string base_path = parameters.get<std::string>("base_path");
std::string query_path = parameters.get<std::string>("query_path");
std::string ground_path = parameters.get<std::string>("ground_path");
std::string graph_file = parameters.get<std::string>("graph_file");
auto *builder = new weavess::IndexBuilder(num_threads);
builder -> load(&base_path[0], &query_path[0], &ground_path[0], parameters)
-> init(weavess::TYPE::INIT_RANDOM, false)
-> refine(weavess::TYPE::REFINE_NN_DESCENT, false)
-> save_graph(weavess::TYPE::INDEX_KGRAPH, &graph_file[0]);ComponentLoad: load input raw data for index build and algorithm parameters.ComponentInit: initialization components for index construction.ComponentPreEntry: seed acquisition of the index construction.ComponentRefine: include candidate、prune、conn components.ComponentCandidate: candidate neighbor acquisition.ComponentPrune: neighbor selection.ComponentConn: connectivity assurance.
builder -> load()
-> init(INIT_COMPONENT_TYPE)
-> pre_entry(PRE_ENTRY__COMPONENT_TYPE)
-> refine(REFINE_COMPONENT_TYPE)
-> save_graph(SAVE_COMPONENT_TYPE);
const unsigned num_threads = parameters.get<unsigned>("n_threads");
std::string base_path = parameters.get<std::string>("base_path");
std::string query_path = parameters.get<std::string>("query_path");
std::string ground_path = parameters.get<std::string>("ground_path");
std::string graph_file = parameters.get<std::string>("graph_file");
auto *builder = new weavess::IndexBuilder(num_threads);
builder -> load_graph(weavess::TYPE::INDEX_KGRAPH, &graph_file[0])
-> search(weavess::TYPE::SEARCH_ENTRY_RAND, weavess::TYPE::ROUTER_GREEDY, weavess::TYPE::L_SEARCH_ASSIGN);ComponentSearchEntry: seed acquisition of the index search.ComponentSearchRoute: route strategies.
builder -> load()
-> load_graph(LOAD_COMPONENT_TYPE)
-> search(SEARCH_ENTRY_COMPONENT_TYPE, SEARCH_ROUTE_COMPONENT_TYPE);