Hello !!! > This is the only sure way I am aware of to get a "generic" graph that > can be complemented and modified at will.
Thsi is what I ended up doing in the docstring ^^; > In particular, > to_undirected() uses the copy module and so will return an object of > the same type as the original. Got it ! > These discuss (among other things) various approaches to the extra > constraints of the BipartiteGraph class. In particular, we agreed > that add_edge() can raise an exception in cases like this where an > algorithm violates the bipartite constraints. Then Robert's suggested > solution (which is a good one) is to implement a customized version of > the method in BipartiteGraph, if possible, that "does the right > thing." In this case, the right thing may include implementing > is_perfect() for BipartiteGraph to simply return True. We might also > want to implement complement() for BipartiteGraph. The question is > whether it should return the Graph complement or the BipartiteGraph > complement given the current partition. Probably the former. The > latter could be implemented as bipartite_complement() to avoid > confusion. Then why should BipartiteGraph inherit from Graph or generic_graph ? Perhaps the best way to avoid confusion could be to make it as independent as possible from functions that may not work, and import them in BipartiteGraph only when they are compatible... Otherwise, by default, functions are added to the BipartiteGraph class while they can not be used... > Copy me on any tickets you create: I am happy to review them! I added you to this is_perfect ticket ! In the end, I had not even thought about your most wise answer : check that the graph is not Bipartite, and if it is, just answer True... I felt a bit stupid reading your answer ^^; If you have some time to spend reviewing some tickets, please take any that plseases you in the graph theory section, for they are all mine and I can not review any of them ! ;-) I also sent a message a few days ago about them : http://groups.google.com/group/sage-devel/browse_thread/thread/780b22c1b987935c Thank you again for your answers, and my excuses for my previous emails.. I was a bit angry to be stuck at this point because of the add_edge function :-) Nathann -- To post to this group, send an email to sage-devel@googlegroups.com To unsubscribe from this group, send an email to sage-devel+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/sage-devel URL: http://www.sagemath.org