hello all, i am trying to make a griddler/nonogram puzzel solver with matlab.
to do so i need to find all possible UNIQUE permutations of a binary vector. for example :
input Vector: [1 0 1 0]
output matrix:
[1 0 1 0 1 0 0 1 0 1 0 1 0 0 1 1 0 1 1 0 1 1 0 0] untile now i've been using the following code: if true inVec=[1 0 1 0] outMat=perms(inVec); outMat=unique(outMat,'rows') end
This was perfectly fine but for inVec longer then 10 i get an: 'out of memory' error.
is it possible to do this without using perms/unique ? i need this for up to inVec length 20.
Thanks Lampel.
Best Answer