Opened 5 years ago
Closed 5 years ago
#16984 closed enhancement (fixed)
Poset is_chain: Minimal speedup
Reported by:  jmantysalo  Owned by:  

Priority:  trivial  Milestone:  sage6.4 
Component:  combinatorics  Keywords:  
Cc:  ncohen  Merged in:  
Authors:  Jori Mäntysalo  Reviewers:  Nathann Cohen 
Report Upstream:  N/A  Work issues:  
Branch:  0fe52a0 (Commits)  Commit:  0fe52a0a75050401a0ce2ace63fddf4f421a78f6 
Dependencies:  Stopgaps: 
Description
is_chain()
for Poset can first check that number of vertices is exactly one more than number of edges.
Change History (8)
comment:1 Changed 5 years ago by
 Branch set to u/jmantysalo/poset_is_chain__minimal_speedup
comment:2 Changed 5 years ago by
 Cc ncohen added
 Commit set to dbc091afc25d310fc58bdb59ad7b7a0c6b105f03
 Status changed from new to needs_review
comment:3 Changed 5 years ago by
 Reviewers set to Nathann Cohen
 Status changed from needs_review to positive_review
Simple and good.
Nathann
comment:4 Changed 5 years ago by
 Status changed from positive_review to needs_work
We are trying to be python3 compliant. So please change <>
into !=
. Thanks.
comment:5 Changed 5 years ago by
 Commit changed from dbc091afc25d310fc58bdb59ad7b7a0c6b105f03 to 0fe52a0a75050401a0ce2ace63fddf4f421a78f6
Branch pushed to git repo; I updated commit sha1. New commits:
0fe52a0  Changed '<>' to '!=' for python3 compatibility.

comment:6 Changed 5 years ago by
 Status changed from needs_work to needs_review
comment:7 Changed 5 years ago by
 Status changed from needs_review to positive_review
Thanks.
PS  For something trivial like this, you could have set it right back to positive review (I should have mentioned you could have done this in comment:4).
comment:8 Changed 5 years ago by
 Branch changed from u/jmantysalo/poset_is_chain__minimal_speedup to 0fe52a0a75050401a0ce2ace63fddf4f421a78f6
 Resolution set to fixed
 Status changed from positive_review to closed
Note: See
TracTickets for help on using
tickets.
New commits:
Added a quick check for number of vertices and edges.