#8330: BipartiteGraph needs to hook delete_vertex() and delete_vertices()
----------------------------+-----------------------------------------------
   Reporter:  rhinton       |       Owner:  rhinton       
       Type:  defect        |      Status:  needs_work    
   Priority:  major         |   Milestone:  sage-4.3.4    
  Component:  graph theory  |    Keywords:  BipartiteGraph
     Author:  Ryan Hinton   |    Upstream:  N/A           
   Reviewer:                |      Merged:                
Work_issues:                |  
----------------------------+-----------------------------------------------
Changes (by rhinton):

  * status:  needs_review => needs_work


Old description:

> !BipartiteGraph needs to hook delete_vertex() and delete_vertices().
>
> {{{
> }}}
>
> It should also hook the add_vertex() and add_edge() (and similar) calls,
> but not sure of the right way to do this.

New description:

 !BipartiteGraph needs to hook delete_vertex() and delete_vertices().

 {{{
 sage: g = BipartiteGraph(graphs.CycleGraph(4))
 sage: (g.left, g.right)
 ([0, 2], [1, 3])
 sage: g.delete_vertex(0)
 sage: g.left
 [0, 2]
 }}}
 Note vertex 0 still shows up in the left partition.

 It should also hook the add_vertex() and add_edge() (and similar) calls,
 but not sure of the right way to do this.

--

Comment:

 I just tested graph.py for another potential change, and found that a few
 doctests fail due to this patch.  Specifically, the tests create
 BipartiteGraphs (e.g. K23), and the Graph algorithm adds a temp vertex,
 then deletes it later.  But the new delete_vertex() raises an exception
 when it can't find the temp vertex in its left or right sets.

 So we may need to fix add_vertex before this delete_vertex solution will
 work.  Or should we do a soft-fail (print a warning?) instead of raising
 an exception?

-- 
Ticket URL: <http://trac.sagemath.org/sage_trac/ticket/8330#comment:4>
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