I'm currently making a rummikub "game" so that when I make a Mistake I am able to get the board back easily to what it was before.
Currently in need to find out for a given number of tiles if a solution exists and what the solution is.
Example
Elements Selected are {Red1, Red1, Blue1, Black1, Orange1, Orange1}
And a solution would be {Red1, Blue1, Orange1} and {Red1, Black1, Orange1}
I can currently determine which groups and runs are possible ({Red1, Blue1, Black1, Orange1} being a valid group that wouldn't appear in the valid solution). I need a solution that can go the next step and tell me which of the groups/runs can exist together and make sure each tile is used once. If no such solution exist, it needs to be able to report that. The solution does not have to be optimal (ie use the smallest number of groups/run), it just has to be valid.