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

Remove GraphBundle #18028

Closed
vbraun opened this issue Mar 21, 2015 · 11 comments
Closed

Remove GraphBundle #18028

vbraun opened this issue Mar 21, 2015 · 11 comments

Comments

@vbraun
Copy link
Member

vbraun commented Mar 21, 2015

Doesn't work and nothing changed over the last 5 years. If you want it back its always in the git repo.

CC: @nathanncohen @jasongrout

Component: graph theory

Author: Volker Braun

Branch/Commit: bfb4443

Reviewer: Nathann Cohen

Issue created by migration from https://trac.sagemath.org/ticket/18028

@vbraun vbraun added this to the sage-6.6 milestone Mar 21, 2015
@vbraun
Copy link
Member Author

vbraun commented Mar 21, 2015

Branch: u/vbraun/remove_graphbundle

@vbraun
Copy link
Member Author

vbraun commented Mar 21, 2015

New commits:

bfb4443Delete GraphBundle

@vbraun
Copy link
Member Author

vbraun commented Mar 21, 2015

Author: Volker Braun

@vbraun
Copy link
Member Author

vbraun commented Mar 21, 2015

Commit: bfb4443

@nathanncohen
Copy link
Mannequin

nathanncohen mannequin commented Mar 21, 2015

comment:3

Wow. Glad to see that it is actually possible to remove code from Sage. I always thought that it was 'politically impossible' to remove anything from this software, but fortunately I seem to be wrong.

What would you think of removing BipartiteGraph while we are at it ? This class' design is awful:

sage: g=BipartiteGraph()
sage: l=[(0,1),(3,2),(1,2),(0,3)]
sage: for e in l:
....:     g.add_edge(e)
RuntimeError: Edge vertices must lie in different partitions.

but

sage: g = Graph()
sage: g.add_edges(l)
sage: g.is_bipartite()
True

Also, I just noticed that one can very easily build a non-bipartite BipartiteGraph::

sage: g = BipartiteGraph()
sage: g.add_edges(graphs.CompleteGraph(30).edges())
sage: g.is_bipartite()
False

Please. Can you help me get rid of that class? I'll write the ticket if you agree.

Nathann

@nathanncohen
Copy link
Mannequin

nathanncohen mannequin commented Mar 21, 2015

Reviewer: Nathann Cohen

@vbraun
Copy link
Member Author

vbraun commented Mar 21, 2015

comment:5

I've never used BipartiteGraph. Is it actually useful, just with a bad interface? Or completely non-functional? At least you seem to be able to construct one, maybe start with a deprecation and see if anybody complains.

@nathanncohen
Copy link
Mannequin

nathanncohen mannequin commented Mar 21, 2015

comment:6

I've never used BipartiteGraph. Is it actually useful, just with a bad interface? Or completely non-functional? At least you seem to be able to construct one, maybe start with a deprecation and see if anybody complains.

At some point it was claimed that it was "for teaching purposes", and it was badly designed from the start. add_edge does not check that the graph is bipartite, it checks that the previously computed bipartition stays valid, which is a wrong path to take for non-connected graphs.

Then you have the usual problems:

sage: g=BipartiteGraph(5)
sage: g.complement()
...
RuntimeError: Edge vertices must lie in different partitions.

Honestly if we must have such a class, we cannot afford to let it inherit from Graph. And from the way it appears in the doc, real graph users may want to give it a try, and regret it later.

Nathann

@nathanncohen
Copy link
Mannequin

nathanncohen mannequin commented Mar 21, 2015

comment:7

(basically its only 'feature' is to prevent you from making your graph non-bipartite. And given that it does that wrong, it is probably better if the users call .is_bipartite often instead of relying on the (wrong) exceptions raised by add_edge).

Nathann

@vbraun
Copy link
Member Author

vbraun commented Mar 21, 2015

comment:8

If thats all then I'll be happy to review it...

@vbraun
Copy link
Member Author

vbraun commented Mar 21, 2015

Changed branch from u/vbraun/remove_graphbundle to bfb4443

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

No branches or pull requests

1 participant