Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

Can't make subposets

I'm running into a problem trying to construct a subposet.

sage: L #poset of permutations
Finite poset containing 14 elements
sage: L.random_subposet(.5)
Finite poset containing 10 elements
sage: SPG=ShortestPathGraph(L) #constructs a graph that is the Hasse diagram 
                               #of L with some edges deleted
sage: SPG
Digraph on 14 vertices
sage: S=Poset(SPG)
sage: S.random_subposet(.5)

results in an error message ending

AttributeError: 'Permutation_class' object has no attribute 'parent'

I get the same error when I try to construct a specific subposet (what I actually want to do), but I can't create duplicate the error in a small example. random_subposet() works just fine for a small poset created from a digraph whose vertices are permutations. Any ideas what could be going on? (I suspect whatever it is may have to be in ShortestPathGraph, given that I can't duplicate the error with a small digraph, but that doesn't really make sense, so I'd appreciate that sort of answer as well.)

click to hide/show revision 2
retagged

Can't make subposets

I'm running into a problem trying to construct a subposet.

sage: L #poset of permutations
Finite poset containing 14 elements
sage: L.random_subposet(.5)
Finite poset containing 10 elements
sage: SPG=ShortestPathGraph(L) #constructs a graph that is the Hasse diagram 
                               #of L with some edges deleted
sage: SPG
Digraph on 14 vertices
sage: S=Poset(SPG)
sage: S.random_subposet(.5)

results in an error message ending

AttributeError: 'Permutation_class' object has no attribute 'parent'

I get the same error when I try to construct a specific subposet (what I actually want to do), but I can't create duplicate the error in a small example. random_subposet() works just fine for a small poset created from a digraph whose vertices are permutations. Any ideas what could be going on? (I suspect whatever it is may have to be in ShortestPathGraph, given that I can't duplicate the error with a small digraph, but that doesn't really make sense, so I'd appreciate that sort of answer as well.)