Opened 7 years ago

Closed 7 years ago

#13019 closed defect (fixed)

longest_path broken for digraphs

Reported by: mhansen Owned by: jason, ncohen, rlm
Priority: minor Milestone: sage-5.1
Component: graph theory Keywords: sd40.5
Cc: Merged in: sage-5.1.beta5
Authors: Nathann Cohen Reviewers: Mike Hansen
Report Upstream: N/A Work issues:
Branch: Commit:
Dependencies: Stopgaps:

Description (last modified by mhansen)

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

Attachments (1)

trac_13019.patch (1.7 KB) - added by ncohen 7 years ago.

Download all attachments as: .zip

Change History (6)

comment:1 Changed 7 years ago by ncohen

Oh, right... We updated degree_out later on, and it looks like we did not add a doctest for digraphs :-)

Nathann

Changed 7 years ago by ncohen

comment:2 Changed 7 years ago by ncohen

  • Status changed from new to needs_review

Here it is ! :-)

Nathann

comment:3 Changed 7 years ago by mhansen

  • Authors set to Nathann Cohen
  • Description modified (diff)
  • Reviewers set to Mike Hansen

comment:4 Changed 7 years ago by mhansen

  • Keywords sd40.5 added
  • Status changed from needs_review to positive_review

Looks good to me.

comment:5 Changed 7 years ago by jdemeyer

  • Merged in set to sage-5.1.beta5
  • Resolution set to fixed
  • Status changed from positive_review to closed
Note: See TracTickets for help on using tickets.