[R] Constrained vector permutation
Jason Smith
devjason at gmail.com
Thu Jan 28 21:40:01 CET 2010
> It wouldn't be guaranteed to produce any usable permutation, but it seems
> like it would be much faster and so could be repeated until an acceptable
> vector is found. What do you think?
>
> Thanks--
> Andy
>
I think I am not understanding what your ultimate goal is so I'm not
sure I can give you appropriate advice. Are you looking for a single
valid permutation or all of them?
Since that constraint sets a ceiling on each subsequent value, it
seems like you could solve this problem more easily and quickly by
using a search strategy instead of random sampling or generating all
permutations then testing. The constraint will help prune the search
space so you only generate valid permutations. Once you are examining
a particular element you can determine which of the additional
elements would be valid, so only consider those.
--jason
More information about the R-help
mailing list