Digraphs icon indicating copy to clipboard operation
Digraphs copied to clipboard

Added a helper function and updated the existing methods to preserve edge weights when removing vertices, edges or copying digraphs (issue #683)

Open devansh2605 opened this issue 3 months ago • 2 comments

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.

devansh2605 avatar Oct 29 '25 15:10 devansh2605

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 avatar Oct 31 '25 15:10 mtorpey

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

mtorpey avatar Nov 12 '25 11:11 mtorpey

Documentation should be installed in doc/z-chap5.xml

mtorpey avatar Nov 24 '25 14:11 mtorpey