Opened 10 years ago
Closed 9 years ago
#9422 closed enhancement (fixed)
Slightly improving is_forest
Reported by: | ncohen | Owned by: | jason, ncohen, rlm |
---|---|---|---|
Priority: | major | Milestone: | sage-4.6 |
Component: | graph theory | Keywords: | |
Cc: | rlm, mvngu | Merged in: | sage-4.6.rc0 |
Authors: | Nathann Cohen | Reviewers: | Leonardo Sampaio |
Report Upstream: | N/A | Work issues: | |
Branch: | Commit: | ||
Dependencies: | Stopgaps: |
Description
As it is implemented at the moment, the method is_forest creates a new graph for each connected component of the graph, then calls the is_tree method for each of them, which checks again that the connected components are....connected !
We can do it a bit faster :-)
Nathann
Attachments (1)
Change History (10)
Changed 10 years ago by
comment:1 Changed 10 years ago by
- Status changed from new to needs_review
comment:2 Changed 10 years ago by
comment:3 follow-up: ↓ 4 Changed 9 years ago by
See comment 20ff at #9925 for a flaky doctest that #9422 and #10067 should fix.
comment:4 in reply to: ↑ 3 Changed 9 years ago by
comment:5 Changed 9 years ago by
- Reviewers set to Leonardo Sampaio
- Status changed from needs_review to positive_review
"Short and useful..." ... and quite easy to review :P
comment:6 Changed 9 years ago by
Thanks !!!
Nathann
comment:7 Changed 9 years ago by
comment:8 Changed 9 years ago by
- Merged in set to sage-4.6.rc0
comment:9 Changed 9 years ago by
- Resolution set to fixed
- Status changed from positive_review to closed
Note: See
TracTickets for help on using
tickets.
Creating a large forest :
Then using two different versions of is_forest
Short and useful... All I love ! :-)
Nathann