As
Zaxo pointed out, this is a kind of classic people teach in university, when they talk about algorithm analysis. To get all the possible solutions, in the worst case, it is ~O(2**n) (n is the number of figures you have). As you can see the cost grows really fast when the number of figures increases.
The key point to speed up, is to get rid of the bad solutions as earlier as possible. In this case, you have to sort all figures by their point desc., and when you try, always start with the figure with the highest/higher point (either 0 or 1, include it or don’t include it.)
In general, there is no good
practical solution to this kind of problem, at this stage of computer science. For whatever solution you have, its cost just grows too fast when the number of entity increases.