Open mathieuLacroix opened 4 years ago
you shouldn't be repeating (s,d) pairs in any constructor. That's definitely good cause for undefined behavior.
Or indicate in the doc that repeated pairs should not be used with float weights?
Yes we should do that, add a warning for UBehavior in the docs
Hi,
Creating a simpleWeigthedGraph with repeated pairs may raise the error "Adjacency / distance matrices must be symmetric" due to numerical imprecision, even when using + as combine function.
For instance, the sparse matrix constructed when creating the weighted graph using the following data is not symmetric.
Hence,
g = SimpleWeightedGraph(sources, destinations, weights)
raises an error.Is it possible to find another way to construct the sparse matrix? Or indicate in the doc that repeated pairs should not be used with float weights?
Best,