Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Deleting vertices or edges from an EdgeWeightedDigraph deletes the weights, so does taking a mutable copy. #683

Open
markuspf opened this issue Aug 28, 2024 · 0 comments
Labels
possible-bug A label for PRs or issues that relate to possible bugs.

Comments

@markuspf
Copy link
Contributor

I am not sure this is intended.

Creating a digraph with edge weights and removing vertices, edges, or taking a mutable copy makes the resulting grpah not have weights.

gap> d := EdgeWeightedDigraph([[2], [3], [4], []], [[1], [1], [1], []]);
<immutable digraph with 4 vertices, 3 edges>
gap> HasEdgeWeights(d);
true
gap> e := DigraphRemoveVertex(d, 1);
<immutable digraph with 3 vertices, 2 edges>
gap> HasWeights(e);
Error, Variable: 'HasWeights' must have a value
not in any function at *stdin*:19
gap> HasEdgeWeights(e);
false
gap> f := DigraphRemoveEdge(d, 1, 2);
<immutable digraph with 4 vertices, 2 edges>
gap> HasEdgeWeights(f);              
false
gap> g := DigraphMutableCopy(d);
<mutable digraph with 4 vertices, 3 edges>
gap> HasEdgeWeights(g);
false
@wilfwilson wilfwilson added the possible-bug A label for PRs or issues that relate to possible bugs. label Aug 29, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
possible-bug A label for PRs or issues that relate to possible bugs.
Projects
None yet
Development

No branches or pull requests

2 participants