Open
Description
Hi, so I'm trying to use the package for a graph with terms from Symbolics.jl as the weights. I'm pretty sure everything should work just fine except when I try to add a new edge via add_edge! which checks if the weight is zero and which does not work for these terms. For a MWE:
using Symbolics, SimpleWeightedGraphs, Graphs
g = SimpleWeightedDiGraph{Int,Num}(2)
add_edge!(g, 1, 2, 2.0) # works
@variables x
add_edge!(g, 1, 2, x) # does not work
This also seems like it could very well apply to other types, the problem here is the ==
operator does not do the same thing for Num. A simple fix may be to add this check in a try block and maybe print a warning that the check could not be done? Though such a warning should be toggleable to avoid excessive printing.
Metadata
Metadata
Assignees
Labels
No labels