#13019: longest_path broken for digraphs
---------------------------------+------------------------------------------
       Reporter:  mhansen        |         Owner:  jason, ncohen, rlm
           Type:  defect         |        Status:  needs_review      
       Priority:  minor          |     Milestone:  sage-5.1          
      Component:  graph theory   |    Resolution:                    
       Keywords:                 |   Work issues:                    
Report Upstream:  N/A            |     Reviewers:  Mike Hansen       
        Authors:  Nathann Cohen  |     Merged in:                    
   Dependencies:                 |      Stopgaps:                    
---------------------------------+------------------------------------------
Changes (by {'newvalue': u'Nathann Cohen', 'oldvalue': ''}):

  * reviewer:  => Mike Hansen
  * author:  => Nathann Cohen


Old description:

> {{{
>
> sage: g = graphs.CompleteGraph(5).to_directed()
> sage: g.longest_path(s=1,t=2)
> ---------------------------------------------------------------------------
> AttributeError                            Traceback (most recent call
> last)
> /home/mike/src/Imaging-1.1.7/<ipython-input-88-bddf7e1e9edc> in
> <module>()
> ----> 1 g.longest_path(s=Integer(1),t=Integer(2))
>
> /opt/sage/local/lib/python2.6/site-packages/sage/graphs/generic_graph.pyc
> in longest_path(self, s, t, use_edge_labels, algorithm, solver, verbose)
>    4772             (s is not None and (
>    4773                     (s not in self) or
> -> 4774                     (self._directed and self.degree_out(s) == 0)
> or
>    4775                     (not self._directed and self.degree(s) ==
> 0))) or
>    4776             (t is not None and (
>
> AttributeError: 'DiGraph' object has no attribute 'degree_out'
> }}}

New description:

 {{{

 sage: g = graphs.CompleteGraph(5).to_directed()
 sage: g.longest_path(s=1,t=2)
 ---------------------------------------------------------------------------
 AttributeError                            Traceback (most recent call
 last)
 /home/mike/src/Imaging-1.1.7/<ipython-input-88-bddf7e1e9edc> in <module>()
 ----> 1 g.longest_path(s=Integer(1),t=Integer(2))

 /opt/sage/local/lib/python2.6/site-packages/sage/graphs/generic_graph.pyc
 in longest_path(self, s, t, use_edge_labels, algorithm, solver, verbose)
    4772             (s is not None and (
    4773                     (s not in self) or
 -> 4774                     (self._directed and self.degree_out(s) == 0)
 or
    4775                     (not self._directed and self.degree(s) == 0)))
 or
    4776             (t is not None and (

 AttributeError: 'DiGraph' object has no attribute 'degree_out'
 }}}

 Apply trac_13019.patch

--

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