#9925: Doctest error in sage/graphs/graph.py
---------------------+------------------------------------------------------
 Reporter:  mpatel   |         Owner:  mvngu     
     Type:  defect   |        Status:  closed    
 Priority:  blocker  |     Milestone:  sage-4.6  
Component:  doctest  |    Resolution:  worksforme
 Keywords:           |        Author:            
 Upstream:  N/A      |      Reviewer:            
   Merged:           |   Work_issues:            
---------------------+------------------------------------------------------

Comment(by ncohen):

 Hmmm.... It looks like it's not --so-- rare O_o

 {{{
 sage: sum( not isinstance(graphs.RandomBipartite(10, 10,
 .5).is_even_hole_free(certificate = True), Graph) for i in range(10000) )
 96
 }}}

 something like 1%...`:-/`

 And with this :

 {{{
 sage: t = lambda x: Graph(x).is_forest() or
 isinstance(x.is_even_hole_free(certificate = True), Graph)
 sage: sum( not t(graphs.RandomBipartite(10, 10, .5)) for i in range(10000)
 )
 111
 }}}

 Which means it comes from .... the bug in the method subgraph_search, and
 not from the theoretical probability `:-/`

 With the patch applied :

 {{{
 sage: sage: t = lambda x: Graph(x).is_forest() or
 isinstance(x.is_even_hole_free(certificate = True), Graph)
 sage: sage: sum( not t(graphs.RandomBipartite(10, 10, .5)) for i in
 range(10000) )
 0
 }}}

 Which **relieved** me. I should post a patch to add this is_forest
 condition anyway. Can I put it on this ticket ?

 Nathann

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