dominikbraun / graph

A library for creating generic graph data structures and modifying, analyzing, and visualizing them.
https://graph.dominikbraun.io
Apache License 2.0
1.77k stars 95 forks source link

normalize edges to use Edge[K] rather than both Edge[K] and Edge[T], … #147

Open jonbrandenburg opened 1 year ago

jonbrandenburg commented 1 year ago

…also addressed storing duplicate edge properties within the memory store which addresses issue #110.

Currently the codebase seems to be a bit fragmented, in that there are many instances where edges are defined using Edge[K] and others using Edge[T]. While this isn't necessarily a big deal when K and T are the same type, it can become an issue when they're not. I opted to go with Edge[K] instead of Edge[T], because I figured it would be easier to guarantee the references / pointers were correct using the keys/hashes than with the vertices directly when passing them from the store to the graph. That said, if you think Edge[T] is the better choice I'd be interested to hear your ideas on how to handle that.

It should be noted, if it isn't already obvious that this will likely be a breaking change for some users of the library.