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
Currently we have so that edgeA == edgeB returns false.
Shouldn't the==(_:_:) operator take into consideration whether they're directed? Or am I missing something?
So in this particular scenario I would expect edgeA == edgeB to return true, as they are not directed.
If there are any worries about how changing the ==(_:_:) implementation would affect other features, should we have a separate method to compare two edges?
Any thoughts on this?
The text was updated successfully, but these errors were encountered:
It's a fair question. I don't know if this would break anyone's existing code. Is it causing a particular problem for you? Since I wouldn't really call it a bug, but more of a vagary we would make the change in a new point release not a bug fix release. i.e. 3.2 not 3.1.1
If the edges were not directed, we would then have to check if they were between the same two vertices, which would have a very slight performance cost if an algorithm was doing a ton of equality checks.
One could also argue, that maybe the data matters more than the graph theory in some circumstances. For example, imagine a program that was marking which vertex the edge was created from and to even though it allowed traversal in both directions.
Let's say I have two weighted and not directed edges, connecting the same vertices, as follows:
Currently we have so that
edgeA == edgeB
returnsfalse
.Shouldn't the
==(_:_:)
operator take into consideration whether they're directed? Or am I missing something?So in this particular scenario I would expect
edgeA == edgeB
to returntrue
, as they are not directed.In summary we would have:
If there are any worries about how changing the
==(_:_:)
implementation would affect other features, should we have a separate method to compare two edges?Any thoughts on this?
The text was updated successfully, but these errors were encountered: