Opened 11 years ago

Closed 10 years ago

#13019 closed defect (fixed)

longest_path broken for digraphs

Reported by: Mike Hansen 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:

Status badges

Description (last modified by Mike Hansen)

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 == 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 Nathann Cohen 11 years ago.

Download all attachments as: .zip

Change History (6)

comment:1 Changed 11 years ago by Nathann Cohen

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


Changed 11 years ago by Nathann Cohen

Attachment: trac_13019.patch added

comment:2 Changed 11 years ago by Nathann Cohen

Status: newneeds_review

Here it is ! :-)


comment:3 Changed 11 years ago by Mike Hansen

Authors: Nathann Cohen
Description: modified (diff)
Reviewers: Mike Hansen

comment:4 Changed 11 years ago by Mike Hansen

Keywords: sd40.5 added
Status: needs_reviewpositive_review

Looks good to me.

comment:5 Changed 10 years ago by Jeroen Demeyer

Merged in: sage-5.1.beta5
Resolution: fixed
Status: positive_reviewclosed
Note: See TracTickets for help on using tickets.