#8425: BipartiteGraph add_edge allows bipartite property to be violated.
----------------------------+-----------------------------------------------
   Reporter:  rhinton       |       Owner:  rhinton                 
       Type:  defect        |      Status:  new                     
   Priority:  major         |   Milestone:  sage-4.3.4              
  Component:  graph theory  |    Keywords:  BipartiteGraph, add_edge
     Author:  Ryan Hinton   |    Upstream:  N/A                     
   Reviewer:                |      Merged:                          
Work_issues:                |  
----------------------------+-----------------------------------------------
 add_edge() needs to be overridden in !BipartiteGraph in order to preserve
 the bipartite property of the graph.
 {{{
 sage: # non-bipartite graphs are rejected by the constructor
 sage: BipartiteGraph(Graph({0:[1,2], 1:[2]}))
 Traceback (most recent call last)
 ...
 TypeError: Input graph is not bipartite!

 sage: # but the same graph can be constructed edge-by-edge without raising
 an error
 sage: bg = BipartiteGraph()
 sage: bg.add_vertices([0,1,2], left=[True,False,True])
 sage: bg.add_edges([(0,1), (1,2)])  # good so far
 sage: bg.add_edge(2,0)  # should raise exception!
 }}}

-- 
Ticket URL: <http://trac.sagemath.org/sage_trac/ticket/8425>
Sage <http://www.sagemath.org>
Sage: Creating a Viable Open Source Alternative to Magma, Maple, Mathematica, 
and MATLAB

-- 
You received this message because you are subscribed to the Google Groups 
"sage-trac" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/sage-trac?hl=en.

Reply via email to