JuliaGraphs / Graphs.jl

An optimized graphs package for the Julia programming language
http://juliagraphs.org/Graphs.jl/
Other
457 stars 90 forks source link

Implicit graph structure #109

Open gdalle opened 2 years ago

gdalle commented 2 years ago

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?

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

simonschoelly commented 2 years ago

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