ASKSAGE: Sage Q&A Forum - RSS feedhttps://ask.sagemath.org/questions/Q&A Forum for SageenCopyright Sage, 2010. Some rights reserved under creative commons license.Mon, 03 Sep 2018 16:38:39 +0200Saturated chainshttps://ask.sagemath.org/question/43545/saturated-chains/ I know there is a command to take all maximal chains and all cover relations of a poset. I am working with a ranked poset and I am wondering if there is a command for all saturated chains in a poset. I appreciate any help given.Sat, 01 Sep 2018 02:16:47 +0200https://ask.sagemath.org/question/43545/saturated-chains/Comment by rburing for <p>I know there is a command to take all maximal chains and all cover relations of a poset. I am working with a ranked poset and I am wondering if there is a command for all saturated chains in a poset. I appreciate any help given.</p>
https://ask.sagemath.org/question/43545/saturated-chains/?comment=43555#post-id-43555This is not my field so I can ask a silly question: Is every saturated chain a subchain of a maximal chain?Sun, 02 Sep 2018 16:26:07 +0200https://ask.sagemath.org/question/43545/saturated-chains/?comment=43555#post-id-43555Comment by slelievre for <p>I know there is a command to take all maximal chains and all cover relations of a poset. I am working with a ranked poset and I am wondering if there is a command for all saturated chains in a poset. I appreciate any help given.</p>
https://ask.sagemath.org/question/43545/saturated-chains/?comment=43566#post-id-43566See also [Stack Overflow question 52105780](https://stackoverflow.com/questions/52105780).Mon, 03 Sep 2018 11:41:38 +0200https://ask.sagemath.org/question/43545/saturated-chains/?comment=43566#post-id-43566Comment by Stiven for <p>I know there is a command to take all maximal chains and all cover relations of a poset. I am working with a ranked poset and I am wondering if there is a command for all saturated chains in a poset. I appreciate any help given.</p>
https://ask.sagemath.org/question/43545/saturated-chains/?comment=43567#post-id-43567Yes. Every saturated chain is a maximal chain of a subposet.Mon, 03 Sep 2018 15:08:34 +0200https://ask.sagemath.org/question/43545/saturated-chains/?comment=43567#post-id-43567Comment by rburing for <p>I know there is a command to take all maximal chains and all cover relations of a poset. I am working with a ranked poset and I am wondering if there is a command for all saturated chains in a poset. I appreciate any help given.</p>
https://ask.sagemath.org/question/43545/saturated-chains/?comment=43569#post-id-43569My naive idea was to take all subchains of all maximal chains. This works, but it is inefficient because you get duplicates.Mon, 03 Sep 2018 16:38:39 +0200https://ask.sagemath.org/question/43545/saturated-chains/?comment=43569#post-id-43569Answer by FrédéricC for <p>I know there is a command to take all maximal chains and all cover relations of a poset. I am working with a ranked poset and I am wondering if there is a command for all saturated chains in a poset. I appreciate any help given.</p>
https://ask.sagemath.org/question/43545/saturated-chains/?answer=43565#post-id-43565Like that
sage: p = posets.DiamondPoset(6)
sage: h = p.hasse_diagram()
sage: [h.all_paths(x,y) for x in h for y in p.principal_order_filter(x)]
[[[0]],
[[0, 1]],
[[0, 2]],
[[0, 3]],
[[0, 4]],
[[0, 1, 5], [0, 2, 5], [0, 3, 5], [0, 4, 5]],
[[1]],
[[1, 5]],
[[2]],
[[2, 5]],
[[3]],
[[3, 5]],
[[4]],
[[4, 5]],
[[5]]]
Mon, 03 Sep 2018 10:56:59 +0200https://ask.sagemath.org/question/43545/saturated-chains/?answer=43565#post-id-43565Comment by rburing for <p>Like that</p>
<pre><code>sage: p = posets.DiamondPoset(6)
sage: h = p.hasse_diagram()
sage: [h.all_paths(x,y) for x in h for y in p.principal_order_filter(x)]
[[[0]],
[[0, 1]],
[[0, 2]],
[[0, 3]],
[[0, 4]],
[[0, 1, 5], [0, 2, 5], [0, 3, 5], [0, 4, 5]],
[[1]],
[[1, 5]],
[[2]],
[[2, 5]],
[[3]],
[[3, 5]],
[[4]],
[[4, 5]],
[[5]]]
</code></pre>
https://ask.sagemath.org/question/43545/saturated-chains/?comment=43568#post-id-43568I would wrap the last command in `sum(..., [])` to get a single list of chains.Mon, 03 Sep 2018 16:30:28 +0200https://ask.sagemath.org/question/43545/saturated-chains/?comment=43568#post-id-43568