#8016: graph_editor(p) should work for p a poset
---------------------------------+-----------------------------
       Reporter:  rlm            |        Owner:  sage-combinat
           Type:  enhancement    |       Status:  new
       Priority:  major          |    Milestone:  sage-wishlist
      Component:  combinatorics  |   Resolution:
       Keywords:                 |    Merged in:
        Authors:                 |    Reviewers:
Report Upstream:  N/A            |  Work issues:
         Branch:                 |       Commit:
   Dependencies:                 |     Stopgaps:
---------------------------------+-----------------------------

Comment (by jmantysalo):

 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.

--
Ticket URL: <http://trac.sagemath.org/ticket/8016#comment:1>
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.

Reply via email to