#12385: Questionable semantics of DiGraph().all_simple_paths
----------------------------+-----------------------------------------------
   Reporter:  kini          |          Owner:  kini                            
       Type:  defect        |         Status:  needs_review                    
   Priority:  major         |      Milestone:  sage-5.0                        
  Component:  graph theory  |       Keywords:  digraphs graphs all_simple_paths
Work_issues:                |       Upstream:  N/A                             
   Reviewer:                |         Author:  Keshav Kini                     
     Merged:                |   Dependencies:                                  
----------------------------+-----------------------------------------------

Comment(by ncohen):

 Hellooooo !!!

 Hmmm... I was a bit worried at your path.count(path[-1]) `^^;`

 What do you think of the alternative version I attach ? In this one I
 check whether the path is a cycle *before* adding it to the queue. This
 way a "neighbor in path" is sufficient.

 I also do not understand why you removed the "if trivial" from before the
 loop to put it inside. It would be a waste to "test" trivial at each loop,
 and also to test len(path) > 1 when we know it will always be true after
 some step, wouldn't it ?

 Tell me what you think `:-)`

 Nathann

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