The obvious answer: if the vertex labels are not all distinct then you need 
to replace the (single) Hasse diagram with the equivalence class of Hasse 
diagrams under the vertex permutations fixing the labels. Either find some 
normal form of Hasse diagram under the permutation action, or use 
frozenset(orbit) as the UniqueRepresentation data.

And yes, this is going to be dog-slow.

The answer if you care about fast computation: Define == as strict identity 
of pair(Hasse diagram, labels), not isomorphism up to permutation. Provide 
a separate is_isomorphic() method for the latter.




On Monday, September 29, 2014 12:58:00 PM UTC+1, Nathann Cohen wrote:
>
> Hello everybody,
>
> Here is the current design of the Poset class:
>
> def Poset(an_acyclic_labelled_digraph):
>     ...
> FinitePoset(UniqueRepresentation):
>     def __init__(self, an_integer_labelled_hasse_diagram, 
> list_of_vertex_labels):
>         ...
>
> As FinitePoset are UniqueRepresentation, two posets p1,p2 are equal if and 
> only if they were created in the very same way, i.e. if the pairs 
> (an_integer_labelled_hasse_diagram, list_of_vertex_labels) are equal in 
> both cases.
>
> The problem, now, is the following: given a labelled digraph D, how can 
> you associate to D in a unique way a pair 
> (an_integer_labelled_hasse_diagram, list_of_vertex_labels) ?
>
> The answer, as far as I can tell, is that this is impossible because there 
> is not necessarily a total order on the set of vertex labels.
>
> Apply any of the digraph automorphism to the list of labels and you get 
> the very same graph, but the posets will be non-equal for 
> UniqueRepresentation.
>
> This is one of the reasons behind the bug reported 2 years ago in #14019:
>
> sage: d = DiGraph({2:[1],3:[1]})   
> sage: p1 = Poset(d)
> sage: p2 = p1.relabel({1:1,2:3,3:2})
> sage: p1.hasse_diagram() == p2.hasse_diagram()
> True
> sage: p1 == p2
> False
>
> We cannot have a UniqueRepresentation poset class which takes a list of 
> vertices as arguments. It must only take a HasseDigraph. If you see another 
> way, please enlighten me.
>
> Nathann
>

-- 
You received this message because you are subscribed to the Google Groups 
"sage-devel" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to sage-devel+unsubscr...@googlegroups.com.
To post to this group, send email to sage-devel@googlegroups.com.
Visit this group at http://groups.google.com/group/sage-devel.
For more options, visit https://groups.google.com/d/optout.

Reply via email to