I want to construct a poset from a digraph, but, for some reason, the
digraph thinks it has multiple edges, so sage constructs a poset whose
Hasse diagram is a multi-digraph (and this is inconvenient, but a
surmountable problem). Any ideas what is causing this? (It's entirely
possible this is sensible behavior and I've missed something in the
documentation.)
sage: vertices = [1,2,3,-1,-2,-3]
sage: roots = [[1,-2],[1,-3],[3,2],[1,-1]]
sage: G = DiGraph(dict.fromkeys(vertices,dict()))
sage: for v in roots:
if v[0]==-v[1]:
G.add_edge(v[0],v[1])
G.show()
else:
G.add_edge(v[0],-v[1])
G.add_edge(v[1],-v[0])
G.show()
....:
sage: G
Multi-digraph on 6 vertices
sage: G.edges()
[(-3, -1, None),
(-2, -1, None),
(1, -1, None),
(1, 2, None),
(1, 3, None),
(2, -3, None),
(3, -2, None)]
sage: G.has_multiple_edges()
False
--
You received this message because you are subscribed to the Google Groups
"sage-support" 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-support.
For more options, visit https://groups.google.com/groups/opt_out.