I made this generic game solving library a while back and never made it public, it’s simple and effective… have a looky when you have a chance:
Essentially you define what the “state” of your game is and all possible moves from said state. The solver in the library can be configured to efficiently solve your game depending on whether you need all solutions, the first N solutions, move-by-move history, duplicate state avoidance, etc.
Let me know what you think!