Opened 4 years ago

Closed 7 months ago

# The function show() duplicates some edges when using loops and edge_colors in an undirected graph

Reported by: Owned by: boussica iebousbaa minor sage-duplicate/invalid/wontfix graph theory graph, edge_colors, show, multiedges, loop, edge, sagedays89 Adrien Boussicault David Coudert N/A u/iebousbaa/the_function_show___duplicates_some_edges_when_using_loops_and_edge_colors_in_an_undirected_graph aff61d016156e16b0d28a6c27243492a1cba8e47

### Description

When we colorize the edges of an undirected graph containing a loop, the function show() draws some extra edges. For example, the following code corresponds to the situation :

```E=[(1,1),(1,2)]
g1 = Graph( E, loops=True, multiedges=False )
g1.show()
g1.show( edge_colors={"blue":[(2,1)]} )
```

If no loop is present, the code works correctly :

```E=[(1,2)]
g1 = Graph( E, loops=True, multiedges=False )
g1.show()
g1.show( edge_colors={"blue":[(2,1)]} )
```

Now, if we replace (2,1) by (1,2), all the codes work. We think that all our examples should work when using (2,1). Indeed, usually, inside an undirected graph, we can use (1,2) or (2,1) for an edge {1,2}.

### comment:1 Changed 4 years ago by boussica

• Owner changed from (none) to boussica

### comment:2 Changed 4 years ago by mabdel

• Owner changed from boussica to mabdel

### comment:3 Changed 4 years ago by iebousbaa

• Branch set to u/iebousbaa/duplicate_edge_bug

### comment:4 Changed 4 years ago by iebousbaa

• Commit set to 83149d13cebabe2d3f8eb9648c6939eb219c1726
• Owner changed from mabdel to iebousbaa

New commits:

 ​88bacde `First implementation of BDiagrams` ​8e9cc62 `test` ​5214630 `Cleaning + sub-bdiagrams + coproduct` ​45289d8 `Coproduit debug ... and others ...` ​ac34a66 `trac 20014 relative import is now needed` ​9eac794 `Correct a bug in the product and add unit test` ​83149d1 `Trac #22979: Correction of edges duplication in show()`

### comment:5 Changed 4 years ago by chapoton

The branch contains material about Bdiagrams that has nothing to do with this ticket.

### comment:7 Changed 4 years ago by iebousbaa

Dear Mr Chapoton,

We found the bug during the Sage days organized in Algeria. Mr Adrien Boussicault reported the bug except that we could not commit the correction on a branch using the university network. I erroneously pushed the correction on a new branch created locally from my branch # 20014. I'm still looking in the documentation the way to fix it. I'm sorry about that.

Last edited 4 years ago by iebousbaa (previous) (diff)

### comment:8 Changed 4 years ago by iebousbaa

• Branch u/iebousbaa/duplicate_edge_bug deleted
• Commit 83149d13cebabe2d3f8eb9648c6939eb219c1726 deleted

### comment:9 Changed 4 years ago by iebousbaa

• Branch set to u/iebousbaa/the_function_show___duplicates_some_edges_when_using_loops_and_edge_colors_in_an_undirected_graph

### comment:10 Changed 8 months ago by dcoudert

• Commit set to aff61d016156e16b0d28a6c27243492a1cba8e47
• Component changed from graphics to graph theory
• Milestone changed from sage-8.0 to sage-duplicate/invalid/wontfix
• Status changed from new to needs_review

This issue has been fixed in #24051. So I propose to close this ticket.

New commits:

 ​aff61d0 `Trac #22979: Correction of duplicated edges in show()`

### comment:11 Changed 8 months ago by dcoudert

• Status changed from needs_review to positive_review

This issue has been fixed in #24051. So I propose to close this ticket.

### comment:12 Changed 7 months ago by dcoudert

• Reviewers set to David Coudert