My goal is to find the best combination, or good approximation, of weighted elements with different constraints / relations, for example:
- B can only be there after A
- B have to be there after A
- B have a different weight if present after A
- B have a different weight if present in the N next elements after A
- B can only be there every N elements
- B have a weight but does not cost an element
- etc...
An elements can have more than one constraint at the same time.
The numbers of different elements available is 10-15, and the best combination should give a list of 60 elements, repeating this cycle of 60 elements should also follow the rules, like "A can only be done every N elements".
Following these rules, what would be the best way to find the best combination of elements?
I thought about Genetic algorithm, but during the crossover/mutation, we will have to verify if the rules are respected - 'ABAC' and 'ACAB' could be legal, but not necessarily the crossover 'ACAC'. Same for bruteforce, where going through 'AAAA', 'AAAB', etc will mostly give illegal combinations.
Maybe generating a graph out of it could help, but it seems to big and complicated to generate.