Skip to content

graph: avoid issues around graph node retrieval subtleties

Sebastien Binet requested to merge graph/node-mutation into master

Created by: kortschak

With the approach to graph node mutation on edge setting the previously existed there was an issue that the edge last used connect a pair of nodes could result in a difference in the nodes being returned by a node query compared to the same node associated with edges returned from an edge query.

This change avoids dealing with that by making it implementation dependent and stating this, and by making all the node-storing graphs we provide mutate the nodes when edges are set.

There are a number of ways to deal with the situation of maintaining consistency between edges and nodes, so I think being open to that is the best approach, and while using int64 for edges did seem plausible, it became difficult very quickly.

Please take a look.

Closes #31. Fixes gonum/graph#87. Updates #570.

Merge request reports