Open gdalle opened 2 years ago
I think the API allows neighbors to be returned as an iterator and it should be enforced in the codebase (see for example this PR). The fact that the documentation says that neighbors
returns a list is an inaccuracy of the documentation. I may be wrong though (cc @simonschoelly).
That thing with the list
might have been inspired by networkx. I would agree, that one should be able to generate the neighbors implicitly. I would even say, that the current implementation for Simple{Di}Graph
is dangerous, as one could accidentally modify the graph this way.
Another example of implict neighbors is https://github.com/JuliaGraphs/SpecialGraphs.jl
Apparently, the old Graphs.jl package made it possible to define a graph implicitly, where neighbors of a vertex are generated just-in-time instead of being stored statically (source: https://github.com/Shushman/MultiAgentPathFinding.jl). I see no reason why the current interface would not allow this, is there?