d3graphTheory icon indicating copy to clipboard operation
d3graphTheory copied to clipboard

[Chapter: Vertices and Edges] Improve vertex ID logic to reuse highest-numbered ID

Open moody-jazz opened this issue 4 months ago • 0 comments

Currently, when a vertex is removed, the next added vertex always receives a new incremented ID, even if the highest-numbered vertex was deleted.

For example:

  • Add v1 to v5 → delete v5 → add a new vertex → it becomes v6 (instead of reusing v5).

Suggestion: Update the logic so that if the highest-numbered vertex is removed, its ID is reused.

moody-jazz avatar Aug 13 '25 07:08 moody-jazz