I have the following goal to complete. Suppose I have the following set
1,2,3,4,5,6
And then 3 conditions
the first number must be even
the second number must be odd
the sum of first 3 numbers must be 12
To find the proper set my goal is to generate random sets and check if they meet the conditions.
1,3,2,5,4,6 - 0 conditions
2,4,3,5,6,1 - 1 condition
2,3,4,5,6,1 - 2 conditions
4,5,3,2,6,1 - 3 conditions. All conditions met, this is our set
This is a very basic example, it will be a lot more data and a lot more conditions. Why am I using this way to find the set? Because having so many rules will be impossible to find the proper set and sometimes is impossible to find a set to meet all conditions so I will have a validation that will allow, for example, a set of more than 80% conditions met.
So I want to process this on multiple servers until I found a valid set(s). Probably I will use Amazon s3 instances.
I was looking into RabbitMQ and Celery but as far as I understood, they're more like a queue setup, not parallel processing. Also, I will probably need to write this in PHP and node.js
I was also thinking to have a master server and slave servers. The slave servers will start to generate and validate sets and will send the result to master using rabbit me. Once a set is found, the master will shut down the slave servers.
Not sure if this is the proper approach (both professionally and optimization wise)
What software should I use and what is a good way to implement this?
Thanks!