I want to make an application for generating a sequence (called S) of items (I), based on conditions (called C).
The Conditions are defined as a property with a 'bonus/reduction'. The total score (T) is defined by summing up al condition scores.
Some conditions are based on a specific item, some not.
Example (where Ix and Iy are different items) - Ix on first 5 places in S has a score of +20. - Ix directly after Iy has a score of -10.
However, I was wondering if there is an algorithm or principle for this problem (to find the highest total score)? It seems reasonably generic (except for the condition specification).
Finding the top score by trying all possibilities might end up in a lot of checks (like about 30! for 30 items).
Not all items have to be used in the sequence, but each item has a length, and there is a bonus for having the sum of length equal (as good as possible) to the requested length.
Each item can be used only once (at max).