Ticket #13006 (closed defect: fixed)
All-paths in a graph blows up when start and end are identical vertices
| Reported by: | rbeezer | Owned by: | jason, ncohen, rlm |
|---|---|---|---|
| Priority: | minor | Milestone: | sage-5.1 |
| Component: | graph theory | Keywords: | sd40.5 |
| Cc: | Work issues: | ||
| Report Upstream: | N/A | Reviewers: | Rob Beezer, William Stein |
| Authors: | Dan Drake | Merged in: | sage-5.1.beta4 |
| Dependencies: | Stopgaps: |
Description (last modified by rbeezer) (diff)
Seems to be a problem for digraphs also.
sage: G = graphs.CompleteGraph(4) sage: G.all_paths(2,2) --------------------------------------------------------------------------- IndexError Traceback (most recent call last) <snip> 11495 s=act_path_iter[-1].next() # try to get the next neighbor/successor, ... 11496 except (StopIteration): # ... if there is none ... <snip> IndexError: list index out of range
For this trivial situation, there is no "previous" iterator. We could immediately return the trivial answer, or catch the exception, or place an empty iterator on the list.
Apply
Attachments
Change History
comment:1 Changed 12 months ago by ddrake
- Status changed from new to needs_review
- Authors set to Dan Drake
comment:2 Changed 12 months ago by rbeezer
- Status changed from needs_review to positive_review
- Reviewers set to Rob Beezer
- Description modified (diff)
Good fix. Passes all tests in sage/graphs and documentation looks good. Positive review.
Note: See
TracTickets for help on using
tickets.

