You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I think it's worth considering having one Graph type that can optionally include weights and metadata for an undirected graph, rather than having separate WeightedGraph and MetaGraph types. The Graph constructor could have various optional type parameters, so you could create empty graphs like this:
# Create a graph with `Any` vertex type, Float64 edge weights,# and no metadata.Graph()
# Char graph with Float64 edge weights:Graph{Char}()
# Char graph with Int weights:Graph{Char, Int}()
# Char graph with Float64 edge weights and# vertex data of type MyVertexData:Graph{Char, Float64, MyVertexData}()
# Char graph with Float64 edge weights,# vertex data of type MyVertexData,# and edge data of type MyEdgeData:Graph{Char, Float64, MyVertexData, MyEdgeData}()
# Char graph with Float64 edge weights,# no vertex data, and edge data of type MyEdgeData:Graph{Char, Float64, Nothing, MyEdgeData}()
Nothing would be an option for the metadata type parameters, but not for the vertex type and weight type. (Default weight type would probably be Float64.)
The text was updated successfully, but these errors were encountered:
I like the idea, and from a user perspective it would be closer to the nice NetworkX experience. The only doubt I have is the overhead incurred by carrying empty vertex or edge metadata, but it's probably minor
I think it's worth considering having one
Graph
type that can optionally include weights and metadata for an undirected graph, rather than having separateWeightedGraph
andMetaGraph
types. TheGraph
constructor could have various optional type parameters, so you could create empty graphs like this:Nothing
would be an option for the metadata type parameters, but not for the vertex type and weight type. (Default weight type would probably beFloat64
.)The text was updated successfully, but these errors were encountered: