Opened 11 years ago
Closed 11 years ago
#5932 closed defect (fixed)
[with patch, positive review] graphs.RandomRegular(3,10) often returns a graph on 0 vertices
Reported by: | was | Owned by: | rlm |
---|---|---|---|
Priority: | major | Milestone: | sage-4.1.1 |
Component: | graph theory | Keywords: | |
Cc: | Merged in: | sage-4.1.1.alpha0 | |
Authors: | Robert Miller | Reviewers: | Jason Grout |
Report Upstream: | Work issues: | ||
Branch: | Commit: | ||
Dependencies: | Stopgaps: |
Description
The docstring for graphs.RandomRegular? says
Returns a random d-regular graph on n vertices, or returns False on failure.
However, try calling it a few times with input 3,10 and with probability about 25% you'll get back an empty graph!:
sage: graphs.RandomRegular(3,10) Graph on 0 vertices sage: [len(graphs.RandomRegular(3,10)) for _ in range(1000)].count(0) 232
Attachments (1)
Change History (5)
comment:1 Changed 11 years ago by
comment:2 Changed 11 years ago by
- Summary changed from graphs.RandomRegular(3,10) often returns a graph on 0 vertices to [with patch, needs review] graphs.RandomRegular(3,10) often returns a graph on 0 vertices
Changed 11 years ago by
comment:3 Changed 11 years ago by
- Reviewers set to Jason Grout
- Summary changed from [with patch, needs review] graphs.RandomRegular(3,10) often returns a graph on 0 vertices to [with patch, positive review] graphs.RandomRegular(3,10) often returns a graph on 0 vertices
The fix looks correct, the file passes doctests, and everything looks great!
comment:4 Changed 11 years ago by
- Merged in set to sage-4.1.1.alpha0
- Resolution set to fixed
- Status changed from new to closed
Note: See
TracTickets for help on using
tickets.
This is a bug in NetworkX. Their docstring says: