# Find all semistandard Young tableaux with the same content as a given tableau.

Let T be a semistandard tableau, for example [[1,3,5],[2,4,9]] (columns). I want to find all semistandard tableaux with the same shape and with the same content as T, which is 1,2,3,4,5,9 (the content can be a multi-set). For example, [[1,2,4],[3,5,9]] (columns) is one of such semistandard tableaux.

I can list all semistandard Young tableaux with maximal number 9:

list(SemistandardTableaux([2,2,2], max_entry=9))


and then select those with the same content as T. But this is slow when T is large. Is there faster way to do this? Thank you very much.

edit retag close merge delete

Sort by ยป oldest newest most voted

Here is a quick'n'dirty generator for semistandard tableaux of given shape and with given content:

def gent(shape,content,frontline=None):
if frontline is None:
frontline = [0] * len(shape)

if len(content)==0:
yield [[0]*s for s in shape]
return

e = content[0]
for row,col in enumerate(frontline):
if col>=shape[row] or (row>0 and frontline[row-1]<=col):
continue

frontline[row] += 1

for t in gent(shape,content[1:],frontline):
if row+1==len(shape) or col>=shape[row+1] or e<t[row+1][col]:
t[row][col] = e
yield t

frontline[row] -= 1
return

list(gent([3,3],[1,2,3,4,5,9]))


If given content contains duplicated elements, it may produce the same tableau several times, and so additional filtering may be needed.

more