It's really hard to explain how it works, so I decided to just go implementing, instead of trying to explain, but this encoding really deserves an explanation. I've not implemented the whole thing yet, and I'm already disappointed with the speed of the combined solver.
The node rules I added so far are enough to guarantee no loops. (even without the field/path rules).
I still need to finish the logic to make it cap out at 2 exits. Also, it is more efficient to explicitly add the 2-exits-only rules anyway, even when the node rules imply it.
I'm trying to port all the rules from my own project, which you can find at https://git.sr.ht/~xerool/alcazar-py .
Maybe I should set that one up on a github instead of trying to port everything to here.
[Not really ready to merge]
It's really hard to explain how it works, so I decided to just go implementing, instead of trying to explain, but this encoding really deserves an explanation. I've not implemented the whole thing yet, and I'm already disappointed with the speed of the combined solver.
The node rules I added so far are enough to guarantee no loops. (even without the field/path rules).
I still need to finish the logic to make it cap out at 2 exits. Also, it is more efficient to explicitly add the 2-exits-only rules anyway, even when the node rules imply it.
I'm trying to port all the rules from my own project, which you can find at https://git.sr.ht/~xerool/alcazar-py . Maybe I should set that one up on a github instead of trying to port everything to here.