You have the right idea I think, but there is tremendous redundancy in the sums for a typical array, so the intermediate nubs save the day. i. 20 20 finishes in much less than a second, for example. Of course, Raul's solution doesn't seem to be doing intermediate nubs, and it still works in about the same time and space, so I don't know what's going on there.

gc

On Feb 5, 2008, at 9:38 AM, Devon McCormick wrote:

Well, for a 20x20 you're going to have to deal with something like 10^26 items to handle the general case - not very tractable no matter how you do it. A better understanding of the overall problem might allow you to prune the possibilities but, as you've stated it, brute force does not scale well. For instance, if you really are dealing with APVs as in your example, there
should be tremendous shortcuts.

----------------------------------------------------------------------
For information about J forums see http://www.jsoftware.com/forums.htm

Reply via email to