You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Obviously graph_editor(p) doesn't work on its own, since p is not a graph. However, it should be possible to implement a few functions for p to make this work:
File "sage/graphs/graph_editor.py", line 111, in graph_editor
if not isinstance(graph.get_pos(), dict):
AttributeError: 'FinitePoset' object has no attribute 'get_pos'
While wishing, it would also be nice if the graph editor could be adapted to remember vertex labels, at least in the case that the labels are strings.
If the name of variable to save the (undirected) graph is P, then it is easy to just say
d = DiGraph()
d.add_vertices(P.vertices())
pos = P.get_pos()
for e in P.edges(labels=False):
if pos[e[0]][1] < pos[e[1]][1]:
d.add_edge(e)
else:
d.add_edge([e[1], e[0]])
P = Poset(d).canonical_label()
to convert it to poset. But really somebody should expand the code to handle digraphs.
Obviously
graph_editor(p)
doesn't work on its own, sincep
is not a graph. However, it should be possible to implement a few functions forp
to make this work:While wishing, it would also be nice if the graph editor could be adapted to remember vertex labels, at least in the case that the labels are strings.
Depends on #30540
CC: @saliola @rkirov @qed777
Component: combinatorics
Issue created by migration from https://trac.sagemath.org/ticket/8016
The text was updated successfully, but these errors were encountered: