Skip to content

Consider returning an empty list rather than null when searching an empty graph #6

@mikethea1

Description

@mikethea1

Minor usability request. I feel like empty graphs should be searchable as normal, just returning an empty result set. This is useful for applications where you are building up the graph as you go, e.g.

foreach (var item in items)
{
     if (has close neighbor in graph) {  continue; }
     else { add item to graph }
}

See https://github.com/curiosity-ai/hnsw-sharp/blob/master/Src/HNSW.Net/Graph.cs#L161

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions