On Dec 14, 12:41 pm, fidelbc <fidel.barr...@gmail.com> wrote:
> Here it is, ticket number 12155.

Thanks.

> G=copy(self)
>
> Maybe here is where the bipartite property gets transferred to G.

I'd say so.

> If my counting is right, there are only 8 bipartite graphs whose
> complements are also bipartite (and each of them has at most 4
> vertices). Would it be useful to preserve the bipartiteness property
> when taking complement in any of these instances? If so, maybe
> implement this in the BipartiteGraph complement method.

That's a good thing to think about, but with so few graphs, and all so
tiny, it doesn't strike me as worth the effort or the side effect of
returning objects of slightly varying types.

> I am also
> thinking that the complement method in the BipartiteGraph could just
> do something like
>
> return Graph(self.edges()).complement()

Note the following alternative, which has the bonus of preserving some
of the naming of the graph.  This would at least fix the bug.

sage: G=graphs.CompleteBipartiteGraph(3,3)
sage: Graph(G).complement()
complement(Complete bipartite graph): Graph on 6 vertices
sage: Graph(G.edges()).complement()
complement(): Graph on 6 vertices

However, in either case it seems very inefficient to create all of the
original edges, just to turn around and destroy them all right away.
I'm not finding a method that converts a BipartiteGraph into a Graph
with very little overhead.  Maybe the present example illustrates the
need for such a thing.

Rob


-- 
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

Reply via email to