#14019: equality is broken for Posets
-------------------------------------+-------------------------------------
Reporter: ncohen | Owner: sage-combinat
Type: defect | Status: needs_work
Priority: major | Milestone: sage-6.4
Component: combinatorics | Resolution:
Keywords: posets | Merged in:
Authors: Travis Scrimshaw, | Reviewers: Travis Scrimshaw,
Anne Schilling | Anne Schilling
Report Upstream: N/A | Work issues:
Branch: | Commit:
public/combinat/poset/fix_equality-14019|
68c2902122a52cc16a13831b80d7a52c4e98fe86
Dependencies: #17059 | Stopgaps: #14185
-------------------------------------+-------------------------------------
Comment (by aschilling):
Hi Nathann,
I am not quite sure why this is supposed to be wrong. As you wrote the
output of `canonical_label` of `DiGraph` is
{{{
sage: D = digraphs.Path(10)
sage: D.edges()
[(0, 1, None),
(1, 2, None),
(2, 3, None),
(3, 4, None),
(4, 5, None),
(5, 6, None),
(6, 7, None),
(7, 8, None),
(8, 9, None)]
sage: D.canonical_label().edges()
[(0, 9, None),
(2, 4, None),
(3, 2, None),
(4, 6, None),
(5, 3, None),
(6, 8, None),
(7, 5, None),
(8, 1, None),
(9, 7, None)]
}}}
I do not understand why (the documentation says that this is supposed to
be unique, but there seems nothing unique about this particular choice to
me). But with this we obtain
{{{
sage: P = Poset(digraphs.Path(10))
sage: Pp = P.canonical_label()
sage: Pp.cover_relations()
[[0, 9], [9, 7], [7, 5], [5, 3], [3, 2], [2, 4], [4, 6], [6, 8], [8, 1]]
sage: Pp.linear_extension()
[0, 9, 7, 5, 3, 2, 4, 6, 8, 1]
}}}
which is indeed the single linear extension for this poset. If this is not
the desired output, perhaps someone should rewrite the documentation and
specify precisely what this *unique* poset is supposed to be. Is it
supposed to be naturally labelled perhaps? Is that what your problem is?
It does not say so in the documentation.
Anne
--
Ticket URL: <http://trac.sagemath.org/ticket/14019#comment:59>
Sage <http://www.sagemath.org>
Sage: Creating a Viable Open Source Alternative to Magma, Maple, Mathematica,
and MATLAB
--
You received this message because you are subscribed to the Google Groups
"sage-trac" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/sage-trac.
For more options, visit https://groups.google.com/d/optout.