Beefy Boxes and Bandwidth Generously Provided by pair Networks
Problems? Is your data what you think it is?
 
PerlMonks  

Re: Code to solve the "matrix formation" puzzle

by tall_man (Parson)
on Jun 20, 2003 at 16:44 UTC ( #267644=note: print w/ replies, xml ) Need Help??


in reply to Code to solve the "matrix formation" puzzle

Looks great, but you didn't use any of the solution-space reducing tricks I suggested in the other thread. Oh well, it turns out that when you get close to the solution, in most cases all the numbers get into the candidate lists.

In the inner loop, I think assigning to a hash is cheaper than deleting from it, so it might be better to assign 0 or undef instead of removing elements.

You mentioned not seeing an algorithm for permutations of n distinct numbers taken r at a time. You could use Algorithm::ChooseSubsets to select the elements, and then permute them with Algorithm::FastPermute.


Comment on Re: Code to solve the "matrix formation" puzzle

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://267644]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others chanting in the Monastery: (14)
As of 2014-09-16 12:47 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    How do you remember the number of days in each month?











    Results (17 votes), past polls