JuliaGraphs / GraphsBase.jl

Basic interface and structures for the JuliaGraphs ecosystem
http://juliagraphs.org/GraphsBase.jl/
MIT License
11 stars 1 forks source link

Default structs to define #3

Open gdalle opened 1 year ago

gdalle commented 1 year ago

In addition to the interface, this package should probably contain basic implementations for the most common types of graphs.

Here's a possible list:

Name Vertices Metadata
(Simple)(Di)Graph 1:n none
(Simple)Weighted(Di)Graph 1:n edge weights
(Simple)Meta(Di)Graph 1:n vertex and edge
(Simple)VertexSafe(Di)Graph non-contiguous integers none

For each one, we will provide both the simple version (no multi-edges, possible self-loops) and the generic version.

filchristou commented 1 year ago

I would really suggest to try our best to make MetaGraphs.jl obselete. So this would mean that the implementation of a MetaGraph should be type-stable for performance but also fallback to a generic struct using Any types for flexibility.

gdalle commented 1 year ago

I'm not sure yet how it will look like, but I don't think a fallback is a great idea. I think if users want metadata of type Any, they have to say it explicitly. Strictly typed metadata is also a safeguard against bad code