Skip to content

Commit 27ef3a6

Browse files
mtorpeyjames-d-mitchell
authored andcommitted
Fix Issue #617: DigraphRemoveEdge now removes appropriate edge label
1 parent f5c73de commit 27ef3a6

2 files changed

Lines changed: 14 additions & 1 deletion

File tree

gap/oper.gi

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -241,7 +241,7 @@ function(D, src, ran)
241241
pos := Position(D!.OutNeighbours[src], ran);
242242
if pos <> fail then
243243
Remove(D!.OutNeighbours[src], pos);
244-
Remove(DigraphEdgeLabels(D)[src], pos);
244+
RemoveDigraphEdgeLabel(D, src, pos);
245245
fi;
246246
return D;
247247
end);

tst/testinstall.tst

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -416,6 +416,19 @@ gap> d := EdgeWeightedDigraph([[2], [1]], [[5], [10]]);
416416
gap> EdgeWeights(d);
417417
[ [ 5 ], [ 10 ] ]
418418
419+
# Issue 617: bug in DigraphRemoveEdge, wasn't removing edge labels
420+
gap> D := DigraphByEdges(IsMutableDigraph, [[1, 2], [2, 3], [3, 4], [4, 1], [1, 1]]);;
421+
gap> DigraphEdgeLabels(D);
422+
[ [ 1, 1 ], [ 1 ], [ 1 ], [ 1 ] ]
423+
gap> DigraphRemoveEdge(D, [1, 2]);;
424+
gap> DigraphEdgeLabels(D);
425+
[ [ 1 ], [ 1 ], [ 1 ], [ 1 ] ]
426+
gap> D := DigraphByEdges(IsMutableDigraph, [[1, 2], [2, 3], [3, 4], [4, 1], [1, 1]]);;
427+
gap> SetDigraphEdgeLabel(D, 1, 2, "test");
428+
gap> DigraphRemoveEdge(D, 1, 2);;
429+
gap> DigraphEdgeLabels(D);
430+
[ [ 1 ], [ 1 ], [ 1 ], [ 1 ] ]
431+
419432
# DIGRAPHS_UnbindVariables
420433
gap> Unbind(D);
421434
gap> Unbind(adj);

0 commit comments

Comments
 (0)