Graphs.jl icon indicating copy to clipboard operation
Graphs.jl copied to clipboard

Implicit graph structure

Open gdalle opened this issue 4 years ago • 2 comments

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?

gdalle avatar Feb 25 '22 17:02 gdalle

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).

etiennedeg avatar Feb 25 '22 22:02 etiennedeg

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

simonschoelly avatar May 15 '22 18:05 simonschoelly