Opened 4 years ago

Closed 4 years ago

Last modified 4 years ago

#17911 closed enhancement (fixed)

Implement connected components for posets

Reported by: tscrim Owned by: sage-combinat
Priority: major Milestone: sage-6.6
Component: combinatorics Keywords: posets
Cc: sage-combinat Merged in:
Authors: Travis Scrimshaw Reviewers: Nathann Cohen
Report Upstream: N/A Work issues:
Branch: 0ca72f3 (Commits) Commit:
Dependencies: Stopgaps:

Description

Currently connected_components is missing for Poset, and a useful/common feature to have.

Change History (9)

comment:1 Changed 4 years ago by tscrim

  • Branch set to public/combinat/posets/connected_components-17911
  • Commit set to 02413eff9d1f12968bd673ab45d7ab1f03d71e4d
  • Status changed from new to needs_review

New commits:

02413efImplement connected components for posets.

comment:2 Changed 4 years ago by ncohen

Hello Travis,

Could you add this new function to the index of poset methods, at the top of the file ?

Thanks,

Nathann

comment:3 Changed 4 years ago by git

  • Commit changed from 02413eff9d1f12968bd673ab45d7ab1f03d71e4d to d27121b06618cbfaf340e58be7232e17b69332d0

Branch pushed to git repo; I updated commit sha1. New commits:

d27121bAdding method to header information.

comment:4 Changed 4 years ago by ncohen

  • Status changed from needs_review to needs_work

I am sorry I did not notice it earlier, but your doctest has an output which can potentially be architecture dependent, i.e. the list of two posets on 5 and 3 elements.

You can easily fix it by creating a poset with two connected components on 5 elements.

Nathann

comment:5 Changed 4 years ago by git

  • Commit changed from d27121b06618cbfaf340e58be7232e17b69332d0 to 0ca72f3919aead7ea6e2080580c02690293d03fb

Branch pushed to git repo; I updated commit sha1. New commits:

0ca72f3Making doctest output constant.

comment:6 follow-up: Changed 4 years ago by tscrim

  • Status changed from needs_work to needs_review

I fixed it by sorting the output based on the size of each connected component.

comment:7 in reply to: ↑ 6 Changed 4 years ago by ncohen

  • Reviewers set to Nathann Cohen
  • Status changed from needs_review to positive_review

I fixed it by sorting the output based on the size of each connected component.

Okay, that does te job too. Good to go!

Nathann

comment:8 Changed 4 years ago by vbraun

  • Branch changed from public/combinat/posets/connected_components-17911 to 0ca72f3919aead7ea6e2080580c02690293d03fb
  • Resolution set to fixed
  • Status changed from positive_review to closed

comment:9 Changed 4 years ago by tscrim

  • Commit 0ca72f3919aead7ea6e2080580c02690293d03fb deleted

Thanks for doing the review Nathann.

Note: See TracTickets for help on using tickets.