"Nicolas M. Thiery" <nicolas.thi...@u-psud.fr> writes:

>       Hi Martin!
>
> And thanks for your feedback,

Thanks combinat!!!

> On Wed, Mar 02, 2011 at 10:31:17AM +0100, Martin Rubey wrote:
>> BTW, I had problems (i.e., I could not) displaying a poset having graphs
>> as vertices.  I'll post an example as soon as I can.
>
> Yes. Graphs are currently always mutable, and thus cannot be used as
> vertex of other graphs / posets. This is an issue we dicussed a couple
> times:
>
> http://groups.google.com/group/sage-combinat-devel/search?group=sage-combinat-devel&q=graph+immutable&qt_g=Rechercher+dans+ce+groupe
>
> I give a hacky workaround in:
>
>     
> http://groups.google.com/group/sage-combinat-devel/browse_thread/thread/211a073fe1e7f3d8/95ae714a24a0df4d?lnk=gst&q=graph+immutable#95ae714a24a0df4d

Sorry, again I was not precise enough: the problem was only with the
LaTeX display.  (I found the workaround.)

Here is a complete example.  Please load the attached poset with 

P=load("poset.sobj")

(there is nothing secret about it, but I found it easier to store it
that way)

Then do ppPoset(P).  The size of the graphs does not seem to be taken
into account by the poset layout algorithm...

Martin

# pp(l) turns a list of edges into a graph
def pp(l): 
    G = graphs.CycleGraph(4)
    H = Graph(pos=G._pos)
    for e in l:
        H.add_edge(e)
    return H

def ppPoset(P):
    H = P.hasse_diagram()

    lG = [(v.vertex, pp(v.element)) for v in P]
    for G in lG:
        G[1]._immutable = true
    d = dict(lG)
    H.relabel(d)

    H.set_latex_options(format = "dot2tex") 
    view(H, tightpage = True, viewer = "pdf")

-- 
You received this message because you are subscribed to the Google Groups 
"sage-combinat-devel" group.
To post to this group, send email to sage-combinat-devel@googlegroups.com.
To unsubscribe from this group, send email to 
sage-combinat-devel+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/sage-combinat-devel?hl=en.

Attachment: poset.sobj
Description: Binary data

Reply via email to