Skip to content

Conversation

@devansh2605
Copy link

Issue - https://github.com/digraphs/Digraphs/issues/683

Previously, deleting vertices or edges from an EdgeWeightedDigraph or taking a mutable copy caused the resulting digraph to lose its edge weights. This commit is just a layout for which I'll add tests and debug.

Changes include:

  • Added CopyEdgeWeightsForSubdigraph helper function to reconstruct weights after vertex removals.
  • Updated DigraphRemoveVertex to copy edge weights.
  • Updated DigraphRemoveEdge to remove corresponding weight entries instead of dropping all weights.
  • Updated DigraphMutableCopy to copy edge weights when present.
  • Declared the new helper in digraph.gd.

@mtorpey
Copy link
Collaborator

mtorpey commented Oct 31, 2025

This looks like it's coming along. Could you please:

  1. take a look at the failing lint check
  2. add tests to oper.tst that use DigraphRemoveVertices etc. and verify that the edge weights are copied appropriately.

It'd be great if you could do this by next meeting, so we can do a proper review of your two PRs.

@mtorpey
Copy link
Collaborator

mtorpey commented Nov 12, 2025

Looks like linting is improved! If you could now add tests, that should satisfy the codecov check.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants