Replies: 3 comments 1 reply
-
@glyn thanks for the feedback! That's a very good call. When I implemented that part I was bothered by this behavior (https://docs.rs/indexmap/1.7.0/src/indexmap/map/core.rs.html#577). At some point, I thought about returning a mapping of the mutated indexes. This is definitely not optimal - as you've rightfully highlighted it - since it's just shifting the problem. I'm wondering if the exposed invariants should be kept as simple indices or perhaps as UUIDs. |
Beta Was this translation helpful? Give feedback.
-
@glyn for the record, I've created a PR (#17) which ended up being a huge refactoring. This will tackle the current index stability issue. |
Beta Was this translation helpful? Give feedback.
-
A new version has been released https://crates.io/crates/hypergraph/1.0.0. |
Beta Was this translation helpful? Give feedback.
-
@yamafaktory Did you consider managing your own indices internally and mapping these to indices in the IndexMap? Then the indices exposed to users could be kept invariant across
remove_vertex
. Also, in terms of usability, having hypergraph allocate indices might be more usable than requiring the user to keep track of which indices are in use.Beta Was this translation helpful? Give feedback.
All reactions